fix(issue-23-24): the dialog handler sees the ready banner on its own; only this dispatch's started is delivery evidence
Review round 1 (planner-reviewer-claude-01, reviewer-agy-01, planner-reviewer-codex-01): one blocking defect and two P2s, all confirmed. B-1. handle_startup_dialogs took its ready tokens only from the environment, which wait_for_tui_ready fills when it evaluates the adapter facts. Called on its own - as resume_session.sh calls it, with no readiness wait before it - it had no tokens, its early-return branch could never fire, and every resume of every agent idled through the full 20 s timeout (base: 0.03 s). rc was 0 throughout, so nothing failed; the resume tests just took ~30 s each. _mam_load_dialog_facts now also takes MAM_STRONG_READY_TOKENS / MAM_READY_TOKENS from the facts, but only when the caller has not set them, so a caller-set value (wait_for_tui_ready's own, or a test steering readiness) is never clobbered - the concern that made it take a single fact in the first place. S5d pins one-iteration return on a ready first frame for five adapters with no environment; S5e pins that caller tokens survive; R4 gets a wall-clock cap so a timeout-idle can no longer pass as success. The old _MAM_READY_TOKENS_CLAUDE fallback was left defined but unread - removed. R1 / N-2. delegate_wait_started treated any status past `pending` as the agent's acknowledgement. codex reproduced three false positives: `error` and `cancelled` records with no started line, and a `running` record from another dispatch. The status branch is gone; the evidence is a started line carrying this dispatch's token, which the local publisher writes before it syncs the status, so nothing that really started is missed (S7c re-pinned on the line with running/completed/error statuses; S7f/S7g pin the three negatives). N-4, taken with it: the events.log line is parsed as JSON rather than pattern- matched. publish_event nests dispatch_token under `data`, and the old regex only matched because of key order (S7h, real line shape and a reordered one). R2 / N-1. Two tests hardcoded <repo>/.venv/bin/python and failed with FileNotFoundError in every review worktree. sys.executable. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
0dfbb2cc8a
commit
10a678c010
3 files changed
+150
-42
No files matched your search
@@ -15,6 +15,7 @@ gets, and R4 shows the same shipped function is now reached from resume.
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -108,8 +109,14 @@ def test_r4_the_shipped_handler_really_runs_for_a_non_claude_resume(
|
||||
tmp_path = mam_sandbox
|
||||
ws = _create_and_stop(tmp_path, "codex", "test-r4-codex")
|
||||
before = len(json.load(open(mock_herdr)).get("calls", []))
|
||||
t0 = time.monotonic()
|
||||
res = _resume(tmp_path, "codex", "test-r4-codex", ws)
|
||||
elapsed = time.monotonic() - t0
|
||||
assert res.returncode == 0, res.stdout + res.stderr
|
||||
# Review B-1: the handler used to idle its whole 20 s timeout here because
|
||||
# it had no ready tokens on the resume path. rc 0 alone cannot tell early
|
||||
# return from timeout; the clock can.
|
||||
assert elapsed < 12, "resume took %.1fs: the dialog handler idled to its timeout" % elapsed
|
||||
calls = json.load(open(mock_herdr)).get("calls", [])[before:]
|
||||
|
||||
def _has(c, *verbs): # the mock records argv with a leading `--session <name>`
|
||||
|
||||
Reference in new issue
Block a user