test(auto-resume): gate the crash-once claude shim on the create's settled reply - #813
Merged
Merged
Conversation
…he create's settled reply
The claude crash-once shim died within milliseconds of the PTY spawn,
racing the create's post-spawn tail. When the death won, the b8ke ext
r9 dead-PTY guard (commit_session_ref_ownership: 'a dead runtime NEVER
records Live') refused the create's winner commit, and the create
answered the typed lost-ownership error instead of terminal.created —
the crash-once tests consumed the error frame and burned their 30s
frame budget (the origin/main base-gate flake: ~1-in-7 file runs under
parallel load, isolated 0/15, single-threaded 0/12).
RCA receipts (instrumented probe trail): spawn completes in ~35ms,
K6 pre-commit -> ForeignOperation from the dead-PTY arm, the create
replies error{INTERNAL_ERROR lost-session-ownership}, Gate 1 correctly
holds the hub's crash event until the create answers (pending=true ->
requeue), the hub then claims and respawns. The production flow is the
designed outcome; the test was racing its own deliberate crash.
Fix: the shim's first generation now waits on a per-test release
marker (50ms poll) that the tests write AFTER terminal.created — the
crash is structurally post-settle, no timing assumption (the codex
sibling's fixed 1.2s sleep is the cruder wall-clock-margin precedent).
Both crash_once_claude_spec call sites updated. Post-fix: 0/35
parallel file runs (pre-fix ~12% failure rate).
Refs: b8ke ext r9 F2 (dead-PTY commit guard), Gate 1 create-answer
hold (auto_resume.rs).
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.
What
Fixes the second base-gate flake at
origin/main:crates/freshell-ws/tests/auto_resume_e2e.rs>successful_auto_resume_respawn_does_not_drop_its_ticket_unarmedtimed out waiting for aterminal.createdframe (~1-in-7 file runs undercargo test --workspaceparallel load; 0/15 isolated; 0/12 single-threaded; reproduced locally and under the gate).RCA (probe-instrumented, receipts in the investigation)
The claude crash-once shim died within milliseconds of the PTY spawn — racing the create's own post-spawn tail. When the death won:
commit_session_ref_ownership: "a dead runtime NEVER records Live") refused the create's winner commit (ForeignOperation— confirmed by probe, not from the coordinator's state match).error{INTERNAL_ERROR: lost session ownership during spawn}(theErrcommit arm's stale-teardown).pending=true) until the create answered, then the hub claimed and respawned.terminal.created, silently consumed the error frame, and burned its whole 30s frame budget.So the production flow is the designed outcome for "child dies during create settle"; the test was racing its own deliberate crash.
Fix
The shim's first generation now waits on a per-test release marker (50ms poll) that the tests write AFTER
terminal.created— the crash is structurally post-settle, with no timing assumption anywhere (the codex sibling's fixed 1.2s sleep is the cruder wall-clock-margin precedent). Bothcrash_once_claude_speccall sites updated.Evidence
cargo fmt --checkclean; pre-push gate green.