Skip to content

test: wait for the PTY job's foreground handoff - #137

Merged
SSFSKIM merged 1 commit into
masterfrom
worktree-agent-a14f8687ec438329e
Oct 24, 2026
Merged

SSFSKIM merged 1 commit into
masterfrom
worktree-agent-a14f8687ec438329e

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Root cause: test readiness, not a product refusal bug

The fixture looked for any child whose process group equalled the shell's terminal foreground group. Immediately after fork, a child can still inherit zsh's group, so that check could succeed before zsh completed job-control setup. The next ps read then saw the child's new group, and product preflight correctly rejected the changed target. The real product identifies an already-registered CLI PID; it does not select a just-forked child this way.

Reproduced before the fix on the Linux pool in run 40117930898, unit 4/4, using temporary snapshot instrumentation and 40 repetitions of the same six cases: 2 failures / 240 cases, both with the original preflight-refusal signature. One captured transition was:

Read Child PID Child PGID Terminal foreground group
Fixture declares ready 5046 5042 (zsh's group) 5042
Product preflight 5046 5046 5046

The other failure captured the same transition for child 7455 and shell group 7452. The original six-case diagnostic pool run 40117616979 passed, illustrating the intermittency. All temporary diagnostic/repetition changes are absent from this PR.

Fix

  • Wait until the sleep stand-in leads its own process group (pgid === pid) and the terminal reports that group in the foreground.
  • Also require resume_failed, so an early preflight refusal cannot satisfy the rollback test.
  • Leave production foreground-safety checks, timeout budgets, foreground/stopped-state assertions, and the unfinished-line marker assertion unchanged.

Addresses tech-debt row 319 in docs/tech-debt-tracker.md (tracker intentionally unchanged).

Verification

  • Local baseline: 20 single-file runs through /tmp/maws-review/with-slot.sh, 120/120 cases passed. The Linux race did not reproduce on the Mac; observed load was about 6, not the much higher load seen earlier today.
  • Corrected single-file Mac run: 6/6 passed through the slot; the independent reviewer also ran this file successfully.
  • Independent doperpowers:reviewer-medium review of 9a564bc43..d541e16ee: no material findings; correct. No fix wave or further round was needed.
  • Post-fix 40× stress sampling: 40118350058, unit 4/4, 240/240 cases passed; all four unit shards green on attempt 1. This temporary carrier adds only repetition to the reviewed fix; it is not the PR head.
  • Initial pool static,unit,probes: 40118042019, static/probes and unit 1/4, 2/4, 4/4 green on attempt 1. Unit 3/4 hit the tracked unrelated test/org-directory.test.ts:435 call-count assertion (4 versus 2); its one unchanged-shard rerun failed identically on attempt 2. This is not a preemption or a PTY failure. The unchanged stress tree's shard 3/4 passed in 40118350058.
  • Full pool static,unit,probes on this exact head: 40118644709, all requested gates and all four unit shards green on attempt 1.

Five fresh --gates unit --class1a pool invocations tested the same head. Each invocation makes a new nonce carrier; all seven normal-run carriers were checked to have this PR head as their parent.

Unit stability run Attempt All four shards
40118424467 1 Green
40118680004 1 Green
40118956445 1 Green
40119229441 1 Green
40119486891 1 Green

Seven consecutive green shard-4 executions on d541e16ee, each log explicitly showing all six PTY cases passing: the five unit runs above, the fully green full gate, and shard 4 of the initial full gate whose unrelated shard 3 stayed red. The attempt-2 copy of the original shard 4 is not counted as another execution, and the 240-case stress carrier is not counted toward this same-head streak. No preempted executions were counted.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM
SSFSKIM marked this pull request as ready for review October 24, 2026 18:15
@SSFSKIM
SSFSKIM merged commit a718cec into master Oct 24, 2026
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