Repository navigation
Sonny: the six agent-only commands become tools the lookout answers - #268
Conversation
A tool declared with `answered_by: TAG` takes no fixed result. A call that
fits its parameters waits for the answer of whichever client serves that
tag. The client finds it by following the bot (`tool_started` carries
`answered_by` and `expires_ms`) or with `tool_calls {tag}`, and answers with
`tool_result {output | error{code,detail}}`. The turn holds live for up to
250 ms, then parks like `wait` and survives restart. A call nobody answers by
`expire_ms` (default 60 s) ends as a typed `tool_unserved` result, and the
turn goes on.
Gates may now name declared tools, so a client's tool can need approval
before it is asked. Protocol 20, schema 55 (`answers` table).
The approval_overhead bench gains declared, answered and answered_parked
arms. Measurements are in DAEMON_MEASUREMENTS.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
…r gate, gate what configure declares, refuse late answers Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
# Conflicts: # docs/RUST_PROTOTYPE.md # src/tools.rs # tests/store_contract.rs
…eads one The history tool takes an optional `bot`. With a bot and no turn, it lists that agent's newest 20 turns, newest first: each one's number along its lineage, its handle, its status and the start of its prompt. With a turn, it reads that turn as it stands, a running one included, paged as before. A bot's own turns are still read by number only. Agents no longer have to read the store to see what a sibling is doing. Sonny's task rule names the tool and says to message another agent only when work depends on it. The lead's rule says tasks can read each other. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
`sonny task start`, `sonny task rm`, `sonny show`, `sonny run`, `sonny lookout ls/add/rm` and `sonny project add` were only ever called by agents, so they become answered declared tools (tag `sonny`): start_task, remove_task, show_agent, run_in_pane, subscriptions and new_project. The lookout answers them, each in a `sonny tool NAME` child run in the caller's folder with its environment, and their CLI forms are gone. - Leads get start_task, remove_task, new_project and subscriptions (`inherit: false`); every agent gets show_agent and run_in_pane. - remove_task and run_in_pane are gated like the shell calls they replace. - Errors are typed codes (task_not_started, not_shown, ...). - A lookout another Sonny build started gives way, so upgraded tools are answered; a subscriptions call is read at once. - The clean view says what each call did. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
…-qzgtqy # Conflicts: # docs/LOOKOUT.md # sonny/README.md # sonny/agents/lead.md # sonny/src/lookout/mod.rs
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (3)
ℹ️ 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: b1c7bef65c
ℹ️ 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".
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: b1c7bef65c
ℹ️ 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.
…un in the turn's folder - A window that adds Sonny's tools to a bot gated auto or ask gates the new ones too, so remove_task and run_in_pane never run unjudged there. - A call's process runs in a group of its own; when its turn ends (the person interrupting a slow setup) or its time runs out, the group is killed, so no task starts after all. - A call runs with its turn's workspace, model and effort, not the bot's current ones. - A setup script's output is no longer kept: only the last 20 lines of its errors, read as it runs. - Every Sonny window starts the lookout, a lead or not, since every agent has show_agent and run_in_pane. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
… keys start_task runs the folder's .agents/setup outside any sandbox, and new_project makes a lead, so both now wait for a verdict wherever the agent's other calls do, as the shell calls they replace did. The setup script also runs without the provider keys the lookout holds (the well-known ones and what ~/.agent/env sets), as a bot's shell runs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
|
@codex review Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e7a3374fb
ℹ️ 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".
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: 8e7a3374fb
ℹ️ 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.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
A subscription sends other bots' words to the subscriber's judge, and `sonny lookout add` went through the gated shell before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
|
@codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
start_task now takes its defaults from #251's with_defaults (the project's threads_model/threads_effort, then [sonny] task_effort, then the lead's), new_project takes [sonny] lead_effort, and threads_effort may come without threads_model. /background removes subscriptions with subs::remove, which the subscriptions tool shares. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5bbc26806
ℹ️ 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".
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: e5bbc26806
ℹ️ 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.
Another build's lookout takes over with SIGTERM and serves the pending calls again, so a setup the old one left running would share the task's folder with the new one's. The lookout now kills its served process groups on SIGTERM before it exits. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
configure sets one gate, so Sonny cannot add its gated tools to another client's tag or to several gates. Such a bot is declared show_agent and Sonny's own tools only, and gets the rest, gated, with the mode the person picks in /approvals. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
#271) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
George asked what a CLI buys us when only an agent calls it. The rule he picked: when an agent talks to Sonny, it uses a tool; a command exists only for callers that aren't Sonny agents. #248 added answered declared tools to the daemon, and #256 let tasks read their siblings' history. This PR is the last step: it moves Sonny's six agent-only commands to tools and deletes the command forms.
What changes
sonny task startstart_task {name, brief, profile?, setup?, model?, effort?}sonny task rmremove_task {task, discard?}~/.agent/project addnew_project {folder, model?, effort?, threads_model?, threads_effort?, threads_in?}sonny lookout ls/add/rmsubscriptions {add?, remove?}(empty lists them)sonny showshow_agent {agent, split?, beside?}sonny runrun_in_pane {name, command, cwd?, split?}answered_by: "sonny". The lead-only tools carryinherit: false.sonny tool NAMEwith the calling turn's own context: its folder, model and effort. It runs in a process group of its own. That group is killed if the call runs out of time, if its turn ends (the person interrupting a slow setup, say), or if the lookout gives way to another build.task_not_started,not_shownorsubscription_refused. If nobody answers in time, it ends astool_unserved.show_agentwaits for a verdict wherever the agent's other calls do (/approvals):.agents/setupruns without any provider keys: the well-known ones, AWS/Bedrock credentials, the key anyAGENT_PROVIDERspec names, and everything~/.agent/envsets.start_tasktakes the project'sthreads_model/threads_effort, then[sonny] task_effort, then the lead's own.new_projecttakes[sonny] lead_effort.STORE.lookout.sonny. A Sonny that finds another build's lookout stops it and takes over.subscriptionscall./background(Sonny: /background lists triggers and lookout subscriptions, with a ↻ count per agent #267) removes subscriptions through the same code.sonny task startandrm,sonny show,sonny run,sonny lookout ls/add/rmandsonny project;~/.agent/projectrunner;SONNY_BINsubstitution in the pane skills.lead.md, the skills,sonny/README.mdanddocs/LOOKOUT.mdnow name the tools.The screenshot is from a live run: a real daemon, a scripted Responses model, and the lead's Sonny in tmux in
askmode.Testing
tests/test_served.py(new, runtime, 7 tests):tests/test_lookout.py: the non-lead subscriber test subscribes through the tool.sonny/tests/task.rs(12): drivessonny tool start_taskandsonny tool remove_task, and checks that setup sees no provider keys.cargo test -p sonny(277 unit tests plus 12 integration);-D warningsandcargo fmt --check;AGENT_TEST_RUNTIME=1ontest_served,test_lookoutandtest_answered(24 tests).🤖 Generated with Claude Code