Repository navigation
Sonny: agents ask sonny where for their terminal, with a skill for each multiplexer the machine has - #810
Merged
Conversation
…each multiplexer the machine has An agent's run_in_pane and show_agent calls go to the window the person used last among those showing it (#604), but Sonny installed one multiplexer skill for every agent: the one for the terminal the last Sonny started in, removing the others. With a project open in Herdr and in cmux, the cmux agent opened its tabs in cmux yet said it was in Herdr. - `sonny where [AGENT]` prints the multiplexer and the workspace or session the agent's calls act in now, by the tools' own rule (mux::aim, which for_agent now opens). It reads the places file and asks a multiplexer only when no window says. - Sonny installs the skill of every multiplexer the machine has and removes one it no longer has; each tells the agent to run `sonny where` first and to follow the skill it names. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDUmvDiLkLgbMSmJMF
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDUmvDiLkLgbMSmJMF
Codex Review Summary: ✅ CompletedThis 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. |
lydakis
marked this pull request as draft
November 8, 2026 00:39
lydakis
marked this pull request as ready for review
November 8, 2026 00:39
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7d9cfadc3
ℹ️ 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".
…m a sandboxed shell A sandboxed agent's shell on macOS reaches the daemon by the bot's own socket, which no Sonny window notes its place under, so `sonny where` fell back to asking the multiplexers and could name the wrong one. It now reads the places noted under the socket it was given, else under the store's own socket, which Sonny windows use unless one is named. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDUmvDiLkLgbMSmJMF
lydakis
marked this pull request as draft
November 8, 2026 00:47
lydakis
marked this pull request as ready for review
November 8, 2026 00:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With a project open in a Herdr window and a cmux window at once, an agent opened its tabs correctly in cmux, but when asked "do you know you're inside cmux?" it answered "No, I'm inside Herdr" (FEEDBACK H19).
Since #604, an agent's
run_in_paneandshow_agentcalls go to the window the person used last among those showing it (mux::latest_for). The skill was still chosen by the old rule, though:mux::install_skillinstalled one multiplexer skill for every agent, picked from whichever terminal the most recent Sonny started in, and removed the other skills. So every agent read the text for that one multiplexer.Reproduced on the old code: with fake
herdrandcmuxon PATH, a Sonny start in a cmux tab installedcmux-tabs. A later start in a Herdr pane replaced it withherdr-panes, and every agent's skill then began "Herdr is the terminal multiplexer the person watches the work in".Change
sonny where [AGENT]prints one line: the multiplexer, plus the workspace or session the agent's calls act in right now. Examples:cmux, workspace workspace:3,Herdr, workspace w1, or an error saying nothing opened would be seen. In an agent's shell,AGENTdefaults to$AGENT_BOT. The rule lives in one place:mux::aimdecides, andfor_agentnow just opens whateveraimnames, so the command can never disagree with the tools.rex-windows,herdr-panesandcmux-tabsare each installed when that CLI is found, and removed when it is not. The "last window to start wins" rule is gone. Each skill opens with a "Which terminal" section: runsonny wherefirst, before opening anything and whenever the person asks where you are, then follow the skill for the multiplexer it names.sonny wherereads the project's places file and asks a multiplexer only when no window of the project's is known, the same as the tools do. It does no file walks and took about 11 ms a call in a debug build against a real daemon. In the fallback branch, the cheaplikecheck now runs before thehas_leadCLI call.This is a Sonny-only change; nothing in the daemon changed. It adds a FEATURES row and updates README and docs/SONNY.md.
Tests
an_agent_in_herdr_and_cmux_acts_in_the_one_used_last: one agent has a Herdr window and a cmux window. Its calls aim at the window used last and follow the person when they switch. All three skills stay installed, and each mentionssonny where.an_agent_with_no_window_acts_where_its_lead_is_or_nowhere: covers the fallbacks and the errors, and checks that a multiplexer the machine no longer has loses its skill.agentdaemon with a hand-written places file:sonny whereprinted cmux, then Herdr after the Herdr window's use time moved ahead. It gave the typed error for a project that has no window, and the usage text when no agent was named.cargo fmt --checkandcargo clippy -p sonny --all-targetsare clean.