Skip to content

Sonny: /new makes any agent; every list narrows as typed - #626

Merged
lydakis merged 26 commits into
mainfrom
claude/project-thread-7nasaw
Nov 1, 2026
Merged

lydakis merged 26 commits into
mainfrom
claude/project-thread-7nasaw

Conversation

@lydakis

@lydakis lydakis commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

This follows #604. /lead is gone, and /switch no longer has a "new lead" row. One command, /new, now makes agents. Every list over the composer can also be narrowed by typing.

/new [NAME]

/new: the profiles, where a reviewer works, narrowed by typing rev, then its first message

/new asks three things in turn:

  1. Profile. It lists every profile file, the folder's, the person's and the builtins. A lead's roles come first, and the project's own role is marked •. Custom profiles such as reviewer and researcher are included. client/src/policy.rs gains profiles(), which lists the client roles that the Profiles index still hides.
  2. Where it works. This step is for workers only. The choices are a worktree, this folder, or an empty folder. If the project's threads_in is "project", only "this folder" is offered.
  3. First message. Sending it starts the agent, and the agent is named from it unless NAME was given.

Esc goes back a step, and nothing is made before the message is sent.

A lead stays in this folder, in the profile picked. Its profile is noted the way a task's is, and project::role reads it. Any other agent becomes this lead's task. Either way, the window becomes the new agent. A lead's first message is sent by its own window, through the unlisted --send flag on the exec.

Making the task the lead's: agent run --new --created-by BOT

A task started from a Sonny window has to be the lead's, but its first message is the person's words. Before this change, only an agent's shell could say who made a bot, through AGENT_BOT and AGENT_BOT_ID, and that also makes the prompt the agent's. AGENT_TURN is required to say which agent turn wrote it.

--created-by already exists as a filter on ls. On run --new, it now names the maker. The CLI inspects that bot for its id and sends created_by and created_by_id in create, with no author on the prompt. The daemon is unchanged, since it already accepts a creator from plain clients.

These cases are refused:

  • --created-by without --new, or with --fork.
  • Naming another bot from inside an agent's shell, where a bot is only ever made by that agent.

Sonny's task start drops AGENT_BOT, AGENT_BOT_ID and AGENT_TURN when it passes the flag. The flag is documented in docs/CLI.md, and there is a CLI test.

Every list narrows as you type

list::Picker is one shared picker. It keeps a list's rows, what is typed and the pick, and it handles arrows, typing, paste, Enter and Esc in one place. It matches on name or on what a row is. Letters are marked only when the name matched.

These lists all use it: /switch, /new's two lists, /react, /approvals, /permissions and its choices, /fast, /retry and /reply. An agent's question keeps its options as they are, because their order is its recommendation.

/switch listing every agent, then narrowed by typing fix

Found while running it on a real daemon

  • A failed /new said nothing. The error went to the status line, which shows the running turn instead whenever the lead is busy. The error now replaces the heading over the kept message, in red.
  • A task's window welcomed it as "This folder's lead". It now reads "A task of this folder's lead. Steer it here:".

Checks

  • cargo fmt --check, cargo clippy -D warnings and cargo test --workspace pass.
  • tests.test_cli and tests.test_acp pass. /lead NAME became /switch NAME in test_acp.
  • Real daemon, worker: /new → reviewer → worktree → "Review the rounding fix in tally.py" made tally.review-the-rounding-fix with created_by: tally.lead, in its own worktree, in the reviewer profile. The window became it.
  • Real daemon, lead: /new → lead → "Plan the 1.0 release notes" made tally.lead.plan-the-1-0. The window became it and sent the message.
  • The design pass checked the visual and interface systems. The heading over the composer is set in under the prompt's mark, as an answer's question is. Keys stay on the list's foot. sonny/FEATURES.md and sonny/README.md are updated.

The pane / filter is not in this PR. It follows the sidebar PR, so the panes change once.

claude added 12 commits November 1, 2026 08:34
…ast typed

/switch alone (and /lead alone) opens one list of every agent over the
composer, found by typing with the shared matcher: the folder's leads
first, then the project's agents, then other projects' leads, then the
rest; the agent beside the conversation is picked to start, and a last
row makes a new lead. /switch NAME still opens an agent at once, and a
name found in none lists what it narrows to.

