Skip to content

fix(orchestration): fail direct dispatches on agent exit#9001

Open
tianrking wants to merge 1 commit into
stablyai:mainfrom
tianrking:agent/fail-direct-dispatch-exits
Open

fix(orchestration): fail direct dispatches on agent exit#9001
tianrking wants to merge 1 commit into
stablyai:mainfrom
tianrking:agent/fail-direct-dispatch-exits

Conversation

@tianrking

Copy link
Copy Markdown

Summary

  • mark a task as failed when a directly dispatched worker exits and no coordinator run exists
  • preserve the exit reason on the task instead of leaving it indistinguishable from an untouched ready task
  • add a runtime regression test for the direct-dispatch path

Root cause

failDispatch correctly returns a task to ready for coordinator-managed retries. A direct orca orchestration dispatch has no coordinator loop to consume that retry, so an agent exit could leave work silently stranded in ready forever.

Impact

Coordinator-managed dispatches retain their existing retry and escalation behavior. Directly dispatched tasks now become visible failures that can be deliberately retried by the operator.

Validation

  • node_modules/.bin/vitest.cmd run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts --testNamePattern 'marks a direct dispatch failed'
  • node_modules/.bin/oxfmt.cmd --check src/main/runtime/orca-runtime.ts src/main/runtime/orca-runtime.test.ts
  • node_modules/.bin/oxlint.cmd src/main/runtime/orca-runtime.ts src/main/runtime/orca-runtime.test.ts

The full runtime test file passed 710 tests; 4 unrelated tests assume a POSIX /tmp path and fail on this Windows host before exercising this change.

Fixes #8984

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]: A failed dispatch never propagates to the task — dead agents leave tasks 'ready' forever and work is silently dropped

2 participants