feat(webui): Restart in the agent drawer, through the existing end and launch routes and the drawer agent's own organization (#1873) #1990

Merged
jason.woltje merged 3 commits from sp19-drawer-restart into refactor 2026-11-18 19:43:17 +00:00
Owner

What changes

The agent drawer gets a Restart button. No server file changes and no new route.

  • Restart. It sits beside Stop, only where Stop is offered, and uses Stop's confirm step and status line. It ends the agent in the drawer agent's own organization with the reason "restart from the agent drawer", waits for the request to close and the runs to reach 0, then launches it. So it is right on #/agents, where the drawer can show any organization's agent.
  • Conversation agents. One is ended and not launched. The line says its next message starts it.
  • Never Regenerate. Restart does not call /api/agent/regenerate. A test fails if it does.
  • Refusals. Each shows one plain line: not owner, organization archived, bus stopped, end refused, launch refused, launch request closed refused, runs never reaching 0. A second click while a restart runs does nothing.
  • One chain. The Settings > Routing restart goes through the same chain in agents.js, which now takes org, reason and a text callback. Its reason and words are unchanged, and two tests pin them.

How

  • packages/webui/src/public/agents.js, workspace.js.
  • Tests: agent-drawer-browser, routes-apply-browser, agents.

Behaviour to know

  • After a refused launch the agent has no run, so the drawer redraws from a fresh read and Stop and Restart are gone.
  • After a restart, focus goes to the drawer heading.

Tests

  • One test per refusal, a two-drawer test, the Regenerate test and the pinned route-change text.
  • Lane gate on 9a3004cba: 198 webui test files, 1684 pass, 0 fail.
  • Lead check on 9a3004cba in a clean environment: 8 test files (agent drawer, agents, routes apply, unified workspace, system agents, single pane, org page fit, triage drawer), 125 pass, 0 fail, 0 skipped.

Review

One fresh claude-opus-5-5 reviewer: changes, one P2 and two P3s. All three are fixed in the second commit: each restart keeps its own state per agent, the drawer redraws after an ended agent's launch is refused, and an archived or unavailable organization gets a plain line. No reviewer read that commit or the last one.

Left for later

  • Stop still says "Outcome unknown" for an archived or unavailable organization.
  • Two Stops in two drawers at once can still lose one Stop's line.
## What changes The agent drawer gets a Restart button. No server file changes and no new route. - **Restart.** It sits beside Stop, only where Stop is offered, and uses Stop's confirm step and status line. It ends the agent in the drawer agent's own organization with the reason "restart from the agent drawer", waits for the request to close and the runs to reach 0, then launches it. So it is right on `#/agents`, where the drawer can show any organization's agent. - **Conversation agents.** One is ended and not launched. The line says its next message starts it. - **Never Regenerate.** Restart does not call `/api/agent/regenerate`. A test fails if it does. - **Refusals.** Each shows one plain line: not owner, organization archived, bus stopped, end refused, launch refused, launch request closed refused, runs never reaching 0. A second click while a restart runs does nothing. - **One chain.** The Settings > Routing restart goes through the same chain in `agents.js`, which now takes `org`, `reason` and a text callback. Its reason and words are unchanged, and two tests pin them. ## How - `packages/webui/src/public/agents.js`, `workspace.js`. - Tests: `agent-drawer-browser`, `routes-apply-browser`, `agents`. ## Behaviour to know - After a refused launch the agent has no run, so the drawer redraws from a fresh read and Stop and Restart are gone. - After a restart, focus goes to the drawer heading. ## Tests - One test per refusal, a two-drawer test, the Regenerate test and the pinned route-change text. - Lane gate on 9a3004cba: 198 webui test files, 1684 pass, 0 fail. - Lead check on 9a3004cba in a clean environment: 8 test files (agent drawer, agents, routes apply, unified workspace, system agents, single pane, org page fit, triage drawer), 125 pass, 0 fail, 0 skipped. ## Review One fresh claude-opus-5-5 reviewer: changes, one P2 and two P3s. All three are fixed in the second commit: each restart keeps its own state per agent, the drawer redraws after an ended agent's launch is refused, and an archived or unavailable organization gets a plain line. No reviewer read that commit or the last one. ## Left for later - Stop still says "Outcome unknown" for an archived or unavailable organization. - Two Stops in two drawers at once can still lose one Stop's line.
jason.woltje added 3 commits 2026-11-18 19:43:07 +00:00
jason.woltje merged commit 9a3004cba4 into refactor 2026-11-18 19:43:17 +00:00
Sign in to join this conversation.