Skip to content

feat(agent-manager): show CLI activity in terminal tabs and worktrees - #13645

Merged
marius-kilocode merged 3 commits into
mainfrom
sync-cli-spinner-state
Sep 1, 2026
Merged

feat(agent-manager): show CLI activity in terminal tabs and worktrees#13645
marius-kilocode merged 3 commits into
mainfrom
sync-cli-spinner-state

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Agent Manager can show Run-script progress, but an interactive Kilo CLI inside an embedded terminal can be working or waiting for input while its terminal tab and worktree still look idle.

Why This Change Was Made

Use a small, opt-in OSC status message over the existing PTY stream rather than parse screen text or depend on terminal titles. Agent Manager enables the signal for its terminals. The CLI reports idle, busy, retry, waiting, error, and done from session state and turn outcomes.

Signals refresh every five seconds and expire after fifteen seconds. Old replay output cannot leave a permanent spinner. Disconnect, disposal, and normal CLI exit clear the activity. Worktree indicators combine terminal activity with existing session and Run activity, so an idle tab cannot clear another terminal's busy state. Run/Setup status and deletion guards remain separate.

User Impact

  • See CLI activity in main terminal tabs, side terminals, and worktree indicators, including when the terminal is hidden.
  • See pending questions/permissions and errors without opening each terminal.
  • Keep terminal title preferences unchanged.

Both the extension and the interactive CLI must include this change, and existing terminal processes must be restarted to receive the opt-in environment. A system-installed kilo on PATH is not updated by rebuilding the extension. kilo run and --mini are unchanged. Historical sessions without an observed completed turn remain idle rather than claiming success.

Evidence

  • Extension build, lint, typecheck, Knip, annotation and marker guards passed.
  • 128 focused extension tests and 17 focused CLI tests passed after consolidating the test scaffolding. Lint, typechecks, and the duplication guard passed. The smaller diff keeps six-state transitions, opt-in, heartbeat/disposal, signal validation/expiry, and multiple-terminal/project isolation coverage; runtime code is unchanged by this reduction.
  • Isolated VS Code with the rebuilt CLI and a deterministic local provider: all six states appeared in terminal and worktree indicators with terminal-title updates disabled. Verified retry/error recovery, question submission, hidden-tab heartbeat, side-terminal aggregation, stale-signal expiry, and normal CLI exit. The test instance was cleaned up.
  • The UI test explicitly launched the rebuilt CLI inside the terminal; it did not use the older CLI on the system PATH.

Supplied screenshot, cropped to show the matching needs-input indicators without publishing model details:

Matching needs-input indicators in the Agent Manager header and CLI terminal tab

Isolated self-test with a pending CLI question:

CLI question with needs-input indicators on the terminal tab and worktree

@kilo-code-bot

kilo-code-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-activity.test.ts
  • packages/opencode/test/kilocode/terminal-activity.test.ts
Previous Review Summary (commit 4e0d3d1)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 4e0d3d1)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (17 files)
  • .changeset/terminal-cli-activity.md
  • packages/kilo-vscode/src/agent-manager/terminal-manager.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-activity.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-routing.test.ts
  • packages/kilo-vscode/tests/unit/project-session-busy.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/project/session-busy.ts
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SideTerminalPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SortableTerminalTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/TerminalTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/activity.ts
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/render.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts
  • packages/opencode/src/kilocode/cli/cmd/tui/app.tsx
  • packages/opencode/src/kilocode/cli/cmd/tui/terminal-activity.ts
  • packages/opencode/src/kilocode/cli/cmd/tui/terminal-title.ts
  • packages/opencode/test/kilocode/terminal-activity.test.ts

Reviewed by grok-4.6 · Input: 117.9K · Output: 12.9K · Cached: 312.6K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 4cf7814 into main Sep 1, 2026
33 checks passed
@marius-kilocode
marius-kilocode deleted the sync-cli-spinner-state branch September 1, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants