Skip to content

Sonny: date the person's words by when each was written, not by its turn - #497

Merged
lydakis merged 6 commits into
mainfrom
claude/project-thread-554bbo
Oct 31, 2026
Merged

lydakis merged 6 commits into
mainfrom
claude/project-thread-554bbo

Conversation

@lydakis

@lydakis lydakis commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

This is a follow-up to #477, which records written_ms on every history node. said (what the nightly cleanup reads, and what ~/.agent/memory said SINCE_MS prints) used to date the person's messages by their turn. Every line sent into a turn that ran past since_ms counted as recent, even a steer written hours before. So a long turn could make the person look active when they weren't.

  • A message or reaction with written_ms now counts only when it was written at or after since_ms.
  • Nodes from before Prompts name another person and quote turns by reference #477 have no written_ms and keep the old turn dating, so nothing in an existing store is lost.
  • The turn listing and walk are unchanged. A turn that finished before since_ms holds nothing newer, so it is still skipped.

Tests

  • New unit test a_message_the_daemon_dated_counts_by_when_it_was_written. It sets up a long turn started before the cutoff, with a line and a reaction each before and after the cutoff. Only the later two count. The test fails on main.
  • cargo test -p sonny (669 passed), clippy and fmt pass. Runtime tests.test_served passes (23 OK).
  • docs/SONNY.md and sonny/FEATURES.md are updated.

…policy, test races

- Goals (#355): a turn that completes while its goal's check runs is held and
  checked once that check settles, unless the agent goes on in a newer turn,
  as a work queue processes an item re-added during processing again. After a
  restart that replays two finished goal turns, the second is no longer
  dropped. A replayed continuation whose prompt changed (idempotency_conflict)
  counts as going on, not as a failure.
- Goals (#355): every ending is noted in STORE.lookout/goals/ended/BOT.json
  (was met/, success only) before the goal file goes, so a lookout that
  restarts before the lead heard still tells how the goal ended.
- Triggers (#404): `--start` agents are made through the same `made()` as
  `sonny --new`: auto gate, workspace-write sandbox, fallback. Agents an older
  trigger made with no sandbox and no gate are confined at their next fire.
- Sonny reconcile reads every page of a project's bots (#150).
- Tests: node scripts get 60 s under test (#418); test_served's /proc wait
  tolerates the process going between looks; the soak names why its events
  connection closed and keeps the daemon's stderr.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGHQFvDYzqCcbhWmojA
…ts never drop

Codex review on #476: an idempotency_conflict names the turn the request
started, so it counts as the turn the agent goes on in, and the newer-turn
rule holds with changed check output. The settlement channel is unbounded,
holding a few per agent with a goal at most, since a goal's turn waits on
its one settlement and a full channel dropped it.

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

chatgpt-codex-connector Bot commented Oct 31, 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-31T05:38:19.485943Z f377449 PR opened
🔒 Security Review ✅ Completed 2026-10-31T05:39:00.923186Z f377449 PR opened
ℹ️ 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.

@lydakis
lydakis merged commit 9b6898f into main Oct 31, 2026
4 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