Repository navigation
feat(chat): a skill run from a slash command shows its work as it goes - #1290
Merged
Merged
Conversation
/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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: notoolUseId, noparentAgentId).ClaudeTranslator:onForkedCommand/onForkedCommandEndedhooks for aforked-command-<name>run, andforkedLine(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'ssubagents/folder (700 ms), picks the run's own transcript among those made since it started, reads whole new lines only, and onfinish()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 inmain.dart; local sessions only (not SSH).ClaudeCodeKernelstarts/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), newtest/kernel/forked_runs_test.dart(picks the right transcript, partial lines, stops after finish). The twokernel_ui_testfailures exist onmaintoo.🤖 Generated with BaoCode