[codex] fix mission ownership convergence and routing#88
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b64a3d4. Configure here.
| // Fallback: name-based substring matching | ||
| let agent_name = agent.name.to_lowercase(); | ||
| match role { | ||
| match normalize_role_alias(role) { |
There was a problem hiding this comment.
Dead match arms after role alias normalization
Low Severity
The match input in agent_matches_role was changed from role to normalize_role_alias(role), which converts "test" → "tester", "review" → "reviewer", "audit" → "reviewer", and "infra" → "devops". This makes the "test" alternative in "tester" | "test", the "review" alternative in "reviewer" | "review", and the "infra" alternative in "devops" | "infra" unreachable dead code. The PR discussion explicitly notes these were supposed to be removed ("those unreachable arms were removed") but they remain in the code.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b64a3d4. Configure here.


What changed
This PR fixes mission-mode divergence when the canonical work item gets stuck on a stale assignee or reviewer path, and it hardens routing so implementation work is much less likely to fall onto tester lanes.
Why it changed
Mission runs were getting into a bad state where real work continued under a conductor redirect, but mission bookkeeping stayed pinned to the old owner. That left the dispatcher reporting stale blockers and re-raising stuck help requests. Separately, routing was still too permissive: implement work could be inferred or scored in a way that let tester lanes win when the task metadata was weak.
Root cause
testerfrom incidental mentions of tests inside implementation issues.Implementwork.Impact
Validation
cargo test test_infer_owner_role_is_kind_aware_for_implement_workcargo test test_mission_scheduler_avoids_assigning_implement_work_to_testercargo test test_mission_scheduler_cargo test test_mission_dispatcher_cargo testNote
Medium Risk
Changes core mission orchestration (dispatcher directives, scheduler assignment/reconciliation) and task cancellation/creation, which could affect live work-item state transitions and agent routing if edge cases are missed.
Overview
Improves mission ownership convergence and routing. The dispatcher now parses
redirect/reassign/... to ...control notes, resolves agent/work-item references (including short IDs), and invokes the scheduler to redirect ownership while treating reconciliation as progress for help-request backoff.The scheduler now reconciles persisted work-item
assigned_to/statusagainst live mission-tagged tasks each tick, and adds an explicitredirect_work_itemflow that cancels superseded tasks and creates a replacement tracked task when needed.Routing heuristics were tightened: compiler owner-role inference is now
WorkKind-aware (avoids inferringtesterfrom incidental “tests”), scheduler role matching normalizes role aliases and introduces lane-based fallback scoring to strongly de-prioritize assigningImplementwork to tester/reviewer lanes; integration/unit tests were added/updated accordingly.Reviewed by Cursor Bugbot for commit b64a3d4. Bugbot is set up for automated code reviews on this repo. Configure here.