fix(work-item-pipeline): finalize acts under claim-holder identity (item #137) - #534
fix(work-item-pipeline): finalize acts under claim-holder identity (item #137)#534getappz wants to merge 1 commit into
Conversation
build_finalize_step called item_done/item_release via the engine thread's claims::owner_id(), which never matches the dispatch agent's claim owner (each sdd_loop role ran in its own subprocess). For non-claude-code agents that mismatch made the claim guard refuse with 'refusing to complete someone else's live claim', so every opencode item's finalize failed after a successful sdd_loop. Thread the item's assignee_agent (the claim holder) into the finalize step and wrap its item_done/item_release in with_owner_override, so the guard sees the right identity. None/empty falls back to ambient identity (boot-time dummy definition). Agentflare-Agent: opencode Agentflare-Branch: task/137-finalize-step-fails-to-mark-items-done-f Agentflare-Item: 137
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Included review availability: 0 reviews are currently available. Based on recent review activity, included reviews refill at 1 per hour. 📝 WalkthroughWalkthroughThe work-item pipeline now propagates an optional claim-holder identity through construction and resumable dispatch. Finalization uses that identity for ChangesClaim-holder finalization
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR updates finalization to use the claimed agent identity while preserving the existing claim guard. No actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Superseded by #531, which is already merged to master ( |
|
Superseded by merged #531 |
All fields are plain String/Vec<String>/Option<String> with no Clone-unsafe design intent in history. ToolsManifest (agentflare-apps) had lost its own Clone derive as a result, which Task 4's app_send_hook needs for tools.clone() on Option<ToolsManifest>. Unblocks #532/#533/#534. Agentflare-Agent: claude-code_2-1-245_agent Agentflare-Branch: task/535-fix-derive-clone-on-gateway-registry-ser Agentflare-Item: 535
Fixes item #137 —
finalizestep fails to mark items done for non-claude-code agents.Root cause
build_finalize_steprunsitem_done/item_releasevia the daemon's MCP, so the caller identity is the daemon's fixedclaims::owner_id(). But the item's claim is held by the dispatched agent (e.g.opencode:<instance>).item_done's claim guard refuses a foreign live claim:item {id} is claimed by '{holder}' -- refusing to complete someone else's live claim. Legacy claude-code dispatches matched the daemon identity; opencode-dispatched items never got pastfinalize.Fix
Carry the claim-holder identity (
assignee_agent) intobuild_finalize_step/build_work_item_pipelineas anownerparam and runitem_done/item_releaseinsideclaims::with_owner_override(owner, ...)(viarun_as_claim_holder).Nonefalls through to ambient identity (pre-fix behavior, boot-time dummy definition). The guard stays intact — only the caller identity is made correct.src/work_item_pipeline.rs:run_as_claim_holder,build_finalize_step+owner,build_work_item_pipeline/_with_sender+ownersrc/dashboard/server.rs: passNonefor the boot-time dummy definitionSummary by CodeRabbit