Skip to content

Sonny: group the lead's tasks by state in /status, and let the lead resolve them - #244

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

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

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

George asked for Sonny to break a lead's tasks into categories the way the claude.ai project coordinator does: working, waiting on you, waiting on review, idle, resolved.

What changes

/status puts the lead first. Its tasks follow, grouped by where they stand:

  • Needs you: waiting on the person's approval, asking them a question, or failed.
  • Working: a turn is running, including queued, rate limited, or waiting on other tasks.
  • Ready for review: finished, and its last reply links a pull request (GitHub /pull/N or GitLab /-/merge_requests/N). The PR shows on the facts line as owner/repo#N.
  • Idle: finished or stopped, with nothing open.
  • Resolved: only counted (1 resolved · r shows them). r shows or hides them in the status screen.

The header counts tasks, not the lead: calc · 6 tasks · 2 need you · 1 working · 1 to review.

grouped

resolved shown with r

Resolving is a declared tool, not a CLI. This follows the client-tools rule from #224 and #225. Leads get resolve_task {task}, whose fixed result is "Resolved."

  • Sonny keeps each mark in STORE.resolved/TASK.json as {turn, call}. turn is the task's newest turn that had finished when the call was made.
  • Turn ids are numbered across the whole store. Any task turn numbered after the mark reopens the task, whether it's new work for the task or a new bot with the same name, and nobody has to clear the mark.
  • Marks are written live and from the replayed history when Sonny opens. A replay leaves alone a mark its own call already wrote.
  • A live resolve also closes the task's window.
  • The call shows in the clean view as "Resolved TASK".

lead resolving a task

resolve_task stays the lead's (daemon, protocol 20). A declared tool can now carry "inherit": false, and a bot created by the declaring bot doesn't take that tool. A fork still keeps it. Sonny declares resolve_task this way, so tasks never see it.

Open asks come from history now, not the asks file. For an idle task, /status reads its newest 400 nodes, once per turn. A question stays open until the person's You asked: QUESTION answer names it, which is the rule the pinned panel uses. Unrelated messages and reactions close nothing. A running task shows its work, and a question that's still open shows again when its turn ends. The ask-tool thread is removing ~/.agent/sonny/asks, so the card no longer depends on that file.

Known limits

  • "Ready for review" is based only on the last reply's text. A merged PR stays in that group until the lead resolves the task, the same way a claude.ai thread stays open until it's resolved. Checking PR state with gh would be a later addition.

Testing

  • cargo test --workspace passes, except the two sandfs tests in sonny/tests/task.rs. They need FUSE, which this container doesn't have, and they fail on main here too. CI installs fuse3.
  • Sonny has 239 unit tests. The new ones cover grouping, PR links, ask detection, resolve marks and reopening, replay, and lead-only declaration.
  • The store contract test now covers inherit: false.
  • Live run: a real daemon with a scripted Responses model, the lead's Sonny in tmux, and six tasks, one per state. What it showed:
    • The lead resolved old-docs live.
    • After I deleted the mark and reopened Sonny, the mark was written again from history.
    • Sending old-docs new work moved it out of Resolved.
    • A task the lead waited on and resolved in the same turn stayed resolved.
    • An unrelated message didn't close an ask.
    • The screenshots above come from that run.

🤖 Generated with Claude Code

…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
@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:10:01.165441Z aa4439e New commits
🔒 Security Review ✅ Completed 2026-10-28T01:11:09.295914Z aa4439e 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: 98f17041b3

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

lydakis commented Oct 28, 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: 2a38f5c3ab

ℹ️ 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/asks.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: 2a38f5c3ab

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.

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

@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: 826750c880

ℹ️ 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/declared.rs Resolved
…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
@lydakis
lydakis merged commit 0e0f6a8 into main Oct 28, 2026
3 checks passed
@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