Skip to content

feat(chat): a skill run from a slash command shows its work as it goes - #1290

Merged
leookun merged 1 commit into
mainfrom
feat/forked-command-live
Nov 24, 2026
Merged

leookun merged 1 commit into
mainfrom
feat/forked-command-live

Conversation

@leookun

@leookun leookun commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1131 (follow-up to #1141)

#1141 gave a slash-command skill run (/code-review, context: fork) a subagent card, but the CLI sends none of its messages until the run ends, so the card stayed empty for the whole run. The reporter confirmed the subagent's transcript is written live to <projects>/<slug>/<session>/subagents/ (the run's own: no toolUseId, no parentAgentId).

  • ClaudeTranslator: onForkedCommand / onForkedCommandEnded hooks for a forked-command-<name> run, and forkedLine(command, line) that puts a transcript line into its card. Once lines came that way, the CLI's end-of-run batch for that run is dropped instead of being shown twice.
  • ForkedRuns (forked_runs.dart, io/stub): polls the session's subagents/ folder (700 ms), picks the run's own transcript among those made since it started, reads whole new lines only, and on finish() reads what is left then stops. The folder is resolved like the CLI does (AgentPaths, with the login-shell env and the launch env). Set in main.dart; local sessions only (not SSH).
  • ClaudeCodeKernel starts/finishes the watch from the hooks and cancels all on dispose.

Tests: test/kernel_test.dart (lines in the card while running, batch not shown again), new test/kernel/forked_runs_test.dart (picks the right transcript, partial lines, stops after finish). The two kernel_ui_test failures exist on main too.

🤖 Generated with BaoCode

/code-review and other skills with `context: fork`, typed as a slash
command, run in a subagent the CLI says nothing of until it is done: the
card #1141 added stayed empty the whole run, minutes long. The subagent's
transcript is written as it goes, though, in the session's subagents/
folder: it is now read from there (the run's own, made since it started
by no call and no other subagent) and its lines go in the card as they
come. Once done, the same messages the CLI sends at once are not shown
again. This machine's sessions only.

Fixes #1131

Co-Authored-By: BaoCode <noreply@baocode.dev>
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.

[BUG] CLI 本地命令 fork 的子代理(如 /code-review)在界面完全不可见,主对话长时间无任何反馈

2 participants