Skip to content

fix(claimant): launch_one honors the resume hint + verifies prompt delivery by read-back (#16939 gap 2) - #16989

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
felix/16939-launch-one-resume
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
felix/16939-launch-one-resume

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Second half of #16939 (gap 1 — poll.py dropping the hint — landed in #16957).

Problem

launch_one.py performed claimant step 4's create-bind-prompt for one task but:

  • ignored the task's resume_session_id entirely — a resume-eligible task got a silently substituted fresh session, with neither requested_session_id nor 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);
  • trusted a 2xx prompt POST as delivery — its record said prompt_ok: true while three server read-backs of the bound session returned an empty message list.

Change

  • Resume resolution before any create, mirroring claimant step 4b (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 records session_cleanup: resumed_session_kept); gone → missing_session fallback + fresh create; wrong worktree → worktree_mismatch + fresh create; unknown state / unreadable activity / busy → launches nothing (fail closed, like 4b).
  • Record provability: requested_session_id / resume_fallback ride the launch record, the journal, and the launched checkpoint progress — requested == actual is checkable from the record alone.
  • Prompt verification: prompt_ok is now send-OK and a server read-back (claimant._get_messages) showing a non-empty message list. The record separates prompt_send_ok from the verified verdict and carries prompt_readback_messages; a send that reports ok with an empty/unreadable read-back fails as prompt_unverified (binding stands; supervision owns the bound session), distinct from a send failure (prompt_failed).
  • Preflight reports the hint (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_server grows the _get_session/_fetch_active_ids/_get_messages seams 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-bot with what you need.

…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.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 46cbfa25-1c3e-400d-9609-20281560bf22

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Gate verdict — Felix lane 0640-DZ: GREEN. Run 46314166535 read firsthand: checkout at this PR's exact head (0acd440), command cd pm-stack/opencode-claimant && python3 test_launch_one.py, Ran 40 tests — OK. Full verdict + the any-o/DP claim adjudication on #16939 (comment by lane 0640-DZ). Recovered from lane 0640-DP, which ended without a final report. Ready for Felix's merge call.

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.

0 participants