Each of a project's Sonny windows now notes where it is (none for a bare
terminal) and when the person last used it. An agent's show_agent and
run_in_pane, and the lead's new task tabs, follow the open window used
last, as tmux picks the most recent client, so a Sonny in Ghostty no
longer opens agents in another terminal's Rex session.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8kk4PkzKWAc5neW8
…ad's tabs opening there

Codex review on #604: a worker window marking itself made the lead's
window not the latest, so later task tabs stopped opening even in the
same home; and a worker borrowed whichever home was typed in last.
A lead now opens task tabs while the window used last is in its own
home, and an agent's window takes its home once, when it starts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8kk4PkzKWAc5neW8
Codex review on #604: /switch execs the other agent's Sonny in the same
process, so the old project kept counting the window as open. Before
exec its entry is kept as a closed window's (pid 0), its place kept.

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

Codex review on #604: a task's window that replaced its lead's (the only
open one) could not learn its home, so it never marked; it now gets the
place it replaced in the same terminal (--window-place, unlisted). And a
quick return from another window was lost to the once-a-second throttle:
only typing is throttled now; Enter, clicks, pastes and focus mark at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8kk4PkzKWAc5neW8
Codex review on #604: a window opened by show_agent with every Sonny
closed could not learn its home. Every window Sonny opens in a layout
(show_agent, the lead's task tabs, /switch) now gets --window-place; a
window opened by hand falls back to the newest home known, open or closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8kk4PkzKWAc5neW8
The test wrote another sky's haiku while the read started at Ready could
still be on its way; on a slow runner that older read landed last and
the haiku was never seen. It now lets that read land first.

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

# Conflicts:
#	sonny/FEATURES.md
#	sonny/src/main.rs
George (on #604): talking to one agent in Ghostty and another in Rex at
once, each should act where it is spoken to. The places record was one
most-recent window per project; it now notes the agent each window shows,
and an agent's show_agent/run_in_pane, and a lead's task tabs, go by the
window used last of those showing that agent, a task's by its maker's,
then the project's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8kk4PkzKWAc5neW8
/lead is gone, and /switch no longer has a "new lead" row. `/new [NAME]`
asks three things:
- the profile: every profile file, a lead's roles first, the project's
  own marked;
- where a worker works: a worktree, this folder, or an empty folder;
- its first message, which starts it and names it.
Esc goes back a step, and nothing is made before the message is sent.

A lead stays in this folder in the profile picked. Any other agent is
this lead's task, and the window becomes the new agent. A send that
starts nothing says why over the kept message, where a busy lead's
status line would hide it. A task's window no longer welcomes it as
the folder's lead.

The task is the lead's through a new `agent run --new --created-by BOT`.
It sends the maker's id in create, so the task is the lead's while its
first message stays the person's. The daemon is unchanged. Inside an
agent's shell, a bot is made only by that agent.

Every list over the composer narrows as you type, through one shared
picker (list::Picker). An agent's question keeps its options as they
are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8kk4PkzKWAc5neW8
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 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-11-01T22:15:03.461805Z 7b11387 New commits
🔒 Security Review ✅ Completed 2026-11-01T18:59:53.429048Z 23a6be6 PR opened
ℹ️ 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.

@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: 23a6be6d75

ℹ️ 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/src/main.rs Resolved
Comment thread sonny/src/main.rs Resolved
Comment thread sonny/src/task.rs Resolved
Comment thread sonny/src/main.rs Resolved
Comment thread sonny/src/main.rs Resolved
Each change answers a Codex review finding on #626.

- A /new task inherits the lead's model and effort, unless the project
  names the tasks' own, as a task the lead starts from its shell does.
- The lead's mode is read from this window's daemon, not the default
  one, so the task's sandbox and approvals follow the lead.
- While the new agent's first message is written, y, n and a are
  letters, not answers to the old lead's approval.
- A new lead's first message reaches it as a message. It is never run
  as a command or a shell line.
- A picture in the first message is refused with the reason. Nothing
  is made and the message is kept: neither start carries a picture.

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

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

ℹ️ 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/src/main.rs Resolved
Comment thread sonny/src/new.rs Resolved
Each change answers a Codex review finding on #626.

- A task's profile is read from the lead's folder as it is now. Before,
  a worktree's copy as of its last commit was read, so a profile not yet
  committed was not found, and an edited one ran as committed.
- A profile is a lead's when the role it resolves to builds on `lead`.
  The new `policy::lineage` follows the same layers a bot's role does,
  so a folder's superlead.md extending the shipped one is a lead's.
  `policy::profiles` no longer returns what each file extends.

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

@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: 0b5415fc2e

ℹ️ 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/src/main.rs Resolved
Comment thread sonny/src/main.rs Resolved
Each change answers a Codex review finding on #626.

- /new passes the profile picked even when it is what every task runs
  as, so its model and tools apply. Its words are still told once.
- When a change of view clears the replies, the /react or /reply list
  closes with them. Before, the next draw indexed an empty list and
  Sonny crashed. The draw also skips a row it cannot find.

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

@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: 86466c0afc

ℹ️ 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/src/main.rs Resolved
This answers a Codex review finding on #626. While /react or /reply was
open, a reply coming or going (the oldest leaves past nine) shifted
every index. A row then matched one reply's words but showed and picked
another. The list now holds the replies as they were when it opened.

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

@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: 796249bddd

ℹ️ 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/src/main.rs Resolved
This answers a Codex review finding on #626, the same as /react's. The
list now holds the denials as they were when it opened. An approved
retry leaves the live list by its call id, not by its row.

The other lists already hold their own rows: /switch, /new, and the
/fast and /permissions choices.

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

@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: 48e12b9ef7

ℹ️ 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/src/main.rs Resolved
Comment thread sonny/src/switch.rs Resolved
Comment thread sonny/src/main.rs Resolved
Each change answers a Codex review finding on #626.

- While a new agent's first message is written, a leading / is
  offered no command, so Enter sends the words as typed.
- A new lead's first message reaches its window through a file of the
  person's own (mode 600) beside the store. The window reads the file,
  removes it and sends the message. Before, the message was one exec
  argument, and Linux refuses an argument of 128 KB or more. The file
  is written before the lead is made, so a failed write makes nothing.
- A list that ranks a taken row higher keeps that row picked. Before,
  /switch could open the agent ranked above the one picked.

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

@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: 2cd391e6de

ℹ️ 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/src/main.rs Resolved
Comment thread sonny/src/main.rs Resolved

lydakis commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

The runtime job failed on the superseded head 2cd391e. The failing test is tests.test_answered.AnsweredToolTests.test_a_slow_answer_parks_the_turn_and_its_error_is_the_result, with (active_turns, waiting_turns) = (1, 1) instead of (0, 1). This is the known flake #518: the test reads stats before the parked turn has left the active slot.

This PR doesn't change the daemon's parking or answered tools. Its only daemon-side change is the agent run --created-by flag in the CLI. I can't re-run jobs from here. CI for the current head, 3ff77ff, has its own run, and I'm watching it.


Generated by Claude Code

While any sandboxed command runs, bubblewrap holds an empty placeholder
/tmp/.git, so a test folder under /tmp could read as a git checkout and
offer a worktree. The /new test now works in a checkout of its own, and
the place choices are decided from whether the folder is in git.

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

@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: 938b00cac1

ℹ️ 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/src/main.rs Resolved
This answers a Codex review finding on #626. Linux refuses one argument
of 128 KiB or more, so a long pasted first message made no worker. Every
task start now passes the brief to `agent run` on stdin (`-- -`), which
joins its words the same way.

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

@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: 8b1f201d1b

ℹ️ 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/src/main.rs Resolved
This answers a Codex review finding on #626. A profile noted for a lead
that was since removed stayed beside the store under its name, so a new
lead of that name made in the project's own role ran as the old one's.
Making a lead in the project's role, or starting a task with no profile
of its own, now forgets any such note.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8kk4PkzKWAc5neW8
@lydakis
lydakis merged commit ebc7890 into main Nov 1, 2026
10 checks passed
@lydakis
lydakis deleted the claude/project-thread-7nasaw branch November 1, 2026 22:44
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