Skip to content

feat(app): auto-approve agy subagent approval notices - #104

Merged
simota merged 1 commit into
mainfrom
feat/agy-subagent-auto-approve
Oct 17, 2026
Merged

simota merged 1 commit into
mainfrom
feat/agy-subagent-auto-approve

Conversation

@simota

@simota simota commented Oct 17, 2026

Copy link
Copy Markdown
Owner

When a subagent waits on a tool approval, agy shows a notice above its input box (<agent> needs approval for <Tool> … ctrl+k approve · alt+j manage) instead of its permission menu, so auto-approve left those runs stalled. This PR recognizes that notice and answers it with ctrl+k (0x0b).

The notice is matched only as a whole:

  • Notice block: every row from the title to the hint sits behind one left bar. The block holds a rule, a ● <Tool>(…) call naming the title's tool, and a hint that names ctrl+k.
  • Live frame below it: a rule, an empty > input prompt, a rule, only subagent list rows (● Agent(…)), and agy's status bar last.
  • Left to the user: a draft in the input (ctrl+k is also a line edit there), a rebound approve key, or a second notice on screen. A multi-line draft can paint its own rule under an empty first line, so every row down to the status bar must be a list row.
  • Denylist: the existing command denylist applies to the displayed call.
  • Dialog hash: stops at the hint, so the subagent list's ticking timers do not rearm an accepted notice.

Reviewer notes:

  • Shared change: agy_status_row now accepts any upper-case mode label (IDLE as well as TOOL USE) before | Model | … | Context: n%. This also slightly loosens the live-tail check of the existing agy command and question dialogs.
  • Bar glyph is a guess: the screenshot does not show which glyph agy paints, so │ ┃ ▌ ▎ are all accepted. A different glyph only means no match.
  • One step is unconfirmed: ctrl+k is assumed to approve the single pending step. This is inferred from agy's subagent.approve_fast / "Approve subagent fast" binding and has not been observed.

Validation:

  • Synthetic tests reproduce the screenshot layout. They check that it fires once with 0x0b, that a ticking subagent timer does not rearm it, and that it decodes from a VT grid.
  • Separate negative cases cover a denylisted call, a tool mismatch, a missing or mixed bar, a missing rule, a rebound key, a draft, a non-status last row, trailing output, a second notice, and a (+1 more) title.
  • The draft-bypass case from review was confirmed to fail without the list-row check.
  • cargo test --workspace --no-fail-fast passes: 2822 tests, run unsandboxed for noa-pty/noa-ipc. cargo fmt --check and git diff --check pass.
  • cargo clippy -p noa-app --all-targets reports nothing in auto_approve.rs. Warnings that already existed in other files remain.

Not addressed:

  • Behaviour against a running agy (spec AC-13) was not exercised: whether ctrl+k is accepted, whether it approves only one step, and the actual bar glyph.

agy shows a barred notice above its input box when a subagent waits on a
tool approval ("<agent> needs approval for <Tool>" ... "ctrl+k approve ·
alt+j manage"). Recognize it and answer with ctrl+k.

The notice is matched only as a whole: every row behind one left bar, a
rule, a "● <Tool>(…)" call naming the title's tool, and the hint naming
ctrl+k, followed by agy's live frame: a rule, an empty input prompt, a
rule, only subagent list rows, and the status bar last. ctrl+k is also a
line edit, so a draft in the input leaves the screen to the user; a
multi-line draft can paint its own rule under an empty first line, which
is why every row down to the status bar must be a list row. A rebound
approve key or a second notice is left to the user too. The command
denylist applies to the displayed call, and the dialog hash stops at the
hint so the subagent list's timers do not rearm it.

agy's status bar check now accepts any upper-case mode label (IDLE as
well as TOOL USE), which also applies to the existing agy dialogs.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T07:26:57.655152Z fab54b3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@simota
simota merged commit d944949 into main Oct 17, 2026
1 check passed
@simota
simota deleted the feat/agy-subagent-auto-approve branch October 17, 2026 07:28
@simota simota mentioned this pull request Oct 20, 2026
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