Skip to content

fix(orchestrator): bounded dispatch wait — advance_project never holds the MCP call for a whole worker run - #36

Open
keeganmccallum wants to merge 1 commit into
Intelligent-Internet:mainfrom
keeganmccallum:fix/bounded-dispatch-wait
Open

fix(orchestrator): bounded dispatch wait — advance_project never holds the MCP call for a whole worker run#36
keeganmccallum wants to merge 1 commit into
Intelligent-Internet:mainfrom
keeganmccallum:fix/bounded-dispatch-wait

Conversation

@keeganmccallum

Copy link
Copy Markdown

The ACP dispatcher blocks on the worker's entire session, so advance_project held the orchestrator's MCP request for the full worker run (hours). MCP clients abort held requests (Prime Agent: Request was aborted; the abort killed the caller's kernel cell), making a healthy dispatch look like 'nothing is running'.

Fix

  • StepResult.in_progress: advance_project returns promptly when workers are in flight; the next call reconciles their handoff files (workers write them directly to the store — no state is lost by returning early).
  • .dispatched markers distinguish in-flight attempts from lost ones; the legacy 'running but no attempt file' crash-recovery path now only fires on missing or stale markers (attempt_stale_s, default 6h).
  • dispatch_wait_s (default 50s, ZENITH_DISPATCH_WAIT_S) bounds the wait — safely under MCP client timeouts.

Tests

tests/test_bounded_dispatch.py (4): prompt return under a slow worker, in_progress reconcile without fake failures, late-handoff application + marker cleanup, lost-attempt and stale-marker paths. Full suite: 217 passed, 7 skipped.

…s the MCP call for a whole worker run

The ACP dispatcher blocks on the worker's entire session, so advance_project
held the orchestrator's MCP request for hours. MCP clients abort held requests
(Prime Agent: 'Request was aborted' — the abort killed the caller's kernel
cell), making a healthy dispatch look like 'nothing is running'.

Fix:
- StepResult.in_progress: advance returns promptly when workers are in flight;
  the next call reconciles their handoff files (workers write them directly).
- .dispatched markers distinguish in-flight attempts from lost ones; the
  legacy 'running but no attempt file' crash-recovery only fires on missing
  or stale markers (attempt_stale_s, default 6h).
- dispatch_wait_s (default 50s, ZENITH_DISPATCH_WAIT_S) bounds the wait —
  safely under MCP client timeouts.

Tests: tests/test_bounded_dispatch.py (4) — prompt return under a slow worker,
in_progress reconcile without fake failures, late-handoff application, lost
and stale-marker paths. Full suite 217 passed, 7 skipped.
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.

1 participant