Ask: question a live run without interrupting it, and a nudge for a stuck run #223

Closed
opened 2026-10-19 18:54:07 -04:00 by cmoriarty · 3 comments
Owner

Builds on #222 (Repair).

Symptom

A person has no way to ask a question about a run without talking to its agent, and anything sent to the agent steers it. A run can also be stuck in a state nothing marks as failed (an agent that has gone quiet, a step waiting on something), where Repair never becomes available because the run has not failed.

Wanted

An Ask mode on the same helper as Repair: one agent, read-only while the run is live, full access once it is stopped or failed.

  • Ask never interrupts the run. It reads the transcript, steps, diff and CI output and answers. It cannot write, run a shell command that changes anything, or send the working agent a message. Enforced by the session's permissions (write and shell denied), not by the prompt.
  • A target switch in the message box, only while an agent step is running: Agent | Ask. The default stays Agent, so the direct line to the working agent that Redirect and Queue give is unchanged. In Ask mode the box looks different (accent colour, placeholder "Ask about this run"), Queue and Redirect are gone and only Send remains, so a question cannot be sent to the agent by mistake. The choice is a keyboard command, remembered per run. When there is no running agent step the box talks to Repair and shows no switch.
  • From Ask to Repair. If Ask finds a stuck run, the person stops it; the run is then stopped, the helper's access opens, and the conversation so far is its context.
  • A nudge for a stuck run. When the watchdog finds a run silent for too long, the console says so with the two moves: Ask, or Stop and repair. It builds on the liveness the watchdog already tracks.
  • Shares #222's backend setting, session and short-lived server.
Builds on #222 (Repair). ## Symptom A person has no way to ask a question about a run without talking to its agent, and anything sent to the agent steers it. A run can also be stuck in a state nothing marks as failed (an agent that has gone quiet, a step waiting on something), where Repair never becomes available because the run has not failed. ## Wanted An **Ask** mode on the same helper as Repair: one agent, read-only while the run is live, full access once it is stopped or failed. - **Ask never interrupts the run.** It reads the transcript, steps, diff and CI output and answers. It cannot write, run a shell command that changes anything, or send the working agent a message. Enforced by the session's permissions (write and shell denied), not by the prompt. - **A target switch in the message box, only while an agent step is running: Agent | Ask.** The default stays Agent, so the direct line to the working agent that Redirect and Queue give is unchanged. In Ask mode the box looks different (accent colour, placeholder "Ask about this run"), Queue and Redirect are gone and only Send remains, so a question cannot be sent to the agent by mistake. The choice is a keyboard command, remembered per run. When there is no running agent step the box talks to Repair and shows no switch. - **From Ask to Repair.** If Ask finds a stuck run, the person stops it; the run is then stopped, the helper's access opens, and the conversation so far is its context. - **A nudge for a stuck run.** When the watchdog finds a run silent for too long, the console says so with the two moves: Ask, or Stop and repair. It builds on the liveness the watchdog already tracks. - Shares #222's backend setting, session and short-lived server.
Author
Owner

The Ask agent should have a setting that lets the user choose the backend, similar to planning. While any backend could work, one that only allows a single agent should disable the Ask agent. I'm actually thinking the Ask agent could be a good fit for the free backend, possibly paired with a fast reliable agent that would be useful for checking status, digging through transcripts, and knowing the braid infrastructure well. Perhaps it could always be "warm", meaning it is an always-on agent paying attention to the runs and their status/progress.

The Ask agent should have a setting that lets the user choose the backend, similar to planning. While any backend could work, one that only allows a single agent should disable the Ask agent. I'm actually thinking the Ask agent could be a good fit for the free backend, possibly paired with a fast reliable agent that would be useful for checking status, digging through transcripts, and knowing the braid infrastructure well. Perhaps it could always be "warm", meaning it is an always-on agent paying attention to the runs and their status/progress.
Author
Owner

Shipped in PR #421 (ff9381d8), change ask-mode.

  • The helper conversation is Ask while the run is live and Repair once it stops: one session, prompted as the ask agent (read-only by its permissions: no edit, write, patch, shell, subagent, webfetch, browser, app or repair) or as repair. Ask's first message carries the run, the step it is on and the agent's last words; the first message to Repair after a stop says the conversation turned.
  • POST /api/runs/{id}/repair accepts a live run and records agent on human.repair; a succeeded or archived run is still refused.
  • The message box shows Agent | Ask while an agent step runs (A switches), Agent by default; in Ask mode it has its own colour and the placeholder "Ask about this run", offers Send alone, and sends to the helper, never the step's agent. The choice is remembered per run.
  • A step silent past the watchdog's threshold shows Ask and Stop and repair beside its activity line.

Tests: tests/api/test_ask.py, tests/agent/test_review_agent.py, ui/src/lib/ask.test.ts, journeys in ui/e2e/ask.spec.ts. Not yet done on a real run: a question to Ask during a live step on production. Ask uses Repair's backend setting, as proposed.

**Shipped in PR #421 (ff9381d8), change `ask-mode`.** - The helper conversation is Ask while the run is live and Repair once it stops: one session, prompted as the `ask` agent (read-only by its permissions: no edit, write, patch, shell, subagent, webfetch, browser, `app` or `repair`) or as `repair`. Ask's first message carries the run, the step it is on and the agent's last words; the first message to Repair after a stop says the conversation turned. - `POST /api/runs/{id}/repair` accepts a live run and records `agent` on `human.repair`; a succeeded or archived run is still refused. - The message box shows Agent | Ask while an agent step runs (`A` switches), Agent by default; in Ask mode it has its own colour and the placeholder "Ask about this run", offers Send alone, and sends to the helper, never the step's agent. The choice is remembered per run. - A step silent past the watchdog's threshold shows Ask and Stop and repair beside its activity line. Tests: `tests/api/test_ask.py`, `tests/agent/test_review_agent.py`, `ui/src/lib/ask.test.ts`, journeys in `ui/e2e/ask.spec.ts`. Not yet done on a real run: a question to Ask during a live step on production. Ask uses Repair's backend setting, as proposed.
Author
Owner

Follow-up fix in PR #423 (2273743e). The first Ask on production (run 182, during apply) was accepted by the route and refused by the delivery with "this run is running; Repair is for a stopped or failed run": the supervisor's open_repair ran the Repair check again without Ask's allowance. It now opens the live run's own server for Ask and holds nothing for it. The first prompt's running-step facts also read columns the step table does not have; fixed, with a test against the real schema. The run was stopped and resumed to deploy it.

**Follow-up fix in PR #423 (2273743e).** The first Ask on production (run 182, during apply) was accepted by the route and refused by the delivery with "this run is running; Repair is for a stopped or failed run": the supervisor's `open_repair` ran the Repair check again without Ask's allowance. It now opens the live run's own server for Ask and holds nothing for it. The first prompt's running-step facts also read columns the step table does not have; fixed, with a test against the real schema. The run was stopped and resumed to deploy it.
Sign in to join this conversation.
No labels
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
cmoriarty/braid#223
No description provided.