Skip to content

fix: register a spawned child once it takes its launched brief - #1

Merged
HyunjunJeon merged 3 commits into
mainfrom
fix/spawn-letter-window
Nov 12, 2026
Merged

HyunjunJeon merged 3 commits into
mainfrom
fix/spawn-letter-window

Conversation

@HyunjunJeon

@HyunjunJeon HyunjunJeon commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

A spawned worker's first letters to its parent were refused participant_unavailable for about 30 s.
When the brief rides the agent's start (claude-code, codex, grok, omp, antigravity), the spawn waited for input readiness
before registering the child; an agent working on that brief reads as launching until its turn ends, so the spawn
waited out BRIEF_READY_WAIT (30 s) with the child unregistered.
Now the spawn waits only until the agent is seen taking its brief (ready, or working), restarts the brief's record
clock there and registers the child at once. A child its spawn has not bound yet (the short wait for its session)
is refused a new, transient participant_registering: wait a few seconds and run the same command again.

Review

  • Decide: the code name participant_registering; request send parent, agent show here and ask-human
    all answer it, since all three ask coordination::here. hide guide names it beside no_parent.
  • Decide: working during a launch counts as the brief taken. Checked against Claude Code's screen rules only
    (working reads from its turn spinner, never before the prompt is submitted); codex, grok, omp and antigravity unchecked.
  • Decide: a spawn that stops for good with its agent still running (brief_not_submitted, an identity wait)
    keeps that pane answering participant_registering until the spawn binds it or the pane closes.
  • Risky files: hide-core/src/coordination/executor.rs - spawn order: the launched-brief wait ends at
    working, then identity wait, BindChild, Complete as before; typed briefs keep ladder::ready.
  • Risky files: hide-core/src/delivery/ladder.rs - one wait loop (until), two predicates: ready
    (unchanged, also worktree_control) and took_launch; same 250 ms poll and deadline.
  • Risky files: hide-core/src/coordination/mod.rs - registering matches an unbound spawn by agent name,
    placed pane and child machine (spawn_machine), a device pane alike; no letter is held, nothing waits.
  • Risky files: hided/src/cli_contract.rs, contracts/hide-cli.json, hided/src/server.rs - the reason in
    four specs and its next action.
  • Cost: none on a hot path; registering runs only where a caller is refused, one scan of the spawns.
  • Questions: Runtime::spawn_pane_id reads a spawn with no machine as the core's node, while the spawn
    places it on its caller's machine (spawn_machine); left as is here. Worth a follow-up?
  • Questions: follow-up: registering could also guard a reused pane by spawn.terminal, as
    spawn_observation does; here() sees only the ledger and the caller, and ask-human runs inside the ledger
    apply, so that needs the caller's terminal passed in.

Tests

  • Layer: runtime tests on the fake engine (launched_brief.rs, on the local harness in beside_spawn.rs)
    and through prepare_delivery; a unit test of coordination::here (local, device, reused pane id).
  • Catches: a spawn that reads on while the engine says launching, or keeps the start's clock; a child its
    spawn has not bound answered participant_unavailable. Planted: with executor.rs, ladder.rs and
    coordination/mod.rs at origin/main both runtime tests fail, the spawn logging
    brief.launch_ready_unseen Late("readiness Launching, status working after 30s"), the operator's log line.
  • Repeat: the three new tests, 10 local runs each, all passed. They are --lib tests, which the repeat lane
    does not select (it repeats tests/it modules and e2e specs).
  • Waits: none new; the spawn test orders the fake engine's readings (idle, then working, never ready).

Evidence

  • Verified: a real Claude Code 2.1.322 child on an isolated candidate of this branch (the agent journey's local
    isolation, --parent here, launched brief): its first call, hide request send parent --kind progress,
    answered ok; the spawn answered on its first attempt and the start step took 9.1 s; the candidate's core
    log has brief.launched and no brief.launch_ready_unseen.
  • Verified: that run patched the journey in memory only: the brief prefixed with the letter instruction, the
    start step alone, and one Bash(hide request send:*) allow rule in the run's private Claude Code settings.
  • Verified: this PR's verify on 45d3527 passed: rust workspace (nextest), windows check, web e2e linux
    1-6/6 (the family fixture in engine-fixture.ts included), windows e2e, agent journey stand-ins, policy checks.
  • Verified: local bash scripts/verify-cargo.sh lint passes; local test --no-fail-fast on 93f90a6:
    8473 passed, 2 failed, both named below.
  • Not verified: runtime::tests::missions::a_live_binding_during_registration_save_keeps_the_newly_ended_registration_and_spawn
    fails under the full local cargo test (a 5 s recv_timeout); one full hide-core run with these three files at
    origin/main and the new tests skipped failed it in 3 of 3 runs; alone it passes 5/5. check is red locally.
  • Not verified: runtime::tests::home_retire::an_unreadable_marker_keeps_the_project_and_asks_only_once
    failed in 3 of 7 full local runs (label Home for hide): its barrier home_retiring is set at the request
    (home_retire.rs:60), before the worker applies the refusal; alone 3/3, on no path this diff touches.
  • Not verified: hide-holder's a_flooded_holder_keeps_within_its_budget_once_it_gave_freed_pages_back
    failed once and passed once (6.28 MiB against 6 MiB); hide-holder is untouched here.
  • Not verified: a child on a connected device live (the here unit test covers its address);
    bash scripts/verify-web.sh was not run locally; web/e2e/engine-fixture.ts is unchanged, since its
    panel-started parent has no spawn record and still answers participant_unavailable (CI's web e2e passed).
Verification record
  • Base 0852106a9, head 45d352704 (65eb1adc4 fix, 93f90a635 contract export, 45d352704 guide line).
  • Without the fix: both runtime tests fail (30.8 s, launch_ready_unseen; participant_unavailable).
  • Policy: check-no-attribution.py, check-no-workstation-identity.sh, check-harness-ignore-anchor.sh,
    check-timed-waits.py, check-capability-readers-off-lock.sh pass.
  • python3 scripts/merge-order.py --branch fix/spawn-letter-window: Stay as you are.

A spawn whose brief rode the agent's start waited for the engine to read
the agent ready for input before it registered the child. An agent that
took its launched prompt works on it at once and reads as launching until
that turn ends, so the spawn waited out the whole 30 s, and every letter
the child sent to its parent meanwhile was refused participant_unavailable.

The spawn now waits only until the agent is seen taking its brief: ready
for input, or working (ladder::took_launch). The brief's record clock
still restarts there, and the child is registered right after.

A child the spawn has not bound yet (its session still to show) is now
refused participant_registering, whose next action says to wait a few
seconds and run the same command again, for request send parent, agent
show here and ask-human alike, on this machine and on a device.
@HyunjunJeon
HyunjunJeon merged commit 158330b into main Nov 12, 2026
68 checks passed
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.

1 participant