Skip to content

Sonny: a first run that finds what the machine has and asks only the rest - #402

Merged
lydakis merged 19 commits into
mainfrom
claude/project-thread-rn5fyq
Oct 30, 2026
Merged

lydakis merged 19 commits into
mainfrom
claude/project-thread-rn5fyq

Conversation

@lydakis

@lydakis lydakis commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

This is the first of three PRs from the onboarding proposal George approved. The first run now looks at the machine before it asks anything. Most people answer only the model, and Enter answers it. The other two PRs will add MCP import from Claude Code, Codex, OpenCode and Kiro, and then sonny setup flags, a setup skill, and an opt-in hand-off to one of those agents.

What Sonny finds before asking

All of this is file reads in Sonny. Nothing goes to the daemon or the network.

  • ChatGPT sign-in: Sonny's own ~/.agent/chatgpt.json, or Codex signed in with ChatGPT. For Codex it only checks that auth.json exists. It never reads Codex's tokens.
  • Provider keys: keys set in the shell or in ~/.agent/env.
  • AWS profiles: from ~/.aws/config and ~/.aws/credentials (or AWS_CONFIG_FILE / AWS_SHARED_CREDENTIALS_FILE), with each profile's region and how it signs in (SSO, an assumed role, a credential process, access keys). AWS_PROFILE comes first, then default.

Choosing a provider

When the daemon has no provider, an arrow-key list (sonny/src/picker.rs) replaces the numbered prompt.

  • What Sonny found is listed first and badged ready or found.
  • Bedrock offers each profile by name, plus a "no profile" row for the environment's own credentials.
  • A key that's already set needs no paste.

First run: ChatGPT and Bedrock badged found, with three AWS profiles listed

Bedrock: the profiles with their regions and how each signs in

Choosing a model

  • One keypress: the list arrives ranked, with the first row marked recommended, so Enter takes it. With a key already set, this is the only question on a first run.
  • What's left out: models no agent can run (embeddings, speech, images, realtime, moderation), and a dated snapshot when its undated name is also listed.
  • Bedrock: global inference profiles come before regional ones, since they serve from any region.
  • Each row shows the model's name and context window when the provider gives them.
  • Typing: typing narrows the list. A whole PROVIDER/MODEL that matches nothing listed is taken as typed.
  • No model pinned: the ranking chooses; no model name is hard-coded in Sonny.

The model list ranked, with embedding, image, realtime and speech models and a dated snapshot left out

A provider that won't list its models says how to fix it, for example aws sso login --profile dev for an expired session, or a new key for a refused one. Enter then lists again.

An expired AWS session: the error, the sign-in command, and Enter to list again

The file, the summary, and sonny setup

  • Commented config: a new ~/.agent/config.toml starts with comments saying what each setting does. Setup writes its values below them, including the suggested efforts (leads medium, tasks high) when the file doesn't set any.
  • Summary: setup ends by listing the model, efforts, approval mode and settings file. It also names any tool agents need that's missing, with the install command for that system: bubblewrap for the sandbox on Linux, and ripgrep. The lead's window opens with a one-line notice saying where the settings are.
  • sonny setup asks both questions again. The current provider is offered as Keep … and the current model is marked current. If the provider changes while a daemon is running, it says the daemon keeps its providers until it restarts. It doesn't restart the daemon itself.

sonny setup: the provider kept, a model picked, and the summary

No PROTOCOL or SCHEMA change. Everything is in Sonny, plus its README and the top-level README.

Testing

  • Unit tests cover:

    • reading AWS profiles from both files, with the current profile first;
    • detection in a temporary HOME (a Codex ChatGPT sign-in, an AWS profile);
    • the order of the provider list, including a key that's set and a provider kept from the config;
    • model ranking: filtered ids, dated twins, global profiles first;
    • context-window text;
    • refusal hints;
    • a new config starting from the template and still reading;
    • the picker's keys: arrows, typing to narrow, Enter, typed text, and Esc.

    cargo test -p sonny --bins passes (475), and cargo clippy -p sonny --all-targets -D warnings and cargo fmt --check are clean.

  • Tried live in tmux with empty HOMEs, which is where the screenshots come from:

    • Codex auth plus three AWS profiles → Bedrock → dev → an expired-session hint → a typed model. This wrote provider = "bedrock", the model and the efforts to the commented config, and AWS_PROFILE=dev to env. The lead then opened.
    • A key set with a stand-in /v1/models that also lists embedding, image, realtime, speech and dated models → only agent models shown, and one Enter → lead.
    • sonny setup on that home.

