B6 — Planner board: column header — queue depth + soft WIP limit #414

Closed
opened 2026-04-27 00:03:18 +00:00 by claude-desktop · 0 comments
Collaborator

As an operator,
I want each agent column to show queue depth and turn red when it exceeds a per-agent threshold,
so that I know when to spawn another instance instead of piling more on.

Each agent has a FIFO queue (docs/reviewer-instances.md); the operator finds out an agent is saturated by spawning extras in the agents tab. This story surfaces queue depth on the column header with a soft WIP threshold.

Acceptance criteria

Column header

  • Each agent column header shows running + queued / WIP (e.g. 3 / 4).
  • Header background turns bg-error/10 and the badge text turns text-error once running + queued > WIP.
  • Limit is soft — drops are not blocked, only the warning shows.
  • Tooltip on the badge lists the per-instance breakdown (reviewer-1: 2 in flight, reviewer-2: 1 queued). Use Tooltip from the existing component library.

Config

  • WIP limit configured per agent type in config/agents.json under a new optional wip_soft_limit?: number field.
  • Default 4 if absent.
  • No migration needed — schema is additive.

Backend — extend GET /board response per column

  • Each column gains wip_soft_limit: number (resolved from agents.json, default 4).
  • Each column gains in_flight: number and queued: number aggregates (sum across instances of that type).

Backend — new endpoint GET /board/agent-instances

  • Returns { <agent_type>: [{ login: string, in_flight: number, queued: number }] } for the WIP tooltip.
  • Reads from the existing per-instance task-history / queue state.
  • Cached for 5 s (matches /board cadence) so the tooltip is cheap to render.

Tests

  • board-column.test.tsx: header shows 2 / 4 given response with in_flight: 1, queued: 1, wip_soft_limit: 4.
  • board-column.test.tsx: header turns red once in_flight + queued > wip_soft_limit.
  • board-column.test.tsx: tooltip lists per-instance counts from /board/agent-instances.
  • Server test: /board response includes wip_soft_limit, in_flight, queued per column.
  • Server test: /board/agent-instances returns expected shape.

Out of scope

  • Per-instance columns (M18-7 deferral stands).
  • Hard WIP limits — soft only, drops always succeed.
  • Auto-spawning a new agent instance when over WIP (separate spec, may not be wanted).

References

  • Spec: docs/specs/board-rework.md §5 B6 + §6.
  • Reviewer pool: docs/reviewer-instances.md.
  • config/agents.json schema: apps/server/src/domain/agents/config.ts (or wherever the loader lives).

Dependencies

  • Lands after B5 — server response extension overlaps; do them in order to avoid two migrations of /board.

Suggested first commit

feat(board): WIP soft limit badge on agent columns + per-instance tooltip

**As an** operator, **I want** each agent column to show queue depth and turn red when it exceeds a per-agent threshold, **so that** I know when to spawn another instance instead of piling more on. Each agent has a FIFO queue (`docs/reviewer-instances.md`); the operator finds out an agent is saturated by spawning extras in the agents tab. This story surfaces queue depth on the column header with a soft WIP threshold. ## Acceptance criteria ### Column header - [ ] Each agent column header shows `running + queued / WIP` (e.g. `3 / 4`). - [ ] Header background turns `bg-error/10` and the badge text turns `text-error` once `running + queued > WIP`. - [ ] Limit is **soft** — drops are not blocked, only the warning shows. - [ ] Tooltip on the badge lists the per-instance breakdown (`reviewer-1: 2 in flight, reviewer-2: 1 queued`). Use `Tooltip` from the existing component library. ### Config - [ ] WIP limit configured per agent type in `config/agents.json` under a new optional `wip_soft_limit?: number` field. - [ ] Default 4 if absent. - [ ] No migration needed — schema is additive. ### Backend — extend `GET /board` response per column - [ ] Each column gains `wip_soft_limit: number` (resolved from `agents.json`, default 4). - [ ] Each column gains `in_flight: number` and `queued: number` aggregates (sum across instances of that type). ### Backend — new endpoint `GET /board/agent-instances` - [ ] Returns `{ <agent_type>: [{ login: string, in_flight: number, queued: number }] }` for the WIP tooltip. - [ ] Reads from the existing per-instance task-history / queue state. - [ ] Cached for 5 s (matches `/board` cadence) so the tooltip is cheap to render. ### Tests - [ ] `board-column.test.tsx`: header shows `2 / 4` given response with `in_flight: 1, queued: 1, wip_soft_limit: 4`. - [ ] `board-column.test.tsx`: header turns red once `in_flight + queued > wip_soft_limit`. - [ ] `board-column.test.tsx`: tooltip lists per-instance counts from `/board/agent-instances`. - [ ] Server test: `/board` response includes `wip_soft_limit`, `in_flight`, `queued` per column. - [ ] Server test: `/board/agent-instances` returns expected shape. ## Out of scope - **Per-instance columns** (M18-7 deferral stands). - **Hard WIP limits** — soft only, drops always succeed. - Auto-spawning a new agent instance when over WIP (separate spec, may not be wanted). ## References - Spec: `docs/specs/board-rework.md` §5 B6 + §6. - Reviewer pool: `docs/reviewer-instances.md`. - `config/agents.json` schema: `apps/server/src/domain/agents/config.ts` (or wherever the loader lives). ## Dependencies - Lands after **B5** — server response extension overlaps; do them in order to avoid two migrations of `/board`. ## Suggested first commit `feat(board): WIP soft limit badge on agent columns + per-instance tooltip`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#414
No description provided.