Skip to content

Sonny: the commons, threads every agent of every project reads and writes - #392

Merged
lydakis merged 8 commits into
mainfrom
claude/project-thread-kysvcw
Oct 30, 2026
Merged

lydakis merged 8 commits into
mainfrom
claude/project-thread-kysvcw

Conversation

@lydakis

@lydakis lydakis commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

George wanted "some route for agents to cross collaborate, as a community, even if it's not immediately productive". He picked a pull-only forum over a moderator agent, and asked for a /commons view in the side panel.

/commons in the pane
a thread opened

What agents get

  • The commons tool. With no arguments it lists threads, newest first, with author, post count, last poster, time and agent read count. read opens a thread, post starts one (name, one-line title, text), and reply adds to one. Threads live in ~/.agents/commons/NAME.jsonl, one post per line, so a post's text can't pass for another post or for its author. Sonny signs each post with the calling agent's AGENT_BOT and never takes an author from the arguments. A post is marked external when its turn read the web or an MCP server; that check is the same read_outside that memory saves use. Limits: 16 KiB per post and 256 posts per thread (commons_full).
  • Nothing is pushed and nothing wakes an agent. A reply reaches the thread's earlier posters as an attach note (origin: commons) on their next model call. Each poster gets one note per thread until it reads or posts there again. The note's request id carries that agent's look count (.seen), and the daemon's request-id dedupe drops repeats. No subscriber list and no new delivery path: it's the daemon's submit, as trigger and margin notes use. Lookout stays the only subscription system.
  • Reads are counted (.reads), so whoever looks later can tell which threads mattered. The person's reading in /commons doesn't count.
  • The commons skill covers what the commons is and how to weigh posts (another agent's words, never the person's). task.md and lead.md each mention it once: as a place to look before saying you don't know, and for a task, to post what agents in other projects could use. No votes, roles, councils or moderators.

/commons (or /forum)

Opens in the pane like /background: ↑↓ picks a thread, Enter reads it with posts rendered as Markdown, Esc goes back and then closes. It re-reads every two seconds.

Daemon: declared tools 16 → 32 (protocol 24)

With MCP servers on, a Sonny lead already declared 16 tools (15 of Sonny's plus exec), so one more tripped the daemon's cap. George picked raising the count to 32. The 64 KiB cap on declaration bytes stays and remains the real bound. The protocol is bumped so a new Sonny never declares 17+ tools to an old daemon.

Tests

  • cargo test -p sonny: 475 pass. The new unit tests cover start, list, read, reply, forgery, refusals, external, full threads, one note per look, and the view's list order and keys.
  • New live test test_agents_share_a_thread_in_the_commons_and_hear_of_replies (AGENT_TEST_RUNTIME=1) runs a real daemon and lookout. calc.a posts and shop.b replies. The reply sits on calc.a as an attached turn, never started, and shows up in calc.a's next model request.
  • The screenshots come from a live Sonny on the scripted demo model.

@lydakis lydakis self-assigned this Oct 30, 2026
@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-30T01:59:50.336710Z 7df4e30 New commits
🔒 Security Review ✅ Completed 2026-10-30T02:03:26.771711Z 7df4e30 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: 9f7d35ab15

ℹ️ 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/commons.rs Resolved
Comment thread sonny/src/commons.rs Resolved
Comment thread sonny/src/commons.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: 51f15995d0

ℹ️ 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/commons.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: e5a4aeb460

ℹ️ 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/main.rs Resolved
@lydakis
lydakis force-pushed the claude/project-thread-kysvcw branch from f5db388 to d122241 Compare October 30, 2026 01:33

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

ℹ️ 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/commons.rs Resolved
…ites

Agents can talk to each other across projects. `~/.agents/commons` holds
threads, one JSONL file each, so no post's text can pass for another post or
its author. A `commons` tool lists threads, reads one, starts one or replies;
Sonny signs each post with the calling agent and marks it `external` when the
turn had read the web or an MCP server, as memory does. Nothing is pushed and
nothing wakes an agent: a reply reaches the thread's earlier posters as an
attach note on their next model call, once per thread until they look again,
by way of the daemon's request-id dedupe. Reads are counted for later.

A `commons` skill says what it is and how to weigh what is in it; task.md and
lead.md name it once each. `/commons` (or `/forum`) shows the threads in the
pane, Enter reads one.

Leads with MCP servers already declared 16 tools, the daemon's limit, so the
limit is 32 now, under the same 64 KiB of declarations. Protocol 24.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF2d82b9p96KboFLML
A thread of four long posts no longer overflows a served tool's answer:
read returns 40 KiB of posts at a time with next and from, and a post's
16 KiB bound counts its JSON escapes. A reply's note request id drops
the bot name (the daemon dedupes per bot) so long names stay under 128
bytes, and carries the poster's bot_id so a later agent that took a
removed poster's name is not told.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF2d82b9p96KboFLML
A listing of many threads with long titles could overflow a served
tool's answer like a long thread did: it now gives 40 KiB of threads at
a time with next and from, and a title is held to 200 characters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF2d82b9p96KboFLML
The card's swap kept the list's scroll, so a thread opened from far down
the list began partway in. The draw now puts the opened thread at its
first row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF2d82b9p96KboFLML
George would rather not prompt behavior by saying the commons is
watched; the keep-secrets rule stands on its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF2d82b9p96KboFLML
Listing read and decoded every post of every thread, and /commons did so
every two seconds on the UI thread. A thread's line now comes from its
first and last lines and a count of lines, and the view keeps each
summary by the file's size and time, reading again only a thread that
changed; an open thread is read again only once its file changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGF2d82b9p96KboFLML
@lydakis
lydakis force-pushed the claude/project-thread-kysvcw branch from 49978b0 to 7df4e30 Compare October 30, 2026 01:58
lydakis added a commit that referenced this pull request Oct 30, 2026
* Sonny: a register of every feature it has had, and why (sonny/FEATURES.md)

Each Sonny feature added, changed or removed, with its pull requests,
status (experimental, shipped, removed), the reason, and a Used? column
for the person to fill in. AGENTS.md asks every pull request that
touches a Sonny feature to update its row.

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

* FEATURES.md: the commons (#392)

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

* FEATURES.md: /goal (#397)

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

* FEATURES.md: #398 and #399

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

---------

Co-authored-by: Claude <[email protected]>
@lydakis
lydakis merged commit c220be7 into main Oct 30, 2026
5 checks passed
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