Repository navigation
fix(claimant): launch_one honors the resume hint + verifies prompt delivery by read-back (#16939 gap 2) - #16989
Conversation
…livery by read-back (#16939 gap 2) launch_one.py performed claimant step 4's create-bind-prompt for one task but ignored the task's resume_session_id entirely and trusted a 2xx prompt POST as delivery. Now: - the resume hint (row top level, then packet — poll's merge) is resolved before any create, mirroring claimant step 4b's verdicts and FDR-0001 fallbacks, judged against the queue's own primary: a present, in-worktree, idle requested session is continued and never deleted by the trigger; missing/wrong-worktree records its fallback and creates fresh; unknown-state/busy launches nothing; - requested_session_id / resume_fallback ride the launch record and the launched checkpoint, so requested == actual is provable from the record (#9178 §1); - prompt_ok is a verified verdict: the send must be confirmed by a server read-back of the session's messages; an empty or unreadable read-back reads prompt_unverified, not prompt_ok. Tests: test_launch_one.py gains the resume + read-back class and fake_server grows the _get_session/_fetch_active_ids/_get_messages seams (default read-back is a landed prompt, so existing cases keep their meaning). 40 tests pass.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Gate verdict — Felix lane 0640-DZ: GREEN. Run 46314166535 read firsthand: checkout at this PR's exact head (0acd440), command |
Second half of #16939 (gap 1 — poll.py dropping the hint — landed in #16957).
Problem
launch_one.pyperformed claimant step 4's create-bind-prompt for one task but:resume_session_identirely — a resume-eligible task got a silently substituted fresh session, with neitherrequested_session_idnor a fallback reason on the record (the silent swap fleet queue: resume-by-session, claim-any-task, and manual-only items #9178 §1 prohibits; live evidence: task 26474);prompt_ok: truewhile three server read-backs of the bound session returned an empty message list.Change
claimant._resume_session_for_task) through claimant's verified reads and the same FDR-0001 fallback vocabulary, judged against the queue's own primary (launch_one's target directory) instead of the standing claimant's code clone: present + in-worktree + idle → continued (no create, no location re-verify, never deleted by the trigger — a bind refusal recordssession_cleanup: resumed_session_kept); gone →missing_sessionfallback + fresh create; wrong worktree →worktree_mismatch+ fresh create; unknown state / unreadable activity / busy → launches nothing (fail closed, like 4b).requested_session_id/resume_fallbackride the launch record, the journal, and thelaunchedcheckpoint progress — requested == actual is checkable from the record alone.prompt_okis now send-OK and a server read-back (claimant._get_messages) showing a non-empty message list. The record separatesprompt_send_okfrom the verified verdict and carriesprompt_readback_messages; a send that reports ok with an empty/unreadable read-back fails asprompt_unverified(binding stands; supervision owns the bound session), distinct from a send failure (prompt_failed).resume_session_id) and a resume would-step.Out of scope (noted on #16939): claimant.py's own step 4d shares the unverified-POST shape for the standing loop's sends.
Tests
test_launch_one.py: 10 new cases (hint continue, packet-carried hint, missing fallback, wrong-worktree fallback without reuse, busy/unknown launch nothing, bind-refusal keeps resumed session, read-back empty/unreadable → unverified, send failure stays prompt_failed);fake_servergrows the_get_session/_fetch_active_ids/_get_messagesseams with a landed-prompt default so existing cases keep their meaning. Full file: 40 tests.Verification: remote fleet-command run against this branch (link on #16939 when finalized); local run used only as an iterating check.
Refs #16939 (gap 2 of 2; the issue stays open for the live requested==actual evidence re-run, which needs the deployed broker path).
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T21:47:51Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "010b47d1c4cecdcd1b7d6ea260b7c9b0a61fb89e" }, "auth_subject": "felix", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.