Skip to content

Sonny: show auto-review in progress and its denials; /approve retries one - #261

Merged
lydakis merged 20 commits into
mainfrom
claude/project-thread-6y8uvt
Oct 28, 2026
Merged

lydakis merged 20 commits into
mainfrom
claude/project-thread-6y8uvt

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Picks 5 and 7 of the Codex alignment (#237 and #243 did the approver side). Codex's TUI shows when its guardian is reviewing a call, draws each denial with its reason, and offers /approve to retry a denied action once. Until now Sonny showed nothing while the judge worked, and a denial looked like any other tool error.

What changes

  • Review status: while the auto judge reviews calls in the current turn, the status row reads Reviewing approval request, or Reviewing N approval requests when there are several. This is Codex's wording.
    • It only shows when no manual approval is waiting.
    • It updates as each call finishes.
    • Nothing stays under review past its turn, including a call cancelled before it started.
  • Denial line: a call the judge denied is drawn as ✗ Request denied for <action>, followed by the judge's reason in up to four dim rows.
    • The action is the command's first line, the tool and path, or the tool name.
    • This works both live and when replaying history.
    • A denied call counts as failed, so a denied ask is never pinned and a denied resolve_task resolves nothing.
  • /approve: lists this session's most recent auto-review denials, up to eight.
    • The first Enter writes the chosen call out whole: every line of a command plus its other arguments (detach, timeout_ms, …), or a write's or edit's full arguments.
    • A second Enter on the same denial sends your approval as your own message, in Codex's words: "Treat this as approval to perform that exact action in the same context in which it was originally requested. Do not assume this also authorizes similar operations with different payloads."
    • The retry is still reviewed.
    • A call longer than 500 rows is refused with a note to approve it in words, so nothing scrolls away unread.
  • README: the /approvals bullet mentions the status and the denial line, and there is a new /approve bullet.

Screenshots

These were taken against a real daemon and agent approver, with a stand-in judge that denies --force.

Reviewing:

Reviewing approval request

Denied:

Request denied

/approve, after the first Enter:

approve one retry

Tests

  • an_auto_review_denial_is_drawn_and_approve_sends_one_retry uses a fake daemon and checks:
    • the status row with two calls under review, and after each one finishes;
    • the denial line;
    • that a denied ask isn't pinned;
    • that a cancelled call leaves review;
    • the two-step /approve, and that the retry is sent as one message.
  • a_denied_call_reads_from_its_output_in_the_replay covers the replay, plus the whole-call rendering for a write, a detached command and a multi-line command.
  • cargo test -p sonny --bins passes (263), and clippy with -D warnings and cargo fmt --check are clean.

🤖 Generated with Claude Code

claude added 11 commits October 27, 2026 23:59
George asked to follow Codex's auto-approval patterns where ours were odd.
This takes the picks that need no sandbox:

- The judge gets Codex's written policy (evidence handling, authorization
  scoring, risk taxonomy, exfiltration, credential probing, security
  weakening, destructive actions, outcome table) with this agent's trust
  rules folded in, and answers one assessment a call: risk_level,
  user_authorization, outcome, rationale. The eleven probability
  questions built for Jev are gone; the Decisions API gets one predicate
  a call.
- A denial goes back to the model at once with Codex's wording. Only a
  call too long to show is still handed to a person.
- A review is tried up to 3 times within 90 s, then denied as a labeled
  review failure (or a timeout). The answer carries `unreviewed`, and the
  daemon counts it toward no breaker.
- The breaker is Codex's: 3 in a row, or 10 among the turn's last 50
  decided calls. The daemon keeps that window as bits on the bot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
- Schema 54 turns a stored per-turn count into that many denials as the
  window's newest calls, so a turn parked across the upgrade keeps its
  breaker count instead of starting from none.
- A denial's reason clips the judge's rationale to 4 KiB on a character
  boundary and names only known risk and authorization levels, so it
  always fits the daemon's 16 KiB reason limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
… given

Codex shows its guardian the transcript, tool outputs included and marked
untrusted, and treats AGENTS.md as the person's instructions. The judge's
state gains the bot's own messages, calls and outputs within Codex's
synchronous bounds, and the AGENTS.md files that still read as the bot
was given them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
…AGENTS.md only as given in full

A cut could keep the tail of a secret the redactor no longer recognizes,
so each entry is redacted before it is cut to its share. AGENTS.md files
count as standing instructions only when every file that applies reads
exactly as the bot's instructions hold them, followed by the next
composed section: a file cut short at a paragraph, added, or removed
reads as changed, and then none is shown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
…ole state within one judge prompt

A registered secret with a quote in it no longer matches once its call's
arguments are JSON-escaped, so they are redacted as values first, as
planned calls are. The standing instructions and the transcript are
bounded on their own, so together the state could pass the daemon's
256 KiB prompt limit and every attempt would fail: past 240 KiB the
oldest transcript entries go first, then the standing instructions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
Agents write memory, so an index could be made to read as the paragraphs
an agent cut from AGENTS.md, and an empty index matched any cut at a
paragraph. Only the end, the skills or profiles list, or a role with no
list after it now marks the end of the files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
A shell's result encodes what the command printed, so a printed secret
with a quote or backslash read otherwise once escaped and slipped past
redaction of the text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
… one

While the auto judge reviews a call, the status row reads "Reviewing
approval request" (or N requests), as in Codex. A denied call is drawn
as "✗ Request denied for <action>" with the reason, live and in replay.
/approve lists this session's recent auto-review denials and approves
one retry of the chosen one, with Codex's wording: that exact action,
in the same context, and nothing similar. The retry is still reviewed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T04:54:55.066656Z 618b1ad New commits
🔒 Security Review ✅ Completed 2026-10-28T04:58:10.518538Z 618b1ad New commits

Security findings

Advisory findings (3)

ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ca8035266

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/main.rs Resolved
Comment thread sonny/src/main.rs Resolved
A denied question was pinned as asked, live and in the replay, since a
denial carries no failed flag. And one call's denial set the status to
Working while the judge still reviewed the round's other calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5703e592b0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/main.rs Resolved
Comment thread sonny/src/main.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 5703e592b0

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sonny/src/transcript.rs Resolved
…r approves it; a cancelled call leaves review

The picker showed a command's first line, or a write's path, so a person
could approve what they had not read. And a call cancelled before it
started stayed under review into later turns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 38fb9cb18f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 38fb9cb18f

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sonny/src/main.rs Resolved
Past 500 rows the start of a written-out call could scroll out of what
the screen keeps, so the person approves it in words instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: faca4e3f56

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: faca4e3f56

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sonny/src/main.rs Resolved
A detached or backgrounded command read like any other, though the
approval covers how it runs as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: f13cdfa7d1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner Author

runtime failed on one timing assertion. tests.test_retry_accounting measured paced_ms at 48 against a floor of 50. That test is a known timing flake from the test-gate work, and this PR only touches Sonny, so it isn't caused by these changes. I couldn't re-run the job from here, but I merged the latest main (#251 and #266) into the branch as 91fc806, and CI is running again on that.


Generated by Claude Code

@lydakis
lydakis merged commit 858765f into main Oct 28, 2026
3 checks passed
lydakis pushed a commit that referenced this pull request Oct 28, 2026
@lydakis lydakis mentioned this pull request Oct 28, 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.

2 participants