Skip to content

feat(queue): Muse->opencode push — claim-by-id transfer verb (--from-session), one-call send with notes + worktree, reason-gated platform limitation (#8210) - #8223

Merged
dezren39 merged 3 commits into
mainfrom
queue/8210-muse-send-transfer
Nov 10, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/8210-muse-send-transfer

Conversation

@dezren39

@dezren39 dezren39 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Closes #8210.

Drew's asks: a Muse session can send a task it holds to opencode — automatically claimed, with the Muse agent's notes and the worktree provided — and a verb to claim a specific task, session-to-session, "passed on without needing any stops". Plus: a task may be limited to muse or opencode only with a good recorded reason.

Broker (fleet-queue, turso_queue.rs + client.rs)

  • Claim-by-id transfer: claim --task <id> --from-session <ses> moves a live claim holder→claimer in ONE conditional UPDATE (status stays claimed, attempts untouched, holder worker re-checked in the WHERE). --session-id on the same claim binds the claiming session atomically (progress + lane ledger). The claimed event records transfer: true, from_session, the new session_id, previous_worker/previous_lane_id, and the fix(queue): single-session by default — launch-on-handoff, lane works, inline triage (reverses #8097 Rule 3) #8187 marks. Guards (all checked before any mutation — a refused transfer leaves the original claim untouched): status must be claimed under a live lease; from_session must match a holder session mark (latest claimed event's session, bound progress.session_id, or a holder-checkpointed progress.from_session); a row bound to a third session refuses; wait-parks/terminal rows are not transfer sources.
  • Lane flip direct→opencode: verb_lane's existing-row path could only flip opencode→direct; a claimed task's default direct row can now flip to opencode with --opencode-reason (unbound rows only), reason recorded, lane_assigned event with reassignment: true.
  • Platform limitation (Drew: limited "but better be good reason"): lane ledger gains platform_limit / platform_limit_reason (fresh schema + additive migration). Set only via lane --limit-platform muse|openchamber --limit-reason "<why>" (refused without a reason; --clear-platform-limit removes it). A stored limitation with no reason is invalid — the transfer claim clears it and records platform_limit_cleared_invalid on the claimed event instead of enforcing it. A valid limitation binds transfers: the refusal names the limitation and its reason; unlimited tasks never refuse on platform grounds. The fix(queue): single-session by default — launch-on-handoff, lane works, inline triage (reverses #8097 Rule 3) #8187 oracle test platform_is_a_mark_not_a_lane_input_8187 was narrowed to its actual invariant (verb_lane never reads the tasks.platform mark column) with the reason recorded in the test.

Send tool (pm-stack/opencode-claimant/send_to_opencode.py, new)

One call: verifies the sender holds the claim + live hard-stop labels, resolves/creates the worktree (never the primary), writes the sender's notes into it (SEND_NOTES.md), records the opencode assignment with the sender's --reason (required — no reason, no send), checkpoints the pass (from_session into progress), creates the session IN the worktree via claimant.py's transport, transfers the claim with the new verb, checkpoints launched, and sends launch_one's prompt + a SENDER NOTES section (notes verbatim) via claimant's verified _send_prompt. Any failure before the transfer lands deletes the created session and flips the assignment back to direct — the sender keeps the item. launch_one.build_prompt gains the optional sender_notes section; claimant prompt.md and all four lane runbooks (§1b) document the send + limitation.

Tests

  • fleet-queue: 154 lib + 2 integration, 0 failed (new: transfer_accepts_each_holder_session_mark_8210, transfer_refuses_poach_terminal_parked_expired_and_bound_8210, transfer_update_is_one_atomic_claimed_to_claimed_move_8210, lane_flip_to_opencode_only_unbound_direct_with_reason_8210, platform_limit_rules_8210).
  • claimant suites: 117 tests OK (14 new send tests incl. happy path, rollback, prompt-failure-keeps-binding, muse-limitation refusal, reason-less limitation does not block).

Live acceptance (a real Muse-held task sent end-to-end, event history showing the direct transfer) runs against the deployed broker and is recorded on #8210.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 10, 2026 20:09
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T20:09:28.614776Z
We couldn’t complete this review. Comment @codex review to try again.
322c7cb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 728c59f8-5461-49ec-92ad-c85121e4f572
Commits

Reviewing files that changed from the base of the PR and between 19920ea and 322c7cb.

Files selected for processing: 6

  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
  • pm-stack/opencode-claimant/launch_one.py
  • pm-stack/opencode-claimant/prompt.md
  • pm-stack/opencode-claimant/send_to_opencode.py
  • pm-stack/opencode-claimant/test_send_to_opencode.py
  • 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

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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.

feat(queue): Muse→opencode push — claim-by-id transfer verb (--from-session) + one-call send with notes and worktree

1 participant