Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

feat(tui): refresh the TUI and sync upstream correctness fixes - #45

Merged
YaseenHQ merged 1 commit into
mainfrom
feat/tui-and-upstream-sync
Aug 13, 2026
Merged

YaseenHQ merged 1 commit into
mainfrom
feat/tui-and-upstream-sync

Conversation

@YaseenHQ

Copy link
Copy Markdown
Owner

Related Issue

No linked issue — the problems are described below.

Problem

Several unrelated problems had accumulated in the working tree, plus a set of upstream fixes we had not yet taken.

The welcome cube was visibly broken. Two stacked rows of block glyphs showed a horizontal seam. A font paints only its own glyph box, and terminals that add line spacing (Terminal.app among them) leave a gap between rows — Claude Code's face does not show this because a terminal fills a cell's background rect edge to edge regardless of font metrics. The face also only ever appears before the first prompt, since the welcome header lives in the transcript and scrolls away as soon as work starts.

Subagent model selection was two overlapping mechanisms. model_preference offers exactly two roles, while profile.model takes any alias, and both fed the same binding path. Neither could send a task to a model chosen for its capabilities. Separately, the coder profile carried Agent/AgentSwarm — and coder is what subagents are spawned as, so a subagent could spawn its own subagents and make fan-out recursive.

Cancellation was unresponsive during retries. Provider SDK clients defaulted to maxRetries: 2 with a backoff sleep that never observes the turn's abort signal, so Ctrl+C during a 429 or 5xx only took effect after the sleep elapsed, and those hidden attempts double-counted the engine's own retry budget.

A turn interrupted mid-reasoning bricked the session. The assistant message left holding only a reasoning fragment serialised with neither content nor tool_calls, and strict Chat Completions gateways then rejected every later request in that session.

Prompt-cache prefix stability was unverified. Provider caching only pays off when each request extends the previous one without rewriting earlier history, and nothing checked it — a regression would have surfaced only as cost and latency drift.

What changed

TUI. Solid logo cells now set the cell background, which closes the seam; all three render paths (header, echadron web ready banner, rainbow easter egg) share one painter. Every cell is a full block so nothing renders shorter than its neighbours — the previous half-block edges made the silhouette look clipped once the body was filled. The cube gained a wink, and its face now drives the activity line, following the streaming phase, tool execution, pending approvals and retries. Configure-once options (/theme, /editor, /features, /secondary_model, /reload-tui) are grouped under /settings and kept out of completion; they still work when typed, and /settings gained a Secondary model entry so nothing became unreachable.

Subagents. Agent and AgentSwarm accept any configured [models] entry id for model in addition to primary/secondary, and the tool description lists what the session has configured with resolved capability flags. profile.model accepts the same role keywords, so it fully supersedes model_preference while existing agent files keep working unchanged. coder no longer carries the delegation tools.

Engine. Swarm mode is announced through the context-injection layer rather than pushing and popping reminders, which removes a context mutation from a mode toggle. Provider clients are built with maxRetries: 0. A reasoning-only assistant message is sent with explicit empty content. An idle-session steer degrades to launching a turn and syncs title/lastPrompt, matching v1 and closing a divergence the parity suite had pinned as intentional. Completion reviews report every gap they find rather than collapsing more than eight into a generic failure, and tail-mode Bash output compacts on a slack threshold instead of on every chunk, which was quadratic.

Tests. Prefix stability is now pinned across the steps of a tool-calling turn, consecutive turns, and a swarm-mode toggle, with an opt-in live check that proves a real provider cache hit. The provider catalog tests read an injected cache rather than the developer's real on-disk snapshot, which is why they passed in CI and failed locally.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Added a release changeset with pnpm changeset, or this PR needs no changeset.
  • Updated user-facing documentation, or this PR needs no documentation change.

Accumulated working state: the in-flight TUI work plus an upstream sync
and follow-up fixes found while reviewing it.