claude added 13 commits October 28, 2026 01:25
- With no provider anywhere, sonny in a terminal asks for one (a ChatGPT
  plan, an Anthropic, OpenAI or OpenRouter key, or Bedrock with an AWS
  profile) and keeps it in ~/.agent/env, instead of failing. The CLI now
  names that failure provider_required, so Sonny reads the code, not text.
- With no model, Sonny lists what the providers offer and keeps the pick as
  AGENT_MODEL in ~/.agent/env, instead of failing with model_required.
- AGENT_MODEL (and the lookout's keys) count from ~/.agent/env as well as
  the shell, with the file first, as the daemon and approver see it.
- The first start writes ~/.agent/models when there is none, and `agent
  stats` starts a daemon on a fresh install like `start` does.
- install.sh fetches the latest Linux release tarball, checks its sha256,
  and links ~/.local/bin/sonny, for machines without Homebrew.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGH8qUQFR4a1z8DWu4L
First-run setup keeps settings where #251 put them, as Codex does: the
provider, the default model and the suggested lead and task efforts go
in ~/.agent/config.toml (top-level provider and model, [sonny]
lead_effort and task_effort), and only keys and AWS_PROFILE in
~/.agent/env. agent_client::config::set writes keys line by line so the
person's comments stay. The daemon takes the config's provider after
AGENT_PROVIDER, and a new bot the config's model after AGENT_MODEL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGH8qUQFR4a1z8DWu4L
…itHub CLI is signed in

The .sha256 comes from the same release as the tarball, so it only guards
the download. With gh signed in, the installer also verifies the
provenance the release workflow attests, as publish-homebrew does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGH8qUQFR4a1z8DWu4L
The portrait was drawn only over a lead just made, and a small icon
after the first; a reopened lead showed none. Now the portrait is the
first thing in every lead's transcript: above the history when the
newest page reaches the conversation's start, and once scrolling up has
loaded back to it otherwise. A side chat has none. The icon and the
~/.agent/sonny/welcomed marker go, and the two stray screenshot pages
from #253 with them.

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

Setup looks before it asks: a ChatGPT sign-in of Sonny's own or Codex's
(only that there is one), the keys set in the shell or ~/.agent/env, and
the AWS profiles in ~/.aws/config and ~/.aws/credentials. It offers what
it found first, in a list picked with the arrow keys, and Bedrock offers
the profiles by name with their regions and how they sign in. A key that
is set needs no question at all.

The model list comes ranked, the first marked recommended so Enter takes
it: models no agent runs on (embeddings, speech, images, realtime) and
dated snapshots of a listed name are left out, Bedrock's global inference
profiles come first, and each row shows its name and context window. A
provider that will not list says how to fix it, as aws sso login for an
expired session, and Enter lists again. A new config.toml starts with
comments saying what each setting does, and setup ends with what it
chose and any tool agents need that is missing, with the command that
installs it. sonny setup asks both again, marking what is set.

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

chatgpt-codex-connector Bot commented Oct 30, 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-30T02:35:26.884322Z 6af9ee7 New commits
🔒 Security Review ✅ Completed 2026-10-30T02:35:53.843703Z 6af9ee7 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.

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

ℹ️ 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/setup.rs Resolved
Comment thread sonny/src/setup.rs Resolved
Comment thread sonny/src/picker.rs Resolved
Comment thread sonny/src/setup.rs Resolved
Comment thread sonny/src/setup.rs Resolved
…emon, unset AWS_PROFILE for no profile, replace a set key, fit the picker to narrow terminals, judge fine-tuned models by their base

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

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

ℹ️ 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/setup.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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5288a5ebf1

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

Here are some automated review suggestions for this pull request.

Reviewed commit: c52b49e860

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