Repository navigation
Each lead gets a writable state folder, named in its shell as $SONNY_STATE (J2) - #771
Conversation
Sonny makes ~/.local/state/sonny/agents/LEAD (under $XDG_STATE_HOME when set) for each lead, mode 700, and adds it to the folders every sandboxed row writes, beside the zen folder: the lead's own sandbox, its tasks', and agents a --start automation makes for it. A bot keeps the state folder it was made with; one made before takes its maker's, or its own, when its row is set again. ~/.agents stays read-only, as Codex keeps .agents. The roles, the automation and config skills and the README say jobs and monitors keep their files there. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
… state folder The daemon takes an env setting on create and configure: variables a bot's commands get beside the daemon's environment, as Codex's shell_environment_policy.set. A bot made by another always goes by its creator's, and a change reaches the bots it made, as command rules do, so no sandboxed bot plants PATH or LD_PRELOAD for a command approved to leave its sandbox. AGENT_ names stay the daemon's; 16 KiB at most. Sonny sets SONNY_STATE to the lead's state folder on every lead it makes or opens, in every permissions row, and tasks take it from their lead. The FEATURES.md row moves to the release PR's list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
… fit their budgets The lead role names $SONNY_STATE in one short line within its budget; the task role is unchanged, its budget being full, and the automation skill tells a task that sets up a monitor where its files go. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
Codex Review Summary: ✅ CompletedThis 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: 0382fab30f
ℹ️ 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: 0382fab30f
ℹ️ 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.
… maker's state folder as the maker has it; protocol 53 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abc1586f99
ℹ️ 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".
…e bots Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c40eb7333
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGNwXWgNygYbrrZ9DK
…w takes one #776 and #771 each built on their own; together the deadline cleanup in asks.rs called trigger::tool with one argument. Same line as #785. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGYoqceB21grsa5Q3v
…ons where the call lands (#782) * Remove goals: the goal tool, /goal, and the lookout's check runner George never used goals, and their check runner made the lookout run work (a command for up to an hour, then another turn for the agent) rather than only watch and tell. Gone with them: the `checking` and `checked` task states, the lookout's hold on a goal's turns, the sky's goal pulse, and the tool process budget's quarter for checks, so the tool host now has all of `sonny.tool_processes`. A one-time migration removes STORE.lookout/goals (retires 0.11.0). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGYoqceB21grsa5Q3v * Keep a lead's reaction in a task where its react call lands A lead reacting in one of its tasks named the task, and the lookout followed every bot's newest message to find which of the person's words it landed on, then wrote the task's Picked file. That is work only the window needs, done by the companion that exists for agents while no window is open. Sonny's tool host now answers `react`: one naming another agent of the same project is kept under the person's newest message there as the call is answered; one on the caller's own messages is answered at once. The lookout drops its reaction tracking, and nothing watches the stream for reactions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGYoqceB21grsa5Q3v * Answer react in the tool host itself, and drop retired Sonny tools on refresh The tool host answered react by spawning a `sonny tool` process like any other served call, behind the process budget. Now it answers it in its own process, as it takes the call: a reaction on the caller's own messages is "Done." with no process, one naming a task lands on what the person had written when it was taken, and those that write the task's file take turns, so two never overwrite each other. A bot made before goals were removed kept `goal` declared through every refresh, since only this build's tool names counted as Sonny's. A declared tool Sonny answers (`answered_by: sonny`) now counts as Sonny's too, so a refresh drops one this build no longer has. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGYoqceB21grsa5Q3v * Pass the ask deadline's trigger removal a caller, as trigger::tool now takes one #776 and #771 each built on their own; together the deadline cleanup in asks.rs called trigger::tool with one argument. Same line as #785. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGYoqceB21grsa5Q3v --------- Co-authored-by: Claude <[email protected]>
… each stands (#787) * Questions: close_ask's deadline removal passes the caller trigger::tool now takes #776 and #771 merged in turn: #771 gave trigger::tool a caller, and #776's close_ask still called it without one, so main did not build. Removal ignores the caller, as the deadline's creation does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDJX2fS3npzLRY9L4Q * sonny ask list: the questions a lead's agents asked lately and where each stands The ask description points agents at it before asking; the sentence on what to do meanwhile moves out, since every ask result already says it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDJX2fS3npzLRY9L4Q * sonny ask list: --all goes on as --all, a yes says what it covers, a node's questions stay together, a fork leaves its source's question to it Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDJX2fS3npzLRY9L4Q --------- Co-authored-by: Claude <[email protected]>
George OK'd the daemon part (the
envsetting). It takes protocol 53, after #774's 52.Why
Monitors and trackers kept their files under
~/.agents. Auto keeps.agentsread-only, as Codex does, so these jobs failed in Auto within minutes (J2). George decided to keep.agentsread-only and give each agent a writable XDG state folder instead, with its path passed in an environment variable. Claude Code does the same for plugins: each gets a data folder named byCLAUDE_PLUGIN_DATA. Codex has no per-agent folder, onlyshell_environment_policy.set.What changes
Sonny (
sonny/src/state.rs)~/.local/state/sonny/agents/LEAD, or the same path under$XDG_STATE_HOMEwhen that is an absolute path. Sonny creates it with mode 700.approvals::sandbox(mode, workspace, state)). That covers the lead's own sandbox, its tasks' (start_task), and agents a--startautomation makes, which take the state folder of the agent that added the automation./permissionsrow matching ignores the state folder, the same way it ignores the zen folder.Sandboxes). Only the state folder is added per agent.Daemon (protocol 53)
envsetting oncreateandconfigure: variables a bot's commands get beside the daemon's environment, like Codex'sshell_environment_policy.set.env, and a change reaches the bots it made, exactly as commandrulesdo. This stops a sandboxed bot from plantingPATHorLD_PRELOADfor a command that was approved to leave its sandbox. The kin update returns each bot once, so it stays linear.AGENT_*names are refused, along with names a shell can't set and values containing NUL. The limit is 16 KiB of JSON.docs/RUST_PROTOTYPE.mdsettings table.SONNY_STATEon every lead it makes or opens, in every row, Full access included. Tasks take it from their lead.Where the agent-facing text changed
sonny/agents/lead.md, monitor sentence. Before: "do not check it in your own turns: read the automation skill listed under Skills and give it a monitor, its own agent." After: "give it a monitor, its own agent, as the automation skill says, not your own turns. Keep files that outlive a task in "$SONNY_STATE"." This keeps the role within its byte budget."$SONNY_STATE"/jobs/NAME. Anifgate doesn't getSONNY_STATE, so the gate uses the whole path.~/.agentsstays read-only.sonny/agents/task.mdis unchanged because its budget is full.Security
Codex's security review flagged that an automation
ifgate such ascd FOLDER && ! ./quietruns a script agents can rewrite, unsandboxed, as the person. That gap is already on main, because the monitor's own folder heldquietbefore this PR; this PR adds the lead's other tasks to the agents that can write it. George chose a follow-up PR that runs gates and goal checks sandboxed. It is on the 0.9.0 must-land list.Performance
docs/DAEMON_MEASUREMENTS.md: store work per turn is unchanged and the gate passed.Tests
state::tests;approvals::tests::a_lead_and_its_tasks_write_the_lead_s_state_folder; store contracta_bot_s_variables_are_its_creator_s(inheritance, kin propagation, refusals);every_setting_is_named.sonny/tests/task.rs: a task writes its lead's state folder. Lab shells dropXDG_STATE_HOME.test_cli(includingtest_a_bot_s_variables_reach_its_shell_and_the_bots_it_makes) passes locally;test_served's state-folder expectation runs in CI with bubblewrap.cargo fmt --check,cargo clippy -D warningsandcargo test --workspaceall pass.Upgrade notes
SONNY_STATEthe next time Sonny opens it or ACP sets it up. Its tasks get them when their row is set again or the lead'senvchanges.~/.agentsthat agents need to write, such as a monitor's folder, moves to the lead's state folder by hand. Update the automation's message and itsifpath to match.FEATURES.md row: goes in the 0.9.0 release PR through
wave2-audit/features-rows.md.🤖 Generated with Claude Code