Skip to content

fix(claimant): _send_prompt verifies prompt delivery by read-back (#16992) - #16994

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
felix/claimant-prompt-readback
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
felix/claimant-prompt-readback

Conversation

@developing-today-fleet

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

Copy link
Copy Markdown
Contributor

Closes #16992. Follow-up to #16939 (gap 2 fixed this shape in launch_one.py, PR #16989) — the standing-loop half, from lane 0640-DP's out-of-scope observation.

Problem

claimant._send_prompt — step 4d's prompt send, also injected into the stall-nudge step as its delivery oracle — documents "Returns True iff the prompt is confirmed delivered" but returned True on a 2xx prompt POST alone. The _get_messages reconcile only ran when the POST failed. A 2xx POST over a session whose messages stay empty (exactly #16939's live evidence: record said prompt_ok: true, three server read-backs returned {"data":[]}) counted as delivered, so the standing loop could bind a session, report a successful launch, and leave the task silently unprompted.

Change

  • _send_prompt now verifies every delivery claim by read-back, via a new _prompt_landed tri-state helper over _get_messages (non-empty = landed; proven empty = not landed; unreadable = unknown):
    • POST, then read back: landed → True; unreadable → False (never resend — the worker may be executing; never claim delivery);
    • proven empty → exactly one resend (the pre-existing reconcile-before-resend safety condition: nothing landed, so nothing can double-execute), and the resend is verified by a final read-back.
  • nudges.py's delivery-discipline doc updated from the old contract ("a 2xx POST, or a reconcile…") to the verified one.
  • No change to the failure-path semantics beyond verifying the resend; the binding still stands on an unlanded prompt (caller flags prompt_failed; supervision owns the session).

Tests

test_claimant.py gains TestSendPromptReadBack (7 cases) pinning the verdict and the exact POST count per scenario against a scripted _server_request:

Evidence gathered while iterating (local runs are iterating checks only; the remote run below is the verification of record):

Verification: remote fleet-command run against this branch (id on #16992 when dispatched; verdict read firsthand from the full log before merge).

{
  "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-29T22:00:18Z",
    "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.

…6992)

_send_prompt documented 'confirmed delivered' but returned True on a
2xx prompt POST alone; the read-back reconcile only ran when the POST
failed. That is #16939's live-evidence shape (POST ok, session
read-backs empty) on the standing claimant loop (step 4d) and on the
stall-nudge path, which injects _send_prompt as its delivery oracle.

Now every True is backed by a _get_messages read-back showing the
prompt landed: a proven-empty read-back earns exactly one resend
(nothing landed, so nothing can double-execute) whose delivery is
verified the same way; an unreadable read-back never resends and
never claims delivery. Mirrors PR #16989's verified prompt_ok for
launch_one, at the shared transport. nudges.py's delivery-discipline
doc updated to the verified contract.

Tests: TestSendPromptReadBack (7 cases) pins the verdict and the
exact POST count per scenario; 3 of the 7 fail against the pre-fix
_send_prompt (the 2xx success-path cases). Cross-checked against
PR #16989's 40-test launch_one suite, which passes unchanged against
this claimant.py.
@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: 3625f977-03d7-424b-8816-837a0410f018

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 46315294060 read firsthand: checkout at this PR's exact head (3b527a2), Ran 84 tests OK + Ran 30 tests OK, zero failures. Full verdict on #16992. Ready for Felix's merge call.

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Hermetic gate verdict — Felix lane 0640-DZ: GREEN. Run 46316104364 read firsthand: checkout at 3b527a2, Ran 270 tests OK (babysitter/nudges/poll/mode/prompt-constants suites included). Verification complete; ready for Felix's merge call.

@developing-today-fleet
developing-today-fleet Bot merged commit 8a788ce into main Nov 29, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the felix/claimant-prompt-readback branch November 29, 2026 22:14
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.

claimant: _send_prompt trusts a 2xx POST as delivery (step 4d + nudges) — #16939 unverified-POST shape on the standing loop

0 participants