Repository navigation
Claude: show forked skills and stream their progress - #2
Draft
cmdr-chara wants to merge 6 commits into
Draft
cmdr-chara wants to merge 6 commits into
cmdr-chara wants to merge 6 commits into
Conversation
The ● N badge counted every tagged stream the engine opened a sink for, while the lanes card lists only the chat's spawn chips. Claude Code tags a forked skill's traffic with its Skill call's id, the agents a subagent starts with their own Agent call ids, and a skill passed as `/<name>` with `forked-command-<name>`. None of them is a spawn chip of the chat, so the badge could read 3 over an empty card (zeronsh#999). A sink (its own doc, one unit on the badge) now opens only for a spawn chip of the chat (`is_chat_spawn`). Traffic tagged with any other id stays in the journal. A forked skill is the chat's own subagent, though. The Claude adapter sets each Skill call aside until its task starts, which comes ahead of all the fork's traffic, and re-decodes it then as a spawn named after the skill (`Agent: /review`). Its traffic then has a card and a tab to feed. An inline skill starts no task, and its result drops it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code leaves the text and thinking blocks of a foreground subagent (or a forked skill) out of the stream unless asked, so its tab showed tool calls only (zeronsh#1000). Runs now set CLAUDE_CODE_FORWARD_SUBAGENT_TEXT=1, which "enables the same behavior" as `--forward-subagent-text` (https://code.claude.com/docs/en/cli-reference). The variable rather than the flag: a CLI older than 2.1.211 ignores it, but refuses an unknown flag. The CLI then forwards subagents "at every nesting depth" (https://code.claude.com/docs/en/headless). The spawn gate keeps the agents a subagent starts in the journal, instead of badging the chat with docs no card lists (zeronsh#999). The adapter already emitted tagged text blocks. Tagged thinking blocks now become the subagent's reasoning, in block order. A background subagent sends them unasked, so its tab gains its reasoning too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `/skill` typed as the prompt, when the skill runs in a fork (`context: fork`), showed nothing while it ran: no chip, no tab, and the badge and card didn't count it. No tool call starts it. Its `task_started` carries no tool id, and its messages carry `forked-command-<name>` and arrive "together and in order after the forked skill finishes" (https://code.claude.com/docs/en/headless.md#follow-subagent-messages). The spawn gate kept them in the journal. That task start now makes the fork a spawn chip, `Agent: /<name>`, and the skill's prompt opens its tab. The chip's id adds the task to the CLI's, which repeats on every run. Until the turn ends, any `forked-command-*` traffic feeds the chip, and the prompt's echo is dropped once. The fork's notification comes before that replay, so it only records the status. The chip settles just before the turn's Done, or when the driver ends a stopped turn itself. After that the CLI's id stays in the journal again, and a late frame can't reopen the chip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `/skill` typed as the prompt and run in a fork has a chip and a tab, but the tab held only the skill's prompt until the fork was over: the CLI sends the fork's messages "together and in order after the forked skill finishes" (https://code.claude.com/docs/en/headless.md#follow-subagent-messages). The fork has a transcript of its own on disk, though: "`agent_transcript_path` is the subagent's own transcript stored in a nested `subagents/` folder" (https://code.claude.com/docs/en/hooks.md#subagentstop-input). In 2.1.310 that's `<project>/<session>/subagents/agent-<task>.jsonl`, created as the fork starts and appended as it works (live-verified). While a typed fork runs, the driver now reads that file every 250 ms. It's looked for under every project directory, the way Grok's driver looks for a subagent's history, not by encoding the cwd, and the reader is Grok's, moved to `jsonl_tail` for both. The fork's messages (text, thinking, tool calls) and its tool results go to its tab. Its prompt, user text and the CLI's bookkeeping records don't. The replay repeats each record under the uuid it has on disk, so a record already shown is dropped, and the first replayed frame ends the reading: the replay brings the rest. If the file hasn't appeared after 10 s (`CLAUDE_CODE_SKIP_PROMPT_HISTORY`, `--no-session-persistence`, a wrapper's own config dir), the tab fills from the replay, as before. If a replay repeats none of the records read, they showed twice: a warning says so, and the run stops reading typed forks' transcripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
6 of 9 tasks
Owner
Author
Final integration check
Keep this in draft. In particular, review slow-filesystem behavior and the documented parent-reply limitation before treating this as a complete forked-skill solution. Nothing was merged. |
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.
Summary
e535bd26e5259ab7bd1d30a17599eecbf032551c. The final media-only commit is excluded. This is an integration PR, not a claim of an independently written implementation.claude_subagentsCI selection.Before / after
The comparison below is the original contributor's genuine native-app evidence. It was not freshly captured in this sandbox. Its before side is the intermediate zeronsh#1043 implementation and its after side is zeronsh#1044: it isolates the live-transcript improvement. It must not be mistaken for a fresh comparison against this fork's current
main.Original native-app recording
Relative to unmodified main, the included prerequisite changes also make the typed fork itself visible and align the running count with the listed spawns. Fresh full-stack base/head captures remain a verification item.
Limits requiring review
Test plan
cargo test --locked -p zeron-doc --lib(151 passed oncffda035).cffda035in the serial cloud run: 628 engine and 53 integration tests passed; 8 were ignored.422b9316passed 1,731 core tests and 1,972 UI/layout/geometry tests, plus native X11/Wayland browser checks. Both new transcript-reader regressions passed; nextest reported 3 leaky core tests.Upstream zeronsh#1044 reports 151 doc tests, 459 harness library tests and 631 engine library tests passing, plus the named integration suites, mutation checks and live runs. These are upstream-reported results, not tests run in this session.
Independent verification: follow-up fixes are pushed through
cffda0353e615f764730f0395787f98b0b52cc93, preserving the original implementation commits. On this final head, 151 document tests passed. The first fix (fac35fd7) passed all 460 harness unit tests, including partial-UTF8/backlog and blocked-reader cancellation regressions; the full harness library and Claude, Codex and ACP protocol suites subsequently passed under nextest on the finalcffda035head, with two harness tests reported leaky. An earlier local final-head engine run had 627 passes, one terminal flood-test timeout and 5 ignored; the timeout also reproduced in isolation under local resource pressure. Its cause has not been established. A later independent serial cloud run passed 628 engine tests and 53 named integration tests, with 8 ignored. A synthetic 10.24 MB reader benchmark improved from 7.19 s to 22.8 ms; these are helper timings, not installed-app latency. Remaining native builds were stopped after the laptop slowdown report. Actions have since been enabled; combined PR validation has passed in the cloud, including the finalcffda035changes and the new transcript-reader regressions. This PR's exact standalone-head CI is still unverified. The combined Linux run has passed. Windows standalone CI and both reader regressions passed; complete standalone-head validation, fresh visual comparisons and real slow-storage behavior remain open. This PR remains a draft. No merge is requested or performed.Standalone cloud validation now running on
cffda035: Linux, Windows, macOS/iOS. The named-suite run checked out and asserted the exactcffda035source and passed the named doc/harness/engine suites serially. Windows CI and all Linux jobs passed after the Linux browser and UI retries; macOS/iOS CI remains in progress.Linux CI setup: the browser and UI jobs initially failed while downloading Ubuntu packages, before their tests ran. The browser and UI jobs both passed on retry. The identical setup and browser tests passed on PR #1, PR #3 and the combined tree.