Skip to content

Sonny: offer a merge when an upgrade meets an edited skill or role - #357

Merged
lydakis merged 13 commits into
mainfrom
claude/project-thread-j9dmib
Oct 29, 2026
Merged

lydakis merged 13 commits into
mainfrom
claude/project-thread-j9dmib

Conversation

@lydakis

@lydakis lydakis commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

What

Sonny never writes over a skill or role (lead.md, task.md, superlead.md) that the person edited. Before this PR, an edited file just stopped getting Sonny's changes, and nothing said so. Now:

  • The new text goes beside the edit. On each start, Sonny checks each file it wrote that the person has since edited. If Sonny's own text has changed since it last wrote that file, the new text goes to ~/.agent/sonny/upgrades/agents/NAME.md or upgrades/skills/NAME/. Sonny also adds an empty file named KIND NAME to the upgrades/pending/ folder.
  • Sonny keeps a copy of what it last wrote. Each file goes whole into ~/.agent/sonny/shipped. That copy is what an edit started from, so a merge can tell the person's changes apart from Sonny's.
  • The first bot opened after the upgrade is told. This is never a side chat.
    • Sonny claims the pending entries by renaming each into a folder it creates for the claim, upgrades/claims/PID. So when several Sonnys start at once, only one of them tells its bot.
    • If the submit fails, the entries go back to pending/. A claim older than 2 minutes, left by a Sonny that stopped, is taken back.
    • The note is queued after any turn the bot is running (delivery: "queue", origin: "sonny.upgrade").
    • It names three files: the person's copy, Sonny's new text, and the text the person started from. It asks the bot to tell the person and offer to bring Sonny's changes in, keeping the person's own changes and asking where both sides changed the same part.
  • The transcript shows the note as one row: ↳ Sonny upgraded · lead role edited · plan skill edited.
  • Each new text is told once. Leaving a copy the same as Sonny's new text makes it Sonny's again from the next start. A file Sonny never wrote, or a link, is not offered.

This is client-only. The daemon is unchanged.

Tests

  • sonnys_new_text_goes_beside_an_edit_for_the_next_bot_to_offer covers:
    • no offer when the same Sonny restarts after an edit
    • staging and the shipped copy
    • the note's lines
    • claiming, so a second Sonny gets nothing, and giving entries back
    • telling each new text once, with a new request id for the next text
    • a file brought in before the bot hears, which gives an empty note and is cleared
    • recovering a stale claim
    • a file going back to Sonny's
    • unrecorded files, which are not offered
  • sonnys_upgrade_note_reads_as_one_quiet_row covers the transcript row.
  • cargo test -p sonny passes: 395 passed, 1 ignored. Clippy is clean.

No live run: the submit follows the same path as the lookout's notes, but it hasn't been exercised against a real daemon with a model here.

🤖 Generated with Claude Code

claude added 11 commits October 28, 2026 23:28
A project's profile/threads_profile, else the config's [sonny]
lead_profile/task_profile, name the profile a lead runs as and the one
every other agent is told, with lead and task the defaults. Any profile
can build on another with extends (its own name builds on the file it
shadows, down to the one Sonny ships) and carry skills whole with
skills, Claude Code's subagent key. Variants of lead or task are not
offered as peer roles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
…ants of variants

Address the first Codex round on #296: a profile chain and the skills it
carries read no more than still fits in a bot's instructions; a carried
skill with an unclosed --- head fails like a profile's; a profile that
extends a lead variant is hidden from the index too; and --profile naming
the task profile keeps its model and tools while its body is told once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
A lead runs as it only when its project sets profile = "superlead". It
extends lead: the folder holds other projects, so the lead subscribes to
their leads and routes between them as between tasks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
Carried from lead.md (#295 drops it there): the folder's projects' leads
report to it, and it hears them through one subscription naming each
lead exactly with updates on. Routing itself is the lead's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
…d skill or role

Sonny never writes over a skill or role (lead.md, task.md) the person
edited, so an edited one quietly stopped getting Sonny's changes. Now
Sonny sets its new text beside the edit, in ~/.agent/sonny/upgrades,
keeps whole what it last wrote in ~/.agent/sonny/shipped (what an edit
started from), and queues a note to the first bot it opens after the
upgrade. The bot tells the person and offers to bring Sonny's changes
into their copy. Each new text is told once; the transcript shows the
note as one quiet row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
@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-29T05:54:42.740246Z e297af0 New commits
🔒 Security Review ✅ Completed 2026-10-29T05:56:42.308981Z e297af0 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: 3bfadaa22c

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

ℹ️ 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/skills.rs Resolved
Comment thread sonny/src/skills.rs Resolved
@lydakis
lydakis merged commit 2c36a7f into main Oct 29, 2026
4 checks passed
@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