Skip to content

docs: priority DESC dispatch + bulk-cancel API + sequential patterns#1

Draft
cskwork wants to merge 3 commits into
mainfrom
feat/sequential-dispatch-and-priority-gotcha
Draft

docs: priority DESC dispatch + bulk-cancel API + sequential patterns#1
cskwork wants to merge 3 commits into
mainfrom
feat/sequential-dispatch-and-priority-gotcha

Conversation

@cskwork
Copy link
Copy Markdown
Owner

@cskwork cskwork commented May 14, 2026

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.
  • Moving an issue to backlog/cancelled does not cancel its queue row. The daemon reclaims them after daemon start. Drain with POST /api/agents/{id}/cancel-tasks (this PR documents the route + workspace-header requirement).
  • Strict sequential dispatch needs three things: max_concurrent_tasks=1, only one issue in todo, and a small watcher that promotes the next holding issue once the current one reaches in_review/done.

Files

  • skills/multica/SKILL.md — new sections + 4 troubleshooting rows
  • docs/SEQUENTIAL_DISPATCH.md — ops walkthrough with SQL excerpt and curl example
  • examples/import-tasks-from-md.py — bulk-create issues from tasks.md
  • examples/rebalance-by-phase.py — reassign by phase:* label
  • examples/holdback-wave.py — reset stuck issues + flatten priorities + hold future waves
  • examples/wave-promoter.py — wave-based promotion
  • examples/strict-sequential.py — single-flight watcher

Test plan

  • Manually verified POST /api/agents/{id}/cancel-tasks returns 200 and drains 90+ zombie rows.
  • strict-sequential.py --watch correctly promoted ITE-3 (T002) only after ITE-2 (T001) reached in_review.
  • rebalance-by-phase.py is idempotent (re-running on a clean board makes 0 changes).

donga-csk 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.
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