Skip to content

Claude: show forked skills and stream their progress - #2

Draft
cmdr-chara wants to merge 6 commits into
mainfrom
codex/claude-fork-visibility
Draft

cmdr-chara wants to merge 6 commits into
mainfrom
codex/claude-fork-visibility

Conversation

@cmdr-chara

@cmdr-chara cmdr-chara commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Integrate @alexandre-vl's existing code stack from upstream #1041, #1042, #1043 and #1044. Original implementation commits and authorship are preserved, ending at code commit e535bd26e5259ab7bd1d30a17599eecbf032551c. The final media-only commit is excluded. This is an integration PR, not a claim of an independently written implementation.
  • Count only the current chat's actual subagent spawns. Forward foreground-subagent text/reasoning and give typed forked skills a running chip, a tab, and correct completion/interrupt handling.
  • Populate a typed fork's tab from its own transcript while the CLI withholds replay. Deduplicate disk records against replay by UUID and fall back to the CLI replay when no file is available.
  • Bring the prerequisite changes together, rather than proposing the last patch without its dependencies. Include unit, captured-protocol, fake-CLI and engine regression coverage, plus the claude_subagents CI selection.
  • This is a focused agent-visibility improvement. It does not implement every background-task feature, encryption, direct SSH hosts, or a complete IDE.

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.

Before After
A running typed fork has a chip/tab, but its tab holds only the prompt until the CLI replays the transcript at completion. The tab fills with the fork's text, reasoning and tool steps while the fork is still running.

Original before/after comparison: the same fork 35 seconds into its run, with the intermediate implementation on the left and live transcript updates on the right

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

  • The final reply in the parent chat is a separate upstream fix, Claude: show replies to local slash commands zeronsh/zeron#787, and is not included here.
  • Transcript-file discovery relies on the observed Claude Code layout and UUID behavior. Missing files use replay fallback. A replay that no longer matches recorded UUIDs disables subsequent live tailing.
  • The follow-up fixes on this fork make transcript parsing linear, move filesystem discovery/reads onto a blocking worker, and interleave backlog records with stdout and controls. A blocked-reader cancellation regression passes. Real network-mounted storage and installed-app runtime behavior remain unverified; the reader regressions have passed on Linux and Windows.
  • Steering during a typed fork is queued behind that open tool. Explicit "Send now" retains the interruption path.

Test plan

  • Inspect the upstream implementation diff, stack dependencies and regression coverage.
  • Preserve the source commits and explicitly attribute the existing implementation and visual evidence.
  • Independently run cargo test --locked -p zeron-doc --lib (151 passed on cffda035).
  • Independently run the harness library and Claude, Codex and ACP protocol suites on the exact head through cloud nextest: core job passed 460 harness library tests (2 reported leaky), 39 Claude, 45 Codex and 78 ACP tests; ignored tests remained skipped.
  • Independently run the engine library and named integration suites on exact head cffda035 in the serial cloud run: 628 engine and 53 integration tests passed; 8 were ignored.
  • Run this fork's CI on this PR's exact standalone final head.
  • Verify the combined integration with PRs Sessions: keep background sends aligned with their running agents #1 and Remote chats: distinguish synchronization from outages #3: cloud run on 422b9316 passed 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.
  • Capture the fork's actual main/head UI, including stop, queued steering, replay deduplication and the missing-file fallback.
  • Verify the blocked-reader cancellation and large-backlog regressions on Linux and Windows: Linux core, Windows harness.
  • Verify behavior on a real slow or network-mounted filesystem and remaining platform compatibility.

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 final cffda035 head, 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 final cffda035 changes 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 exact cffda035 source 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.

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>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copy link
Copy Markdown
Owner Author

Final integration check

  • Verified open, draft, authored by cmdr-chara, targeting cmdr-chara/zeron:main at 962a3207c31f0f955ac74d37510133f82289e0e4.
  • Verified head e535bd26e5259ab7bd1d30a17599eecbf032551c, four original implementation commits and 20 changed files. No image files are present in the PR diff.
  • GitHub reports mergeable: true against the current base. This does not establish runtime correctness or compatibility with the other PRs.
  • No pull-request-triggered workflow runs were returned for this head at the time of checking. Independent Rust tests, platform checks and fresh captures remain outstanding.
  • The published comparison isolates the live-tail improvement between upstream Claude subagents: give a typed /skill's fork a chip and a tab zeronsh/zeron#1043 and Claude subagents: fill a typed fork's tab while the CLI holds it zeronsh/zeron#1044. It is not a fresh main-versus-final-head comparison.

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.

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