Skip to content

fix: overhaul task system — outbound sync, escalation, failed column, MCP filtering#548

Merged
0xNyk merged 1 commit intomainfrom
fix/task-system-overhaul
Apr 3, 2026
Merged

fix: overhaul task system — outbound sync, escalation, failed column, MCP filtering#548
0xNyk merged 1 commit intomainfrom
fix/task-system-overhaul

Conversation

@0xNyk
Copy link
Copy Markdown
Member

@0xNyk 0xNyk commented Apr 3, 2026

Summary

Comprehensive task system overhaul based on a full audit. Fixes all critical and medium priority issues.

What was broken

  • Outbound sync completely missing: Drag-and-drop status changes, dispatch transitions, Aegis reviews, and stale requeues never synced to GitHub issues or GNAP repos. Only task creation triggered sync.
  • Poison pill tasks: Tasks that failed 5 dispatch attempts or 3 Aegis rejections moved to failed status with no notification, no UI recovery, and no visibility.
  • awaiting_owner was fake: Client-side keyword matching on every render, not a real status. Couldn't be set by agents or persisted.
  • MCP tools couldn't filter: mc_list_tasks returned all tasks with no filtering.
  • Model classification too simple: Only keyword-based, missed large tasks.

Fixes

Issue Fix Impact
H1: Bulk PUT sync Created syncTaskOutbound() helper, wired into PUT handler Drag-drop now syncs to GitHub/GNAP
H2: GNAP updates Sync called on all status transitions in task-dispatch.ts GNAP reflects current task state
H3: Poison pill escalation task.escalated event broadcast on max failures Webhooks receive escalation alerts
H4: awaiting_owner + failed Formal statuses in schemas, types, label maps, GNAP Agents can set these; UI supports drag-drop
H5: Failed task recovery "Failed" column + retry button in task board Users can retry failed tasks
M1: Aegis feedback display Error message + dispatch attempts shown in task detail Visibility into why tasks failed
M2: MCP filtering mc_list_tasks accepts status, assigned_to, priority, search, limit Agents can query specific tasks
M3: Model classification Description length + estimated_hours heuristics Large tasks route to Opus

Files changed: 26 (+193/-42)

Test plan

  • pnpm typecheck — passes
  • pnpm test — 892/892 pass, 74/74 files
  • Manual: Drag task to Done → verify GitHub issue closes
  • Manual: Let task fail 5 times → verify Failed column + retry button
  • Manual: MCP mc_list_tasks { status: "failed" } → returns filtered results
  • Manual: Set task to awaiting_owner via API → appears in correct column

… MCP filtering

Fixes all critical and medium priority issues from task system audit:

Outbound sync (H1/H2):
- Create syncTaskOutbound() shared helper in github-sync-engine.ts
- Wire into bulk PUT (drag-and-drop), replacing per-endpoint inline sync
- Wire into task-dispatch.ts at all 5 status transition points
- GNAP sync now updates on status changes (was create-only)

Escalation (H3):
- Add task.escalated event type to event bus
- Broadcast escalation when tasks fail after max retries (dispatch, Aegis, stale)
- Webhook subscribers auto-receive escalation events

Failed + awaiting_owner as formal statuses (H4):
- Add to validation schemas, github-label-map, gnap-sync, all Task types
- New "Failed" column on task board with error display and retry button
- Retry resets dispatch_attempts and moves task back to assigned

MCP server filtering (M2):
- mc_list_tasks now accepts: status, assigned_to, priority, search, limit
- Backward compatible — no params returns all tasks

Model classification (M3):
- Add size heuristics: description >2000 chars or estimated_hours >=4 → opus

Tests updated for new status counts and enums.
@github-actions github-actions bot added the screenshot-drift UI changed — README screenshots may need updating label Apr 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

📸 Screenshot Drift Check

This PR modifies UI source files. Please verify whether the README screenshots need refreshing:

  • docs/mission-control-overview.png — main dashboard
  • docs/mission-control-agents.png — agents panel
  • docs/mission-control-memory-graph.png — memory graph
Changed UI files
src/app/api/tasks/[id]/route.ts
src/app/api/tasks/route.ts
src/components/panels/task-board-panel.tsx

See docs/SCREENSHOT-GUIDE.md for instructions on capturing and optimising screenshots.

This comment is posted automatically and can be dismissed if no visual changes occurred.

@0xNyk 0xNyk merged commit 6d89924 into main Apr 3, 2026
2 checks passed
@0xNyk 0xNyk deleted the fix/task-system-overhaul branch April 3, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

screenshot-drift UI changed — README screenshots may need updating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant