fix(dispatcher): keep built-in strategies registered across a strategy switch #256

Merged
severus-snape merged 1 commit from fix/dispatcher-retain-builtin-strategies into main 2026-11-04 21:04:44 +00:00
Collaborator

Prerequisite for activating dispatcher.strategy: sequential (PR254) on agents that already ran direct.

Defect (reproduced at ea6805f): Dispatcher.start() recovers only the selected strategy. After switching direct -> sequential, every retained ready/running direct task is blocked with Strategy direct@1 unavailable; restore the matching plugin, then resolve and resume. Switching back strands the sequential tasks the same way.

Fix: the built-in direct and sequential strategies stay registered for recovery/claim, matched by their persisted name and version. New submissions use only the configured strategy. Unknown or removed strategies still block visibly, and replay/reconcile policy is taken from the matching trusted strategy.

Tests: new regression tests in test/dispatcher.test.ts (fails before, passes after). Typecheck and build are green. Full serial suite: 1450/1451; the one failure is an unrelated load-dependent timeout (maintenance-cli-lifecycle, passes in isolation 2/2; a parallel run showed a similar Wasm timeout). Persistent exact-diff review vs ea6805f: passed, 0 blockers. Its P2 concerns dispatcher-sequential.ts outside this diff.

Prerequisite for activating `dispatcher.strategy: sequential` (PR254) on agents that already ran `direct`. **Defect (reproduced at ea6805f):** `Dispatcher.start()` recovers only the selected strategy. After switching `direct` -> `sequential`, every retained `ready`/`running` direct task is blocked with `Strategy direct@1 unavailable; restore the matching plugin, then resolve and resume.` Switching back strands the sequential tasks the same way. **Fix:** the built-in `direct` and `sequential` strategies stay registered for recovery/claim, matched by their persisted name and version. New submissions use only the configured strategy. Unknown or removed strategies still block visibly, and replay/reconcile policy is taken from the matching trusted strategy. **Tests:** new regression tests in `test/dispatcher.test.ts` (fails before, passes after). Typecheck and build are green. Full serial suite: 1450/1451; the one failure is an unrelated load-dependent timeout (`maintenance-cli-lifecycle`, passes in isolation 2/2; a parallel run showed a similar Wasm timeout). Persistent exact-diff review vs ea6805f: passed, 0 blockers. Its P2 concerns `dispatcher-sequential.ts` outside this diff.
Tasks queued under direct before selecting sequential (or vice versa) were
blocked at recovery as 'Strategy direct@1 unavailable'. The dispatcher now
recovers/claims retained trusted built-ins by their persisted name/version;
new work still uses only the configured strategy. Unknown strategies still
block visibly.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/core!256
No description provided.