Repository navigation
Sonny: the nightly cleanup reflects on habits, from what the person wrote and sent - #403
Merged
Merged
Conversation
…son wrote and sent The memory-cleanup skill gains a habit step: a costly move the person made again, from said, memory and, through exec, their chat and mail, saved as a user fact with dates and a count; and how they took work done unasked. memory changed is also true when the person wrote since the last cleanup, and trigger --start agents get Sonny's declared tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
Codex Review SummaryThis 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. |
…erved Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
…tarts a stopped daemon Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013jkdGEbQZnXUy1kATtYcQ6
This was referenced Oct 30, 2026
Merged
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.
Requested by George · project thread
The nightly memory cleanup now also reflects on habits: costly moves the person keeps making. A lead started in a later conversation can then name the pattern instead of the single instance. George chose this design ("Build A, your words only") after the coaching eval for #394: across six runs the leads never saved a habit to memory, so prose in the role file alone does not make habits persist.
What changes
said), the facts memory already holds, and what they sent in their chat, mail and the like, when they have connected MCP servers for those.userfact with the dates it was seen, a count and what it cost. The fact is removed when the person's words show the habit stopped.memory changedcounts the person's words. Sonny answerschanged(from the script and from the memory tool). It returns true when memory changed, or when the person wrote to any agent since the last finished cleanup started (.said). A night with no saves no longer skips the reflection. A night with no saves and nothing written still costs no turn.--startagents get Sonny's declared tools, the ones a task gets: the memory tool, andexecwhile an MCP server is on. With these, the cleanup reaches the person's servers. Saves made after an MCP read get the existingexternalmark.Prior art
Habit coaching itself has no industry precedent, so the eval decides whether it works.
Security edge
Trigger
--startagents are made with no gates and no sandbox. That was already true before this PR, and they already had the shell and web search. With this PR, the cleanup can also read mail throughexec, which widens the prompt-injection surface. I'll file an issue proposing that trigger agents be made the waysonny --newmakes them:autoplus a sandbox. That change needs testing on a Mac, because the memory script must still reach the daemon socket from inside the sandbox.Not evaluated yet
The two-day eval comes next. Day 1 is the scripted day as before, then the cleanup runs, then day 2 starts with a fresh lead. The eval checks whether that lead names the habit at the first unread merge. It also covers #399's commitments, and removes the triggers it creates.
Checks
cargo test -p sonny:a_night_the_person_wrote_is_cleaned_up_though_no_agent_saved(gate on the person's words, trigger prompts ignored).tests.test_trigger: a--startagent is made with Sonny's tools, and one that has none takes them at its next fire (all 25 pass locally).Generated by Claude Code