docs: priority DESC dispatch + bulk-cancel API + sequential patterns#1
Draft
cskwork wants to merge 3 commits into
Draft
docs: priority DESC dispatch + bulk-cancel API + sequential patterns#1cskwork wants to merge 3 commits into
cskwork wants to merge 3 commits into
Conversation
added 3 commits
May 14, 2026 15:18
…ntial patterns
Lessons learned running 86-issue feature spec through one Multica board:
- agent_task_queue dispatch is ORDER BY priority DESC, created_at ASC. A bulk
import that mapped difficulty:H → priority:high silently inverted the intended
T001→T002→… order. Flatten priorities at import or hold future work outside todo.
- Moving an issue to backlog / cancelled does not cancel its queued task row.
The daemon will reclaim it on the next restart. Use the
POST /api/agents/{id}/cancel-tasks API to actually drain the queue.
- For strict sequential dispatch: agent.max_concurrent_tasks=1 + only one issue
in todo at a time + a small promoter loop watching for in_review/done.
Adds:
- skills/multica/SKILL.md: new sections "Dispatch order", "Holding work and forcing
sequential dispatch", "Cancelling the agent task queue"; extra troubleshooting
rows for zombie queue, priority inversion, missing repo context.
- docs/SEQUENTIAL_DISPATCH.md: ops walkthrough with SQL excerpt and a working
curl example for the cancel-tasks endpoint.
- examples/*.py: five battle-tested scripts (import-from-md, rebalance, holdback,
wave promoter, strict single-flight watcher).
- README.md: link to new docs + examples table.
After a bulk POST /api/agents/{id}/cancel-tasks call, any queue row
that was created by a prior 'multica issue assign' gets cancelled too.
A subsequent re-assign of the same agent doesn't always re-enqueue,
so the daemon never claims the task. Pair unassign + re-assign with
'multica issue rerun' to force a fresh queue row.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lessons learned running 86 Spec Kit tasks through a single Multica board:
agent_task_queue.ORDER BY priority DESC, created_at ASC— bulk imports that map difficulty→priority will silently invert intended order.backlog/cancelleddoes not cancel its queue row. The daemon reclaims them afterdaemon start. Drain withPOST /api/agents/{id}/cancel-tasks(this PR documents the route + workspace-header requirement).max_concurrent_tasks=1, only one issue intodo, and a small watcher that promotes the next holding issue once the current one reachesin_review/done.Files
skills/multica/SKILL.md— new sections + 4 troubleshooting rowsdocs/SEQUENTIAL_DISPATCH.md— ops walkthrough with SQL excerpt and curl exampleexamples/import-tasks-from-md.py— bulk-create issues from tasks.mdexamples/rebalance-by-phase.py— reassign byphase:*labelexamples/holdback-wave.py— reset stuck issues + flatten priorities + hold future wavesexamples/wave-promoter.py— wave-based promotionexamples/strict-sequential.py— single-flight watcherTest plan
POST /api/agents/{id}/cancel-tasksreturns 200 and drains 90+ zombie rows.strict-sequential.py --watchcorrectly promoted ITE-3 (T002) only after ITE-2 (T001) reachedin_review.rebalance-by-phase.pyis idempotent (re-running on a clean board makes 0 changes).