Repository navigation
Sonny: every agent starts tasks, as deep as task_depth allows - #490
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ 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: 858b171f01
ℹ️ 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 Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1f4844601
ℹ️ 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".
d1f4844 to
9e94e80
Compare
start_task and remove_task are no longer a lead's alone. Any agent with room below it in its lead's line has them, for help inside its own brief (a review, research, a watch on something); separate work still goes to its lead. `[sonny] task_depth` (in /config) bounds how many generations of tasks a line has: 2 by default, so a lead's tasks start helpers that start none; 1 is the old behaviour; 0 has no end. - served::Role (lead, starts, passes) replaces the lead flag; a tool an agent keeps to itself is declared with inherit false, so a lead's tasks take start_task from their first turn and their helpers do not. - A task's helper starts from its lead's folder, in its project and repository (setup script and build-folder clones stay the lead's), on the last commit of the task's branch. A start past the depth is refused (task_depth_reached); a task removes only its own line. - The lookout's refresh and a window's open work out each agent's depth from created_by; new_project, not start_task, marks a lead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
A task started with `folder` works in a repository inside the lead's folder, so its branch is there, not in the lead's. Its helper now takes that repository by default and starts on the task's branch in it; the base branch is looked up in whatever repository the helper is made of. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
…s without a folder inferred A path in the brief to the starting task's worktree now names the helper's worktree, as a fork's brief names its own. A task in a repository inside its lead's folder that forks itself or another task no longer gets its repository inferred as a folder, which a fork refuses. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
e76393d to
eeb2b91
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eeb2b91a98
ℹ️ 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".
… its branch, ownership by id A helper on its task's branch starts with files a task wrote, so, as a fork, it gets neither the lead's setup, which runs outside any sandbox, nor clones of the lead's build folders, which links there could lead out of its worktree. A side chat of a task starts its helpers on the task's branch. remove_task follows who made whom by id, so a task that took a removed one's name owns nothing that one made. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0e9df6ebb
ℹ️ 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 side chat is gone soon, and a helper it started would hang off it, out of its task's sight and its lead's. The task starts its own; a lead's side chat starts tasks as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a027004944
ℹ️ 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".
Removing a finished task left its helpers a generation shallower, with room to start more. A walk that cannot reach its maker, or finds another bot under its name, now counts the line as deep as task_depth lets it go, so it starts none; with no end to lines nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGE8xLJp2WvDkgJJ9p7
Why
George asked whether the lead/task split was too rigid: workers take roles such as a reviewer, a researcher or a watcher on a PR. The audit (doc) found exactly one capability gate.
start_task,remove_taskandnew_projectwere declared on leads only, so a task that wanted a helper could only ask its lead or fall back to rawrun --new, with no worktree, setup or tab. Everything else, including profiles as roles, peer messaging, subscriptions and lineage-based approvals and sandboxes, was already loose.George picked a depth bound over a cap on running agents. The risk he wants guarded is infinite downward delegation, not concurrency. He also asked for the bound to be configurable, with an option for no end.
What
[sonny] task_depth(in/config) sets how many generations of tasks a lead's line has. The default is 2: a lead's tasks start helpers, and those helpers start none. 1 keeps today's behaviour, and 0 means no end. Depth counts up to the nearest lead, so a lead that another lead made starts fresh.served::Role { lead, starts, passes }replaces thelead: bool.start_taskandremove_task.inherit: false. A lead's tasks therefore takestart_taskfrom their first turn, and their helpers don't take it at all.new_projectstays a lead's alone.taskssubscription already covers every bot in its line, so the lead hears helpers too.task_depth_reached.remove_taskreaches only agents in its own line. The line is followed by ids, so an agent that reuses a name owns nothing.created_by. A side chat counts as its agent.sonny toolwalks the line with the CLI.new_project, notstart_task, now marks a lead inrefresh.start_task's description gives the rule: any agent other than a lead starts one only for help inside its own brief, and asks its lead for a task for separate work.No daemon change.
Known gap
When the depth is 2, a task's declaration is corrected to
inherit: falseonly once its window opens or the tool host refreshes it. A helper it starts during its very first turn can therefore inherit astart_taskthat refuses at call time. When the helper's window opens, the tool is taken away again. Closing the gap fully needs inheritance bounded by generations in the daemon (inherit: N), which I'd discuss before building.Tests
cargo test -p sonny -p agent-clientpasses: 660 unit tests and 24 task end-to-end tests.task_depth = 0, it starts a task.cargo fmt --checkand clippy are clean.