Skip to content

history reads another agent's turns, so tasks can see their siblings - #256

Merged
lydakis merged 5 commits into
mainfrom
claude/project-thread-qzgtqy
Oct 28, 2026
Merged

lydakis merged 5 commits into
mainfrom
claude/project-thread-qzgtqy

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

George asked whether Sonny's tasks can see what their sibling tasks are doing, the way threads in a project can. Agents were reading the SQLite store directly to find out. Under the rule adopted tonight, an action only agents take is a tool, so this extends the daemon's history tool instead of adding a CLI command. That choice is waiting on George's pick; the alternative is an agent history command.

What changes

  • history {bot?, turn?, offset?, limit?}:
    • With bot and no turn: lists that agent's newest 20 turns, newest first. Each entry gives the turn's number along the agent's lineage, its handle (turn:BOT/N), its status and the first 200 characters of its prompt. The listing walks back only as far as the 20th turn start.
    • With bot and turn: reads that turn as it stands, a running turn included, paged exactly as the agent's own history is.
    • Without bot: works as before. An agent's own turns are read by number only, since they're in its context.
    • An unknown bot is bot_not_found.
  • Sonny's rules:
    • The task rule (task.md) names the tool and says to message another agent only when one's work depends on the other's.
    • The lead rule no longer says that no task sees the other tasks.
  • Docs: docs/RUST_PROTOTYPE.md, under the history tool.

Tests

  • tests/test_siblings.py covers listing, reading a turn, an unknown bot, and an own-history call with no turn.
  • cargo test --workspace passes, except two sandfs tests in sonny/tests/task.rs. Those fail in this container without fusermount3, and CI installs it.

There is no visible UI change, so there are no screenshots.

A tool declared with `answered_by: TAG` takes no fixed result. A call that
fits its parameters waits for the answer of whichever client serves that
tag. The client finds it by following the bot (`tool_started` carries
`answered_by` and `expires_ms`) or with `tool_calls {tag}`, and answers with
`tool_result {output | error{code,detail}}`. The turn holds live for up to
250 ms, then parks like `wait` and survives restart. A call nobody answers by
`expire_ms` (default 60 s) ends as a typed `tool_unserved` result, and the
turn goes on.

Gates may now name declared tools, so a client's tool can need approval
before it is asked. Protocol 20, schema 55 (`answers` table).

The approval_overhead bench gains declared, answered and answered_parked
arms. Measurements are in DAEMON_MEASUREMENTS.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
# Conflicts:
#	docs/RUST_PROTOTYPE.md
#	src/tools.rs
#	tests/store_contract.rs
…eads one

The history tool takes an optional `bot`. With a bot and no turn, it lists that agent's newest 20 turns, newest first: each one's number along its lineage, its handle, its status and the start of its prompt. With a turn, it reads that turn as it stands, a running one included, paged as before. A bot's own turns are still read by number only. Agents no longer have to read the store to see what a sibling is doing.

Sonny's task rule names the tool and says to message another agent only when work depends on it. The lead's rule says tasks can read each other.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
@lydakis lydakis self-assigned this Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T01:42:14.928499Z cc52c1d PR opened
🔒 Security Review ✅ Completed 2026-10-28T01:45:42.142496Z cc52c1d 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 d63cb50 into main Oct 28, 2026
3 checks passed
lydakis pushed a commit that referenced this pull request Oct 28, 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