Skip to content

Declared tools pass down a count of generations; Sonny's start goes as deep as task_depth - #504

Merged
lydakis merged 3 commits into
mainfrom
claude/project-thread-0ttt4p
Oct 31, 2026
Merged

lydakis merged 3 commits into
mainfrom
claude/project-thread-0ttt4p

Conversation

@lydakis

@lydakis lydakis commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Why

#490 left a known gap. A declared tool's inherit could only be yes or no, so Sonny could say "pass start_task on" or "don't", and nothing in between. A task's tools were only corrected when its window opened or the tool host refreshed it. That meant a helper started in the task's very first turn could inherit a start_task that then refused at call time. George agreed to the daemon fix on 10-31 at 05:56Z: let inherit count generations.

What

Daemon (protocol 29, no schema change):

  • inherit on a declared tool is true (the default, still left out on the wire), false, or a whole number of generations.
  • Each bot that gets created takes the tool with one generation fewer. A 2 reaches its children as 1, their children as false, and stops there. It works like a packet's TTL hop count, and the daemon still knows nothing about leads or depth.
  • A fork is a copy, not a new generation, so it keeps its source's count.
  • Both paths that hand a creator's tools to a new bot count down: the store's creator_declared, and the sandboxed-creator path in capped.
  • On a sandboxed bot's own socket, a declared tool that a client answers must also stay within the caller's remaining allowance. For example, a bot holding run with one generation left can't give its child run for two generations, or for good.
  • The tools a bot takes from its creator are counted one generation down before that check, so a bot's own tool isn't measured against itself.
  • On the Rust side the type is tools::Inherit { All, Generations(u32) }, with within(bound) for the check above. Its serde form is a bool or a count, and anything else is refused.
  • The new wire form is documented in docs/RUST_PROTOTYPE.md.

Sonny:

  • Role.passes is now the number of generations below an agent that can start tasks, or None for no end.
  • start_task and remove_task are declared with that count. With task_depth = 2, a lead declares inherit: 1, its tasks get false, and their helpers get nothing, from the first turn on. With task_depth = 3, the lead declares 2. With task_depth = 0, inherit is left out.
  • When Sonny later re-declares a task's tools, the count matches what the daemon already handed it, so opening a window doesn't reconfigure the task.
  • The task prompt now says LEAD is the agent that started you: either a lead of the folder, or a task that has a lead of its own. It no longer calls every starter "a lead".
  • FEATURES.md and README are updated.

Protocol number

This takes protocol 29, because #498 takes 28 and merges first.

Tests

  • A new store contract test, a_tool_declared_for_some_generations_goes_that_far_down_and_no_further, covers three things:
    • a count of 2 goes to 1, then false (on the wire too), then nothing;
    • a fork keeps the count;
    • true, false, 0 and 3 parse, while -1 and "all" are refused.
  • The sandbox runtime test (test_a_sandboxed_bot_uses_the_daemon_as_itself_and_no_further) now gives Bob run for 2 generations. A child that declares run for 1 is created. Children that declare it for 2, or with no end, are refused with not_permitted. I checked that this test fails without the capped change.
  • Sonny's role test covers the counts at depths 1, 2 and 3, and with no end.
  • cargo test --workspace passes, tests/test_approvals.py passes with bubblewrap, and clippy (-D warnings) and fmt are clean.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-31T07:05:43.607607Z 95a055d New commits
🔒 Security Review ✅ Completed 2026-10-31T07:07:05.750145Z 95a055d New commits
ℹ️ 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.

@lydakis
lydakis force-pushed the claude/project-thread-0ttt4p branch from a5fe1ec to b8d0e1b Compare October 31, 2026 06:42
…s deep as task_depth

A declared tool's inherit may be a count as well as true or false: each
bot created takes the tool one generation fewer, false the last, as a
packet's hop count runs down. A fork is a copy and keeps its source's
count. Protocol 28.

Sonny declares start_task and remove_task with the generations task_depth
leaves below each agent, so a task's helpers have the right tools from
their first turn instead of until Sonny next declares them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
On a sandboxed bot's own socket, a declared tool a client answers now
also needs its inherit within the caller's remaining allowance: a bot
holding `run` for one more generation can't hand its child `run` for
two, or for good. The tools a bot takes from its creator are counted a
generation down before that check, so a bot's own tool isn't measured
against itself.

The task prompt calls LEAD the agent that started you, which is a lead
of the folder or a task that has a lead of its own. Protocol moves to
29, since 28 goes to the PR merging first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
@lydakis
lydakis force-pushed the claude/project-thread-0ttt4p branch from b8d0e1b to d206571 Compare October 31, 2026 07:00

@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: d206571ff6

ℹ️ 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/agents/task.md Resolved
@lydakis
lydakis merged commit 4e32c7a into main Oct 31, 2026
5 checks passed
lydakis added a commit that referenced this pull request Oct 31, 2026
* Sandbox: Unix sockets reached only in the bot's folders and those named

A program listening on a Unix socket runs what it is asked outside the
sandbox, as a browser's daemon launches a browser or Docker runs a
container. As Claude Code's sandbox blocks them by default, Seatbelt now
lets a workspace-write bot's commands reach only the sockets in its own
and writable folders, and those its new unix_sockets setting names; a
read-only bot's only those named. Sonny's permission rows take
unix_sockets too. Linux still reaches every socket it can see; that
follows.

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

* Sandbox: a bot's sockets bounded in its create reply and resolved where they exist

A create reply's bound now covers its unix_sockets, which take at most
32 KiB as JSON as writable folders do. A socket not made yet is stored
with what of its path exists resolved, so a link above it, as macOS's
/tmp is, still matches Seatbelt's real path; Sonny's rows resolve them
the same way.

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

* Protocol 30: #504 took 29

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

* One resolver for a sandbox's paths, shared by the daemon and its clients

The daemon's real-path resolver, which follows a dangling link to its
target, moves to agent-client, so Sonny reads a row's sockets back
exactly as the daemon stored them.

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

* Sandbox: only the sockets a bot names, not those in its own folders

A hard link in a bot's folder to any socket, the daemon's among them,
needs no right to the socket and would reach it by a name there. So, as
Claude Code's sandbox and Codex's managed network do, a sandboxed bot's
commands reach only the Unix sockets its unix_sockets names. A macOS test
connects from inside Seatbelt to the daemon's socket in the workspace,
another there, one outside, one named and one in a named folder.

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

* Tests: the sandbox helpers build on macOS too

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

---------

Co-authored-by: Claude <[email protected]>
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