TUI
- Draw the welcome cube with background-filled cells. A font paints only
  its glyph box, so in terminals that add line spacing two stacked rows
  of block glyphs showed a seam; filling the cell background closes it.
  All three render paths (header, web ready banner, rainbow easter egg)
  share one painter.
- Add a wink: roughly once a minute a blink lands as a wink instead, one
  eye following the live gaze.
- Make the cube's face the live activity indicator. The header lives in
  the transcript and scrolls away once work starts, so the face now
  drives the activity line and follows what the agent is doing.
- Group configure-once options under /settings and keep them out of
  completion; they still work when typed. /settings gains Secondary model.
- Cap retry status lines so a large provider error body cannot flood the
  activity line.

Subagents
- Route subagents at any configured model, not just the primary and
  secondary roles, advertising the routable set with capability flags.
- profile.model accepts the same role keywords, superseding
  model_preference without breaking existing agent files.
- Drop Agent/AgentSwarm from the coder profile so a subagent cannot spawn
  its own subagents.

Engine
- Announce swarm mode through the context-injection layer instead of
  pushing and popping reminders directly.
- Build provider SDK clients with maxRetries: 0 so cancelling during a
  retry backoff takes effect immediately.
- Send an interrupted reasoning-only assistant message with explicit
  empty content so strict gateways stop rejecting the whole session.
- Degrade an idle-session steer to a turn launch, matching v1.
- Report every gap an independent completion review finds, and collect
  long Bash output in tail mode without quadratic recompaction.
- Hide internal agent profiles from delegatable subagent listings.

Tests and docs
- Pin prompt-cache prefix stability: append-extension across steps, turns
  and a swarm-mode toggle, plus an opt-in live provider cache-hit check.
- Make the provider catalog tests read an injected cache rather than the
  developer's real on-disk snapshot.
- Regenerate the config and state manifests; document model routing and
  the settings grouping in both languages.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 193 files, which is 93 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f7389a3-83e7-4f54-a6f7-524d65fd6c9c

📥 Commits

Reviewing files that changed from the base of the PR and between 9203aa7 and c795acb.

