Skip to content

Sonny: sonny acp for T3 Code, and cmux's Automation mode in the cmux skill - #323

Merged
lydakis merged 11 commits into
mainfrom
claude/project-thread-tacqoq
Oct 29, 2026
Merged

lydakis merged 11 commits into
mainfrom
claude/project-thread-tacqoq

Conversation

@lydakis

@lydakis lydakis commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

T3 Code users get Sonny's workflow inside T3 Code. T3 Code runs sonny acp as an ACP provider, one process per thread: Settings → add an "ACP Registry" provider → configure manually → local command sonny with the argument acp.

What a T3 thread is

  • A folder's lead. A thread opened in a folder becomes the lead sonny would open there, and it is set up the same way: rules, skills and memory, Sonny's tools, approval mode and sandbox, and the lookout (plus the approver in auto). A setup the daemon refuses (for example, no sandbox available) leaves the lead as it was, and the thread shows a notice.
  • Turns and calls become the thread's updates. Streamed text and thinking show as agent message and thought chunks. Calls show as tool_call/tool_call_update, with a kind, a title (the command or path) and the output, cut at 8 KB. plan maps to the protocol's plan, and react is hidden.
  • Approvals. A call waiting for the person (an ask gate, or one the judge handed over) is asked with session/request_permission (Allow / Deny) and answered on the gate it waits on. session/cancel interrupts the turn.
  • Turns the lead takes on its own (the lookout waking it because a task finished) show between prompts as state_update running → user_message → … → idle. This is ACP's version 2 draft, which T3 Code speaks and follows as work the agent started. A prompt sent while a turn runs steers that turn.
  • Tasks become threads of their own. When the lead's start_task succeeds, Sonny calls T3 Code's t3_thread_launch tool, the MCP endpoint T3 Code gives each thread, with the task's brief as the first message, in the task's worktree. It falls back to the project folder when T3 Code doesn't take the worktree. That thread's first prompt claims the task, so the thread follows and steers PROJECT.NAME and no lead is made for the worktree. Thread→bot bindings live in ~/.agent/sonny/t3 so resumed threads come back to the same bot.
  • T3 Code's prompt wrapping (<t3_code_instructions>, which names tools Sonny's agents don't have) is stripped, so the bot sees only the person's words. T3 Code's Plan mode doesn't reach the bot; plan with the lead instead.
  • The thread's credential. The T3 MCP credential is read and then removed from the environment before anything starts, so the daemon, the lookout and agents' shells never inherit it.

cmux: agents' shells and Automation mode

Agents' shells run in the daemon, which cmux didn't start, so cmux's default "cmux processes only" mode refuses them ("only processes started inside cmux can connect"). George chose to set cmux's Settings > Automation to "Automation mode" rather than have Sonny carry cmux's token. The cmux-tabs skill and the README now name that setting, so an agent that is refused tells the person what to change. The skill also says a workspace the person asks for is a project's, opened with show_agent or made with new_project.

Not in this PR

  • Model and mode pickers (ACP config options). The lead keeps its own model, and /approvals lives in Sonny.
  • A live check inside T3 Code on a Mac. There are no screenshots yet; I'll run it over Remote Control.

Tests

  • tests/test_acp.py (runtime suite) drives sonny acp over stdio against the real daemon, with the synthetic model and a fake T3 Code MCP endpoint:
    • A thread is the folder's lead. A gated start_task is asked and allowed in the thread, and the turn's updates and stop reason arrive. T3 Code's wrapping never reaches the lead. t3_thread_launch gets the task's brief and worktree with the thread's credential. A second thread with that brief binds to calc.fix without making a lead.
    • A lookout-started turn shows in the thread as running, then the user message, the reply, and idle.
  • Unit tests cover prompt blocks to text and images, plan mapping, call titles and kinds, output cutting, T3 Code's prompt unwrapping, and MCP JSON/SSE replies and results.
  • cargo fmt --check, cargo clippy --workspace --all-targets -D warnings and cargo test -p sonny all pass.

🤖 Generated with Claude Code

Sonny run in a cmux tab now makes the project's cmux workspace its home,
as it does a Herdr workspace or a Rex session: each task the lead starts
gets a tab in the lead's pane running Sonny on it, titled with the bot's
name; run_in_pane and show_agent open tabs and splits there; another
project's lead gets a workspace of its own. Every call goes through
`cmux rpc` (system.tree, workspace.create, surface.create, surface.split,
surface.close, tab.action), and the workspace is kept in
~/.agent/sonny/places so the lookout's calls land in it.

cmux already reads the OSC 7501 status and OSC 777 notifications Sonny
writes, so its sidebar shows each task's state and rings the tab that
needs the person. Each Sonny also gives its tab a resume command
(`cmux surface resume set`, `Sonny: NAME`), so cmux reopens it after a
relaunch once the person allows `sonny` commands; quitting clears it.

