Skip to content

Sonny: timers show the running turn's time, or how long the last turn took - #266

Merged
lydakis merged 9 commits into
mainfrom
claude/project-thread-oier2e
Oct 28, 2026
Merged

lydakis merged 9 commits into
mainfrom
claude/project-thread-oier2e

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

George noticed that every agent's timer in /status kept counting up, as if it measured time since the agent was created. He wants it to show the current turn's time while the agent works, and how long its last turn took when it's idle.

What changes

  • /status: an agent with a running turn shows how long that turn has been running, and the time ticks up. An idle agent now shows how long its last turn took (done · took 7s), and that number stays fixed. It used to show 7m ago, counting up from when the last turn ended. Rows in each group are still listed newest first, ordered by when the turn started or ended.
  • Composer timer (Working (32s • esc to interrupt)): it now counts from when the daemon started the turn. It used to count from when this window first saw the turn, so reopening Sonny or reconnecting partway through a turn reset it to 0s. The "worked for" line at the end of a turn uses the same start time.

Tab names have no timer, so nothing changes there.

/status: bench working · 19s ticks; idle tasks show how long their last turn took

Opening Sonny on a task 32s into its turn: the timer starts at 32s

Testing

  • Sonny unit tests pass (250), with the card test updated for took. Clippy is clean with -D warnings.
  • I ran it live against a real daemon with a scripted model whose turns take 2 to 7 seconds:
    • I captured /status twice, 5 seconds apart. bench working went from 19s to 23s, and the idle tasks kept showing took 7s, took 2s and took 4s.
    • I opened sonny --bot calc.bench partway through its turn, and the composer timer showed 32s instead of starting at 0.

…esolve them

/status puts the lead first, then its tasks under Needs you (waiting on an
approval, asking the person, or failed), Working, Ready for review
(finished, its last reply linking a pull request), Idle, and Resolved,
counted until `r` shows them. Open questions are read from a task's last
few items rather than the asks file.

Leads get a `resolve_task` declared tool. The lead's Sonny keeps each mark
beside the store with the lead's turn that made it, live and from the
replayed history, and closes the task's window; a task turn numbered after
it reopens the task.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGHMFbX9bEQkppDjeSi
… the last turn

A lead that waits on a task and resolves it in the same turn left a task
turn numbered after its own, so the mark never held. A mark now records the
task's newest turn finished when the call was made (or, replayed, when the
lead's turn ended), so one still running stays unresolved.

A question asked before more work in the same turn fell outside the last
four items. An idle agent's whole last turn is now read for an open ask,
once per turn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGHMFbX9bEQkppDjeSi
A replayed resolve_task call recomputed its boundary from the end of the
lead's turn, which could take in work sent to the task after the resolve.
A mark now names the call that made it, and a replay of that call leaves
it as it is.

An open question is now closed the way the pinned questions are: only by
the person's "You asked:" answer naming it, one answer per question. A
message of the person's own, or a reaction, answers nothing, and an idle
agent's newest 400 nodes are read for it, once per turn it ended.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGHMFbX9bEQkppDjeSi
…work; resolve_task stays the lead's

Protocol 20 adds "inherit": false to a declared tool, which a bot the
declaring one creates does not take; Sonny declares resolve_task so.

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

/status counted every idle agent's time up from when its last turn
ended ("3h ago"), which read as time since the agent was made. A
running turn now counts from its start; an idle one shows how long its
last turn took, still. The composer's timer counts from the daemon's
turn start, not from when this window first saw the turn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGHMFbX9bEQkppDjeSi
@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-28T02:42:26.764606Z 8464f6c New commits
🔒 Security Review ✅ Completed 2026-10-28T02:43:19.553179Z 8464f6c 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: 3b80740af3

ℹ️ 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
A steer is recorded as a turn of its own that never ran, so the newest
turn had no start. /status now times, and names the state of, the newest
turn that ran.

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

lydakis commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

The runtime check failed in tests.test_cli at test_run_refuses_a_stale_bot_identity. The test's second agent run --detach reached the daemon while the first detached turn was still running, so the daemon answered bot_busy. This PR only changes Sonny's /status and composer timers. It doesn't touch the daemon, the CLI or that test, and the rust job and the other runtime modules passed. There's no fix for that race yet, so I'm re-running the failed job once.


Generated by Claude Code

@lydakis
lydakis merged commit e6a3744 into main Oct 28, 2026
3 checks passed
lydakis pushed a commit that referenced this pull request Oct 28, 2026
@lydakis lydakis mentioned 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