Skip to content

fix(orchestration): abandon/stop low-level dispatches without worker rows - #13250

Closed
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/abandon-low-level-dispatch
Closed

bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/abandon-low-level-dispatch

Conversation

@bbingz

@bbingz bbingz commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Low-level orchestration.dispatch creates a dispatch_contexts row only. worker-abandon / worker-stop required a matching worker_dispatches row (from worker-start) and threw dispatch_not_found for live mail-only dispatch ids — while dispatch-show still returned them and the terminal stayed locked.

  • Fence context-only dispatches in abandonWorkerDispatch and beginWorkerStop
  • Free the assignee terminal / block the task without inventing a process stop
  • Keep supervised worker rows on the existing path

Fixes #13005

Test plan

  • pnpm exec vitest run src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts
  • pnpm exec vitest run src/main/runtime/rpc/methods/orchestration-workers-recovery.test.ts src/main/runtime/rpc/methods/orchestration-worker-release.test.ts

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b1e620fe-219c-458d-9032-1e9f4b2a0d90

📥 Commits

Reviewing files that changed from the base of the PR and between 9ccec55 and d3534ac.

📒 Files selected for processing (1)
  • src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts

📝 Walkthrough

Walkthrough

Added test coverage for abandoning and stopping context-only Dispatch records without a worker_dispatches row. The test verifies the returned dispositions, worker state transitions, failed Dispatch status, blocked Task status, and removal of the active terminal identity mapping.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug and targeted tests but omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add all missing template sections and confirm the required checks, platform review, and security audit results.
Linked Issues check ⚠️ Warning The changes shown add regression tests, but no production changes implement the release path required by issue #13005. Implement the context-only handling in abandonWorkerDispatch and beginWorkerStop, including terminal release and task blocking.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary fix for abandoning and stopping low-level dispatches without worker rows.
Out of Scope Changes check ✅ Passed The added orchestration tests directly cover the context-only dispatch recovery behavior described in issue #13005.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Comment @coderabbitai help to get the list of available commands.

@bbingz

bbingz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Backlog note (cleanup pass): auto-rebase onto current main hit conflicts. Branch left open; needs manual conflict resolution or a fresh PR before it can land. Not abandoned — just conflicted.

…rows

Low-level orchestration.dispatch mints dispatch_contexts only. worker-abandon
and worker-stop required a worker_dispatches row and reported dispatch_not_found
for live ids, wedging the assignee terminal. Fence the context in both verbs.

Fixes stablyai#13005
@bbingz
bbingz force-pushed the fix/abandon-low-level-dispatch branch from 473e09a to d3534ac Compare August 10, 2026 03:39
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@bbingz

bbingz commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Closing: main already implements this.

db/worker-dispatch/worker-dispatch-abandon.ts:27 and worker-dispatch-stop.ts:44 both call releaseContextOnlyDispatch when !worker and return disposition: 'context_only', with coverage in db-task-dispatch-lifecycle-guards.test.ts:217-247. What remains in this PR is a duplicate test written against the older API.

Closing to keep my open-PR queue honest. If this turns out to be wrong I'll reopen — please just say so, or reopen it yourself, within the next 7 days.

@bbingz bbingz closed this Aug 19, 2026
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.

[Bug]: worker-abandon/worker-stop return dispatch_not_found for a live dispatch dispatch-show returns (1.4.175)

3 participants