Agents get a cmux-tabs skill like herdr-panes, and the daemon keeps a
cmux tab's own place variables (CMUX_WORKSPACE_ID, CMUX_SURFACE_ID,
CMUX_TAB_ID, CMUX_PANEL_ID) out of its tools' shells, as it does Herdr's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFMvxuKK3qzEb4j48d
T3 Code runs `sonny acp` as an ACP provider, a process per thread. A
thread is its folder's lead, set up as `sonny` sets it up (rules, skills,
tools, approval mode and sandbox, the lookout). Turns and calls become
the thread's updates; a call waiting for the person is asked with
session/request_permission; turns the lead takes on its own (the lookout
waking it) show between prompts, as ACP v2 work the agent started. Each
task the lead starts opens as a T3 thread of its own via T3's
t3_thread_launch tool, and that thread binds to the task.

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

chatgpt-codex-connector Bot commented Oct 29, 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-29T02:18:34.075461Z bfcafee New commits
🔒 Security Review ✅ Completed 2026-10-29T02:18:54.383129Z bfcafee New commits

Security findings

Advisory findings (2)

ℹ️ 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 self-assigned this Oct 29, 2026
Agents' shells run in the daemon, which cmux did not start, so cmux's
default "cmux processes only" mode refuses them. The skill and README now
name the setting that lets them in, and say a workspace the person asks
for is a project's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFMvxuKK3qzEb4j48d
@lydakis lydakis changed the title Sonny: sonny acp, Sonny as a T3 Code provider Sonny: sonny acp for T3 Code, and cmux's Automation mode in the cmux skill Oct 29, 2026

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

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

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: c69181e5a8

ℹ️ 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.

Comment thread sonny/src/acp.rs Resolved
… Claude's tool results

- A call whose event carried only the start of its arguments is read from
  history, so a long start_task still opens the task's thread.
- A thread that comes to a bot already waiting for the person is asked
  for those calls.
- A task thread claims the task waiting for its message in its folder; the
  same brief twice in one folder is told apart by the task's name.
- A resumed thread Sonny has no binding for is refused, not made a lead.
- History items go through `responses`, so Anthropic-family bots' tool
  results show and their start_task opens threads.

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

- A call listed with its arguments cut is shown whole, read from the node
  that planned it, before the person may allow it; when that read fails,
  the person may only deny it.
- When the daemon lets a thread's stream go (follow_lagged, or the
  connection ends), the thread follows its bot again, answers a prompt
  whose turn ended meanwhile, and asks for calls waiting on the person; a
  prompt is failed rather than left waiting while the daemon is away.

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

@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: 590b2af67c

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

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 590b2af67c

ℹ️ 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.

Comment thread sonny/README.md Resolved
…mes them, services on resume, no missed events, one follower

- A cancel that comes before the prompt's turn is known is kept: the
  prompt is not sent, or its turn is interrupted once it is.
- A task named with its project already (`calc.fix`) is found as
  `start_task` names it, not as `calc.calc.fix`.
- A thread that comes back to a saved bot starts what it needs: the
  lookout, the lead's subscription, and the judge for an `auto` gate.
- A thread whose stream dropped follows on from the last event it
  handled, so what happened meanwhile (a task started) is handled too.
- Closing or replacing a thread stops its follower.

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

@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: 1ac36734b1

ℹ️ 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/acp.rs Resolved
Comment thread sonny/src/acp.rs Resolved
Comment thread sonny/src/acp.rs Resolved
Comment thread sonny/src/acp.rs Resolved
Comment thread sonny/src/acp.rs Resolved
…y approval page, answers on the live connection, steers by their own turn

- Binding to a running bot keeps the running turn's started calls from the
  replay, so a start_task finishing after the thread came opens its thread.
- A reply whose stream dropped partway sends the rest from the kept
  message instead of stopping at what streamed.
- Approvals are listed page by page.
- A permission answer goes through the thread's connection as it is when
  the person chooses; one not delivered is asked again on reattach.
- A prompt that steers waits on the turn the daemon names for it, and on
  the turn that takes it in once steered; a turn finishing before then no
  longer answers it.

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

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

ℹ️ 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/acp.rs Resolved
The streamed prefix is settled only by the assistant's words, so a model
that reasons before it answers no longer has its reply said twice.

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

@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: 0955f7b20b

ℹ️ 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/acp.rs Resolved
The claimed prompt is answered here only while it is still this thread's
and waits on no turn; one the follower already answered is left alone.

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

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

ℹ️ 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/t3.rs Resolved
@lydakis
lydakis merged commit 598559b into main Oct 29, 2026
3 checks passed
lydakis pushed a commit that referenced this pull request Oct 29, 2026
@lydakis lydakis mentioned this pull request Oct 29, 2026
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