📒 Files selected for processing (193)
  • .agents/skills/agent-core-dev/verify.md
  • .agents/skills/gen-changesets/SKILL.md
  • .agents/skills/sync-changelog/SKILL.md
  • .changeset/README.md
  • .changeset/bright-owls-think.md
  • .changeset/calm-lions-verify.md
  • .changeset/calm-tail-output.md
  • .changeset/fresh-models-cursor.md
  • .changeset/goal-gaps-and-tail-perf.md
  • .changeset/grok-night-pop.md
  • .changeset/internal-verifier-profile-hidden.md
  • .changeset/logo-seam-fix.md
  • .changeset/logo-wink.md
  • .changeset/prompt-cache-invariant.md
  • .changeset/quiet-accent-pulse.md
  • .changeset/quiet-logos-shimmer.md
  • .changeset/quiet-title-spin.md
  • .changeset/reactive-activity-face.md
  • .changeset/steady-gates-title.md
  • .changeset/streamline-settings-commands.md
  • .changeset/subagent-model-routing.md
  • .changeset/swarm-mode-injection.md
  • .changeset/tui-surface-panels.md
  • .changeset/upstream-sync-batch.md
  • AGENTS.md
  • apps/kimi-code/src/cli/commands.ts
  • apps/kimi-code/src/cli/options.ts
  • apps/kimi-code/src/cli/prompt-session.ts
  • apps/kimi-code/src/cli/run-prompt.ts
  • apps/kimi-code/src/cli/sub/provider.ts
  • apps/kimi-code/src/cli/sub/web/run.ts
  • apps/kimi-code/src/cli/v2/run-v2-print.ts
  • apps/kimi-code/src/main.ts
  • apps/kimi-code/src/tui/commands/config.ts
  • apps/kimi-code/src/tui/commands/registry.ts
  • apps/kimi-code/src/tui/commands/types.ts
  • apps/kimi-code/src/tui/commands/undo.ts
  • apps/kimi-code/src/tui/components/chrome/footer.ts
  • apps/kimi-code/src/tui/components/chrome/moon-loader.ts
  • apps/kimi-code/src/tui/components/chrome/toast.ts
  • apps/kimi-code/src/tui/components/chrome/waiting-cue.ts
  • apps/kimi-code/src/tui/components/chrome/welcome.ts
  • apps/kimi-code/src/tui/components/dialogs/question-dialog.ts
  • apps/kimi-code/src/tui/components/dialogs/settings-selector.ts
  • apps/kimi-code/src/tui/components/editor/custom-editor.ts
  • apps/kimi-code/src/tui/components/messages/agent-group.ts
  • apps/kimi-code/src/tui/components/messages/agent-swarm-progress.ts
  • apps/kimi-code/src/tui/components/messages/background-agent-status.ts
  • apps/kimi-code/src/tui/components/messages/thinking.ts
  • apps/kimi-code/src/tui/components/messages/tool-call.ts
  • apps/kimi-code/src/tui/components/panes/activity-pane.ts
  • apps/kimi-code/src/tui/constant/rendering.ts
  • apps/kimi-code/src/tui/constant/symbols.ts
  • apps/kimi-code/src/tui/constant/terminal.ts
  • apps/kimi-code/src/tui/controllers/auth-flow.ts
  • apps/kimi-code/src/tui/easter-eggs/dance.ts
  • apps/kimi-code/src/tui/kimi-tui.ts
  • apps/kimi-code/src/tui/theme/colors.ts
  • apps/kimi-code/src/tui/theme/theme-schema.json
  • apps/kimi-code/src/tui/types.ts
  • apps/kimi-code/src/tui/utils/accent-pulse.ts
  • apps/kimi-code/src/tui/utils/activity-face.ts
  • apps/kimi-code/src/tui/utils/context-bar.ts
  • apps/kimi-code/src/tui/utils/logo-eyes.ts
  • apps/kimi-code/src/tui/utils/logo-shimmer.ts
  • apps/kimi-code/src/tui/utils/sgr-mouse.ts
  • apps/kimi-code/src/tui/utils/tab-strip.ts
  • apps/kimi-code/src/tui/utils/terminal-focus.ts
  • apps/kimi-code/src/tui/utils/title-spinner.ts
  • apps/kimi-code/src/tui/utils/tool-panel-bg.ts
  • apps/kimi-code/src/tui/utils/turn-status.ts
  • apps/kimi-code/src/utils/terminal-restore.ts
  • apps/kimi-code/test/cli/main.test.ts
  • apps/kimi-code/test/cli/options.test.ts
  • apps/kimi-code/test/cli/provider.test.ts
  • apps/kimi-code/test/cli/run-prompt.test.ts
  • apps/kimi-code/test/cli/run-shell.test.ts
  • apps/kimi-code/test/cli/v2-run-print.test.ts
  • apps/kimi-code/test/cli/web/web.test.ts
  • apps/kimi-code/test/tui/activity-pane.test.ts
  • apps/kimi-code/test/tui/commands/registry.test.ts
  • apps/kimi-code/test/tui/commands/secondary-model.test.ts
  • apps/kimi-code/test/tui/components/chrome/toast.test.ts
  • apps/kimi-code/test/tui/components/chrome/waiting-cue.test.ts
  • apps/kimi-code/test/tui/components/chrome/welcome.test.ts
  • apps/kimi-code/test/tui/components/dialogs/question-dialog.test.ts
  • apps/kimi-code/test/tui/components/editor/custom-editor.test.ts
  • apps/kimi-code/test/tui/components/editor/side-borders.test.ts
  • apps/kimi-code/test/tui/components/messages/thinking.test.ts
  • apps/kimi-code/test/tui/components/messages/tool-call.test.ts
  • apps/kimi-code/test/tui/components/messages/user-message.test.ts
  • apps/kimi-code/test/tui/components/panels/footer-context.test.ts
  • apps/kimi-code/test/tui/components/panes/activity-pane.test.ts
  • apps/kimi-code/test/tui/controllers/auth-flow.test.ts
  • apps/kimi-code/test/tui/kimi-tui-message-flow.test.ts
  • apps/kimi-code/test/tui/kimi-tui-startup.test.ts
  • apps/kimi-code/test/tui/message-replay.test.ts
  • apps/kimi-code/test/tui/signal-handlers.test.ts
  • apps/kimi-code/test/tui/terminal-theme.test.ts
  • apps/kimi-code/test/tui/utils/activity-face.test.ts
  • apps/kimi-code/test/tui/utils/context-bar.test.ts
  • apps/kimi-code/test/tui/utils/logo-shimmer.test.ts
  • apps/kimi-code/test/tui/utils/retry-status.test.ts
  • apps/kimi-code/test/tui/utils/sgr-mouse.test.ts
  • apps/kimi-code/test/tui/utils/title-spinner.test.ts
  • apps/kimi-code/test/tui/utils/tool-panel-bg.test.ts
  • apps/kimi-code/test/tui/utils/turn-status.test.ts
  • docs/en/configuration/config-files.md
  • docs/en/configuration/env-vars.md
  • docs/en/configuration/overrides.md
  • docs/en/customization/agents.md
  • docs/en/customization/themes.md
  • docs/en/reference/kimi-command.md
  • docs/en/reference/slash-commands.md
  • docs/en/reference/tools.md
  • docs/en/release-notes/changelog.md
  • docs/zh/configuration/config-files.md
  • docs/zh/configuration/env-vars.md
  • docs/zh/configuration/overrides.md
  • docs/zh/customization/agents.md
  • docs/zh/customization/themes.md
  • docs/zh/reference/kimi-command.md
  • docs/zh/reference/slash-commands.md
  • docs/zh/reference/tools.md
  • docs/zh/release-notes/changelog.md
  • packages/agent-core-v2/docs/config-manifest.toml
  • packages/agent-core-v2/docs/state-manifest.d.ts
  • packages/agent-core-v2/scripts/check-domain-layers.mjs
  • packages/agent-core-v2/src/agent/contextMemory/contextOps.ts
  • packages/agent-core-v2/src/agent/goal/completionGate.ts
  • packages/agent-core-v2/src/agent/goal/completionReview.ts
  • packages/agent-core-v2/src/agent/loop/loop.ts
  • packages/agent-core-v2/src/agent/loop/loopContinuation.ts
  • packages/agent-core-v2/src/agent/loop/loopContinuationService.ts
  • packages/agent-core-v2/src/agent/loop/loopService.ts
  • packages/agent-core-v2/src/agent/loop/stepRequestQueue.ts
  • packages/agent-core-v2/src/agent/profile/profile.ts
  • packages/agent-core-v2/src/agent/profile/profileService.ts
  • packages/agent-core-v2/src/agent/rpc/rpcService.ts
  • packages/agent-core-v2/src/agent/swarm/injection/swarmInjection.ts
  • packages/agent-core-v2/src/agent/swarm/swarmService.ts
  • packages/agent-core-v2/src/agent/tools/agent-swarm/agent-swarm.ts
  • packages/agent-core-v2/src/agent/tools/agent-swarm/agentSwarmTool.ts
  • packages/agent-core-v2/src/agent/tools/agent/agent.ts
  • packages/agent-core-v2/src/agent/tools/agent/agentTool.ts
  • packages/agent-core-v2/src/agent/tools/goal/update-goal/updateGoalTool.ts
  • packages/agent-core-v2/src/agent/tools/os/bash/bash.md
  • packages/agent-core-v2/src/agent/tools/os/bash/bashTool.ts
  • packages/agent-core-v2/src/app/agentProfileCatalog/agentProfileCatalog.ts
  • packages/agent-core-v2/src/app/agentProfileCatalog/profile-shared.ts
  • packages/agent-core-v2/src/app/kosongConfig/configSection.ts
  • packages/agent-core-v2/src/app/kosongConfig/secondaryModelOverlay.ts
  • packages/agent-core-v2/src/app/skillCatalog/builtin/custom-theme.md
  • packages/agent-core-v2/src/index.ts
  • packages/agent-core-v2/src/kosong/provider/bases/anthropic/anthropic.ts
  • packages/agent-core-v2/src/kosong/provider/bases/openai/openai-legacy.ts
  • packages/agent-core-v2/src/kosong/provider/bases/openai/openai-responses.ts
  • packages/agent-core-v2/src/session/agentLifecycle/profile/profiles.ts
  • packages/agent-core-v2/src/session/goalCompletionGate/configSection.ts
  • packages/agent-core-v2/src/session/goalCompletionGate/goalCompletionGateService.ts
  • packages/agent-core-v2/src/session/goalCompletionGate/runGates.ts
  • packages/agent-core-v2/src/session/goalCompletionReview/goalCompletionReviewService.ts
  • packages/agent-core-v2/src/session/goalCompletionReview/profile.ts
  • packages/agent-core-v2/src/session/goalCompletionReview/verifier.md
  • packages/agent-core-v2/src/session/subagent/configSection.ts
  • packages/agent-core-v2/src/session/subagent/runAgentTurn.ts
  • packages/agent-core-v2/src/session/swarm/sessionSwarmService.ts
  • packages/agent-core-v2/src/tool/result-builder.ts
  • packages/agent-core-v2/test/agent/fullCompaction/fullCompaction.test.ts
  • packages/agent-core-v2/test/agent/goal/goal.test.ts
  • packages/agent-core-v2/test/agent/goal/injection/goalInjection.test.ts
  • packages/agent-core-v2/test/agent/goal/stubs.ts
  • packages/agent-core-v2/test/agent/goal/tools/goal-tools.test.ts
  • packages/agent-core-v2/test/agent/loop/loop.test.ts
  • packages/agent-core-v2/test/agent/loop/prefix-stability.test.ts
  • packages/agent-core-v2/test/agent/plan/plan.test.ts
  • packages/agent-core-v2/test/agent/swarm/swarm.test.ts
  • packages/agent-core-v2/test/app/config/config.test.ts
  • packages/agent-core-v2/test/kosong/provider/composition.test.ts
  • packages/agent-core-v2/test/kosong/provider/live-prompt-cache.e2e.ts
  • packages/agent-core-v2/test/os/backends/node-local/tools/bash.test.ts
  • packages/agent-core-v2/test/session/goalCompletionGate/goalCompletionGate.test.ts
  • packages/agent-core-v2/test/session/goalCompletionReview/goalCompletionReview.test.ts
  • packages/agent-core-v2/test/tool/result-builder.test.ts
  • packages/agent-core-v2/test/tool/tool.test.ts
  • packages/agent-core/src/skill/builtin/custom-theme.md
  • packages/node-sdk/src/catalog.ts
  • packages/node-sdk/src/index.ts
  • packages/node-sdk/src/sdk-rpc-client-v2.ts
  • packages/node-sdk/test/v1-v2-parity.test.ts
  • packages/oauth/src/xai.ts
  • packages/oauth/test/xai.test.ts
  • packages/pi-tui/src/components/editor.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@YaseenHQ
YaseenHQ merged commit 29e0da0 into main Aug 13, 2026
15 checks passed
@YaseenHQ
YaseenHQ deleted the feat/tui-and-upstream-sync branch August 13, 2026 18:10
@github-actions github-actions Bot mentioned this pull request Aug 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant