Skip to content

feat(tui): name the agent when a background task needs approval - #686

Merged
mohitranka merged 1 commit into
mainfrom
feat/background-strip-approvals
Sep 14, 2026
Merged

mohitranka merged 1 commit into
mainfrom
feat/background-strip-approvals

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Follow-up to #685, which made the background strip visible. This closes the one case that was still silent.

The defect

A background subagent stopping for approval changed nothing the operator could read. poll_background_tasks swept only terminal transitions, so the block was invisible apart from the footer chip's · 1 need — a count that does not say who is asking, and that the operator has to notice unprompted.

Subagent approvals live on the task (BackgroundTaskStatus::WaitingForApproval), not on the session, so there is no transcript approval card to relabel. The strip row and the feedback line are the entire surface. #685 already made the row name its asker; this adds the transition that was missing.

What changed

  • A task newly entering WaitingForApproval raises a warning on the feedback strip and a toast: explore needs approval: bash.
  • Approve, deny and "isn't waiting" feedback name the task instead of its row id, so answering one of several in-flight agents is unambiguous.
  • A small bug fixed on the way: push_toast hardcoded FeedbackSeverity::Ok for both the toast and the feedback strip it writes. A needs-approval notice would have rendered as a success notice and clobbered the severity the caller set. push_toast_with now takes the severity and push_toast is a thin Ok wrapper.

Verification

  • New test: a subagent that blocks names itself and its tool on the feedback strip, with Warn severity.
  • Extended test: the approval confirmation names the task.
  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets --locked -- -D warnings clean.
  • Three app::tests::tasks tests fail locally because this machine refuses to apply the tool sandbox; they fail identically on main.

A background subagent stopping for approval changed nothing the operator
could read. `poll_background_tasks` swept only terminal transitions, so the
block was invisible apart from the footer chip's `· 1 need` — a count that
does not say who is asking, and which the operator has to notice unprompted.

Subagent approvals live on the task (`BackgroundTaskStatus::
WaitingForApproval`), not on the session, so there is no transcript card to
relabel: the strip row and the feedback line are the whole surface. The strip
row already names the asker after #685; this adds the transition that was
missing.

- A task newly entering `WaitingForApproval` now raises a warning on the
  feedback strip and a toast: `explore needs approval: bash`.
- Approve, deny and "not waiting" feedback name the task rather than its row
  id, so answering one of several in-flight agents is unambiguous.
- `push_toast` hardcoded `FeedbackSeverity::Ok` for both the toast and the
  feedback strip it writes. A needs-approval notice would therefore have
  rendered as a success and clobbered the severity. `push_toast_with` takes
  the severity; `push_toast` is now a thin `Ok` wrapper.

Tests: a subagent that blocks names itself and its tool on the feedback strip
with `Warn` severity, and the approval confirmation names the task.
@mohitranka
mohitranka merged commit 3affd7c into main Sep 14, 2026
3 checks passed
mohitranka added a commit that referenced this pull request Sep 14, 2026
…ions (#688)

The design system described the footer's counts-only chip and referred per-item
detail to "the task view", which did not exist as a named surface. The strip now
renders (#685, #686) and notifies (#687), so the rules that shipped — and the
reason each exists — belong in the design language rather than only in the code.

Adds §9.12 (the strip) and §9.13 (out-of-band notification), and points Row 1
of §9.3 at them. The rules recorded are the ones that are load-bearing and easy
to undo by accident: the derived height that keeps the transcript's floor,
the ordering that stops truncation hiding a failure, `cancelled` staying
distinct from `done`, the one-minute expiry, and the focus gate on the
notification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant