Skip to content

Sonny: keep open questions older than the replayed history - #226

Merged
lydakis merged 13 commits into
mainfrom
claude/project-thread-q2z704
Oct 27, 2026
Merged

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

Conversation

@lydakis

@lydakis lydakis commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Follows #225 and closes its one open review point.

Since #225, open questions are the lead's ask calls in history that no You asked: message has answered yet. Sonny replays only the newest 200 history nodes, so a question asked before those was no longer pinned when Sonny opened again. This happens when the person chats past a question for a long stretch and then restarts Sonny.

What changes

  • Sonny now also keeps the open questions in ~/.agent/sonny/asks/KEY.json. KEY is the same per-bot key the reactions file uses: the store's path and the bot id.
  • The file is saved whenever the open set changes: a question is asked, an answer is sent or lands, or a replay ends. The file is removed when no questions are open.
  • A full replay (attaching, or a repaint) starts from the kept questions instead of an empty list. The replay then closes the questions it finds answers for and adds the questions it finds asked, with no duplicates by call id.
  • A failed write shows as a notice and is not dropped silently.

Nothing new is drawn, so there is no screenshot. The "Needs you" panel is the one shown in #225.

Tests

  • cargo test -p sonny --bin sonny: 206 passed. cargo clippy --workspace --all-targets and cargo fmt --all --check are clean.
  • open_questions_are_kept_until_none_are covers loading, keeping, and removing the file.
  • a_question_asked_is_pinned_until_an_answer_lands now starts with two kept questions. One is older than the replayed history and stays open. The other is asked again inside it and is not added twice. The test also checks that the file follows each answer and is gone once nothing is open.

claude added 12 commits October 27, 2026 06:07
… turn

A message of only an emoji (or Slack shortcodes such as 👍) is the
person's reaction to what the bot said last. Sonny sends it with
delivery attach, so it starts no turn and the bot reads it with its next
model call, and draws it as a pill right under the reply. To a busy bot
it waits staged and lands where the running turn takes it in. Replayed
history puts a reaction an idle bot's next turn took in back under the
reply it answered, before that turn's prompt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGDk4BeGJDqCBN5aYnW
A bare emoji still reacts to the bot's last reply; /react picks one of
its last nine by first line, and the emoji sent next reacts to that one.
The bot is told with an attached message (no turn): the emoji alone for
its last reply, quoted under the reply's first line for an older one.
Sending an emoji already on a reply takes it off. Reactions are kept by
reply node in ~/.agent/sonny/reactions/, so a replay draws them as a pill
under the reply they answer and leaves out the messages that told the bot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGDk4BeGJDqCBN5aYnW
A client can now declare tools of its own on create and configure: a
name, a description, an object schema and a fixed result. The model is
shown them after the daemon's tools; the daemon never runs one. A call
that fits the schema is recorded at once with the fixed result, and one
that does not is `invalid_arguments`. The call is otherwise ordinary:
its events and history items are the usual ones, and the client gives
it meaning. Created bots take their creator's set, forks keep theirs,
and a fork's allow list narrows them. Protocol 19, schema 53.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGDk4BeGJDqCBN5aYnW
Sonny declares a `react` tool on the bots it opens (not side chats),
once no turn runs. A call adds or takes off an emoji on the person's
newest message. Live, the net reactions are drawn when the turn ends:
right under the message when nothing came between, with no turn line
when that was all the turn did, else a row that quotes the message. A
replay draws them under the message they answer. The README shows both
kinds of reaction.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGDk4BeGJDqCBN5aYnW
A `react` call is applied when it completes without failing, live and
on replay, so one the daemon refused is never drawn. Replay goes back
to reading history a batch at a time and draws the bot's reactions as
they were drawn live. Sonny adds `react` only within the daemon's
limits on declared tools, leaving a bot's own set as it is otherwise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGDk4BeGJDqCBN5aYnW
The lead's question and its plan were shell commands Sonny read back out
of the call (`sonny ask ...` and the plan skill's script). They are now
tools Sonny declares beside `react`, which the daemon records without
running:

- `ask {question, choices?}` pins the question until it is answered. Open
  questions are the `ask` calls in history with no `You asked:` answer yet,
  so nothing is kept in files and a question asked while Sonny was closed
  still shows.
- `plan {steps}` sets the checklist; no steps clears it. A step sent
  without its mark is drawn as a step to do.

Sonny declares its tools only while the set stays within the daemon's
limits, keeping the bot's own tools, and installs the plan skill as text
only, removing the script it no longer ships.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGDk4BeGJDqCBN5aYnW
Open questions are read from the lead's history, but Sonny replays only
its newest part, so a question asked before that was no longer pinned
when Sonny opened. Sonny now also keeps the open questions in
~/.agent/sonny/asks/KEY.json and starts a full replay from them: the
replay closes those it answers and adds those it asks.

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

chatgpt-codex-connector Bot commented Oct 27, 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-27T07:45:13.448915Z 00af9cd Manual request
🔒 Security Review ✅ Completed 2026-10-27T07:48:52.996727Z 00af9cd Manual 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" 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: 5218c4fb07

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

lydakis commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@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: 00af9cd3d8

ℹ️ 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
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 00af9cd3d8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@lydakis
lydakis merged commit 0510a05 into main Oct 27, 2026
1 check 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