Repository navigation
Add Sonny, a terminal coordinator for a folder's agents - #146
Conversation
Protocol 14. configure replaces what a bot's client chose when it made it: its instructions, a model of the same family with an optional effort, and a root bot's gate (approve: [] alone removes it; a bot another bot made keeps the gates it descends from). It is refused while a turn runs or waits parked, answers which fields changed, and tells followers with a live configured event. ready.providers now names the efforts each binding's family takes, and the client keeps it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
The app's project file helpers and its ~/.agent/env reader move to agent-client, so a terminal client composes a lead the app's way. Finding a folder's project now stops at its repository's top, and the home folder's project applies to home itself only, so a repo under home is never claimed by it. The coordinator lists only its own project's agents when it names or finds a task. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
Sonny opens a folder's lead in a Codex-style TUI, lays each task out as a Rex window, and offers /model, /approvals, /status, /sound, /copy, /open and /quit. Agents get a rex-windows skill, and an errand skill when Errand is installed; Errand runs are drawn as calls, and detached jobs open in their own Rex window. Pictures come in a follow-up. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
A steer restarts the demo script within a turn, and a turn keys its calls by id, so each request now names its calls afresh. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5269c8eab
ℹ️ 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".
Clearing the thinking binding makes the next request strip thinking written under the old instructions. The docs now say a client-made fork's gates can be replaced too, since that client could make an ungated bot anyway. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
…ject-thread-45hlbm-client
…t-thread-45hlbm-sonny
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7a49d590b
ℹ️ 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".
…nect - History and live results read Anthropic tool_use/tool_result blocks as calls and outputs, so Claude bots' calls show with their output. - A history read the daemon cut at its byte limit asks for the rest. - Calls still running when Sonny attaches finish live. - After a reconnect the fleet reads the project's bots again, opening tasks that started meanwhile and marking stopped ones idle. - An Errand listing that runs past three seconds is killed. - A new lead takes the project file's model and effort first. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
A tool_started event carries a 2 KiB preview of a call's arguments, so a truncated one is read from the bot's items. The bot is inspected after the replay is skipped, so a turn that ended meanwhile is not shown as running. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b25f42049f
ℹ️ 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".
…figure A turn that ran before configure moved the bot keeps the model and effort it ran at, in its record and as the cache the next turn takes as held. A keyed creation keeps a fingerprint of the instructions it was sent with, so a resend still matches after they are replaced. Schema 49. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
…t-thread-45hlbm-sonny
…ject-thread-45hlbm-client
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 486db5edcd
ℹ️ 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".
A failed edit, write or read shows its error instead of the change it asked for. A call denied before it started is read from the bot's items and shown as denied. Sonny opened anywhere in a project attaches to the lead working in the project's folder, makes it there when missing, and refuses a same-named lead working elsewhere. Reconnecting pages back to the last node drawn and matches results to calls kept from before. The next page of approvals shows once the first is answered. An unclosed $( and a backslash before a non-ASCII character no longer crash the renderer. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
…-45hlbm-configure
…ject-thread-45hlbm-client
…t-thread-45hlbm-sonny
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be2b516b86
ℹ️ 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".
- Reconnecting reads the bot after the replay, so a turn that ends meanwhile is not lost, and starts the approver again in auto mode. - A turn whose prompt history already drew still counts as running. - Errand handles are read from the matching result, Anthropic too. - `sonny show` finds a dotted project by its lead. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82902672fd
ℹ️ 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".
- A hunk range that doesn't start with - or + is read as line 1 rather than sliced mid-character. - While /status holds the screen, the newest 5,000 transcript lines wait for it and a note says how many earlier ones went by. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 82902672fd
ℹ️ 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.
- A call waiting on the person is written above the status row in full, every line of its command, before y can allow it. - Bots Sonny makes get the default compaction instructions, as the CLI's and the app's do, so long conversations can compact. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c279b7d496
ℹ️ 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".
…, unclosed fences A call listed with cut arguments is shown whole, read from the node that planned it; when that read fails, y is refused and n denies it. Errand runs are keyed by bot and call, since call ids repeat across bots. Transcript lines go into scrollback in chunks a u16 row count holds. A fence or $$ block still open when a reply ends shows as code instead of vanishing. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ab5c60f6b
ℹ️ 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".
# Conflicts: # client/src/policy.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7af68a4166
ℹ️ 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".
| let room = width.saturating_sub(first.width()).max(8); | ||
| let rest = rest.spans; | ||
| let mut rows: Vec<Vec<Span<'static>>> = vec![first.spans]; |
There was a problem hiding this comment.
Account for continuation indentation when wrapping commands
When a long command is displayed for approval in an 80-column pane, draw() calls this wrapper with an empty first prefix and a four-column continuation prefix. However, room remains 80 on subsequent rows: a 200-character token produces rows of widths 80, 84, and 44. Since draw() renders these rows without another wrapping pass, Paragraph clips four characters from the middle row. Even after the complete approval arguments have been recovered, the person can therefore authorize command text that was never displayed. Recompute the available width for continuation rows so their indentation cannot push command characters outside the terminal.
AGENTS.md reference: AGENTS.md:L49-L51
Useful? React with 👍 / 👎.
| /// A Rex target as a person reads it: a label as is, an id by its end. | ||
| fn target(target: &str) -> String { | ||
| match target.split_once(':') { | ||
| Some((_, id)) if id.len() > 8 => format!("…{}", &id[id.len() - 6..]), |
There was a problem hiding this comment.
Shorten Rex targets only at UTF-8 character boundaries
A shell call such as rex capture -b 'block:αβγδz' crashes Sonny while rendering the command, regardless of whether Rex accepts that target. Splitting at the colon leaves a nine-byte suffix, so subtracting six produces byte index 3, inside β; I reproduced the panic by running this function directly. Both live tool rendering and history reconstruction invoke this formatter, so the persisted call also crashes subsequent attachments while it remains in the displayed history. Preserve unrecognized targets literally or select the shortened suffix using character boundaries rather than byte subtraction.
Useful? React with 👍 / 👎.
Third of five stacked PRs. It is based on #145.
What
sonnyis a new crate in the workspace. It is a client of the daemon, like the app, and nothing in the daemon or CLI depends on it.Opened in a folder, Sonny becomes that project's lead: the same
<project>.leadbot the app opens. It shows the lead in a Codex-style TUI. Finished history goes into the terminal's scrollback, replies stream in, each tool call is one• Ran …line, edits show as diffs, and a status row readsWorking (12s • esc to interrupt).Rex. When Rex is found, the project gets its own Rex session. Each task the lead starts gets a window there running Sonny on that task, without taking focus. OSC 7501 status shows which task is working, blocked or done.
Slash commands:
/modelpicks the lead's model from everything its provider family lists, plus the effort (←/→). It usesconfigurefrom Add configure: change a bot's model, effort, instructions and gate #144./approvalssets how calls are approved:auto(the default for a new lead): a judge model decides. Sonny startsagent approverif nothing is serving it.ask: you decide.full: no gate./statusshows the project's agents and its Errand jobs./copycopies the last reply (pbcopy, or OSC 52 over SSH)./openopens the last HTML page./soundturns the chime on or off./quitleaves; the agents keep working.Footer. It follows
configuredevents, so a change made from another client shows up right away.Skills for every agent:
rex-windows: run a long command in a Rex window the person can watch.errand(written only when Errand is installed): run a command on another machine. Those runs are drawn asRan CMD on PEER, and each detached job opens a Rex window that follows it.Pipes. A piped command now shows its whole pipeline, plus a preview of the raw output.
Settings live in
~/.agent/sonny/settings.json.sonny/demo/has a scripted model and folder for trying Sonny without an API key.Pictures (SVG, Mermaid, math and HTML drawn in the terminal) are left out of this PR and come in the next one. Here, those show as text.
Screenshots
These were recorded in tmux against the demo model. The session runs
/approvals→full,/model→gpt-6-miniat medium effort, a prompt the lead hands to a task, and then/status:/approvalsand/model:The lead hands the work off, and the footer shows the new model and effort:
The task's own view (what its Rex window shows):
/status:Tests
cargo test -p sonny: 35 pass. They cover the model picker, approval modes, Errand call drawing,errand psparsing, the status card, pipes, and the transcript.cargo clippy --workspace --all-targets -D warnings: clean.autogate, and the approver serves it;/approvals→asksets a manual gate;configureupdates the footer.Not tested here: Errand's Rex windows and Rex itself, since neither is in the container. Earlier versions of the Rex layout ran on George's Mac.
Stack
configure