feat(monitor): reroute — one-click agent type change on assigned issue #243
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!243
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/232"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
POST /board/rerouteendpoint that changes an issue's agent type: cancels any in-flight task (≤5 s grace, 409 if it won't settle), updates the Forgejo assignee, posts a🔀 Rerouted from **dev** → **boss** by operatoraudit comment, and resets the board cacheReroute ▾dropdown next to the assignee column on every pipeline row; disables the current type and types with 0 registered instances; optimistic update rolls back on non-2xx with a toastTest plan
apps/server/src/main.test.ts— 4 new unit tests: missing fields → 400, unknown repo → 400, foreman (host-mode) → 400, rate limit fires on 4th call → 429apps/web/e2e/pipeline.spec.ts— Playwright smoke: open/app/monitor, find reroute dropdown, select "boss", assertPOST /board/reroutefires with correctrepo/issue_number/new_typedevtoboss, confirm boss picks it upCloses #232
🤖 Generated with Claude Code
Review
CI is green. Overall the implementation is solid — the server-side reroute handler, the cancel-and-wait logic, the rate limiter, the optimistic UI update with rollback, and the audit comment are all well-done. One functional bug to fix before merging.
Bug:
available_typesincludesforeman, breaking the dropdown guaranteeFile:
apps/server/src/main.ts—handleAgentsListObject.keys(cfg.types)includes all declared agent types — includingforeman. The comment added inapps/web/src/routes/monitor.index.tsxexplicitly relies on the server filtering this:That claim is wrong. With the current implementation,
foremanwill appear in the "Reroute ▾" dropdown withcapacity: 1(it's always registered), and it will not be disabled by thetype === currentType || capacity === 0check. The operator clicks it; the server returns400 "Cannot reroute to 'foreman' — host-mode agents…"; the UI shows an error toast. Confusing, and contrary to the acceptance criterion which says the menu shows only the 5 container-mode types.Fix — one line in
handleAgentsList:NON_DISPATCHABLE_TYPESis already imported inmain.ts(it's used inhandleBoardReroute), so no new import needed.Minor note (no change needed)
_rerouteCountaccumulates entries indefinitely. In practice the number of uniquerepo#issuekeys is tiny, so this is not a memory concern — just noting it in case a future sweeper pass wants to clean it up.Acceptance criteria
POST /board/reroutereturns 202Reroute ▾dropdown on monitor rowsforemanexcluded from dropdownFixed.
handleAgentsListnow filtersavailable_typesthroughNON_DISPATCHABLE_TYPES(already imported) before sorting, soforemanis excluded from the dropdown.The minor note on
_rerouteCountaccumulation is acknowledged — noted for a future sweeper pass.2bf81d956bbc990947daRound 2 — Approved
CI green on
bc99094. The only finding from round 1 is addressed:available_typesfix (apps/server/src/main.ts:670–671) —NON_DISPATCHABLE_TYPESfilter is in place;foremanno longer appears in the dropdown. The stale comment inmonitor.index.tsxthat described this filtering now accurately reflects reality.All acceptance criteria met. Good to merge.