Repository navigation
Sonny: one reading of what needs you, for every surface - #631
Conversation
The footer, the lead's task tabs, /status, the started roster and /sky each kept their own needs-you count, with their own rules, and drifted: after a restart a held approval read as working, a task waiting on its own question read as done, and the footer said 0 while /status and /sky showed items (Monday rehearsal, 11-01). A new needs module says it once: an agent needs the person while a call of its waits on their approval (gated manual, or handed over by the approver, as the daemon's approvals listing says) or a question it asked them is open (as asks::open reads its history). Each surface reads it whole at start and after a restart or reconnect, and keeps it current from events; a turn the events leave unsure of its questions is read again when it ends. No daemon change. - Fleet: tabs show "needs you" from the ledger over what the bot does; reconcile reads the listing and each agent's questions; a parked turn's turn_resumed no longer clears a held call; a task that ended on a question keeps its window when a wait takes its result. - Footer: counts agents, this one once. - /status and the roster: the same definition, and what they read updates the tabs and footer; a call the approver still weighs reads "waiting on its reviewer". - /sky: each agent's waits are the same ledger, seeded from the listing and a read of each agent's questions; a lead's word to its task no longer answers the task's question, as in its window and /status. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDr9oe4vpxmHBGMGLD
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7de3b65fb8
ℹ️ 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".
…ur resolution when restoring questions Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDr9oe4vpxmHBGMGLD
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b10ed32913
ℹ️ 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".
…w, clear unsure marks of agents found idle Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDr9oe4vpxmHBGMGLD
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71882be200
ℹ️ 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".
…solved Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDr9oe4vpxmHBGMGLD
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15a79c534e
ℹ️ 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".
Why
The Monday rehearsal (11-01, build 3232b4d) found the needs-you counts drifting:
working;donein its tab and was missing from the lead's count;/statusand/skyshowed a pending approval and open questions.The cause: four surfaces kept four counts with four sets of rules. The lead's tabs and footer (
Fleet::doing) followed live events only, so a restart lost a held call (reconcile marked running tasksworking, and a parked turn'sturn_resumedclearedneeds you), and they never knew about asks./statusand the started roster treated anywaiting_on.approvalas needs-you, including a call the approver was still weighing./skyhad its own event rules (a lead's message answered a task's question, unlike everywhere else).What
A new
sonny/src/needs.rssays it once. An agent needs the person while:manual, or handed over by the approver (asked), as the daemon'sapprovalslisting reports it (needs::person_call,needs::listing); orasks::openreads its history (needs::scan, moved fromApp::scan).needs::Needsholds that per agent. It is read whole when a surface starts or reconnects, and kept current from events after:approval_requested/approval_askedadd a call;step_decided,turn_resumed,tool_completedandtool_startedwith that call's id let it go; the running turn'sturn_finisheddrops that turn's calls; anaskcall opens a question, and a refused one closes it. The person's own prompt closes a question for now. Whether it really answered it (a reaction does not, and with several questions open it may answer only one) is decided by reading the history again when that turn ends (Needs::due). No daemon change.Each surface now reads it:
Fleet): a tab showsneeds youover whatever the bot is doing (activity).reconcilereads the listing first, so a held call survives a restart or reconnect, and then reads each agent's questions one at a time from the loop (cached by history head), so a big project still opens at once. A task that ended on a question keeps its window when a wait takes its result. Alerts only ring when an agent starts waiting, never when the wait ends. The lead's own questions don't ring here, because its own view rings at its turn's end, as before./statusand the started roster: they use the same definition. What they read is written into the tabs' ledger, so the footer and/statusagree after every refresh. A call the approver still weighs readswaiting on its reviewer(◌, like the otherwaiting on …rows), notneeds you./sky: each agent's waits are aneeds::Needs. They are seeded from the listing, and every agent's questions are read beside the follow, so questions asked before the sky opened show. Behaviour change: a lead's message to its task no longer answers the task's question in/sky. Now/skymatches the task's own window,/statusand the decision of 10-31 (only the person's own words answer an ask).sonny/FEATURES.md(Task states row) andsonny/README.md(the/statusgroups and the footer) are updated.Tests
what_waits_on_the_person_comes_back_with_a_restart: a fresh fleet against a daemon holding a manual call on a running task and an idle task with an open question. The tab readsneeds youand stays so throughturn_resumed. The question is read after reconcile, the footer counts 3 others, and answering the call brings it back toworking.a_task_that_ends_on_its_own_question_needs_you: the person's words clear a question, a newasksets it, and the turn ending leavesneeds youand is read again.status_says_needs_you_only_for_calls_the_person_must_answer_and_the_tabs_agree: a manual call readsneeds youand an approver-only call readswaiting on its reviewer. The tabs, which had missed the call, are corrected by the/statusread, and the footer agrees.needs.rsfor the reducer (gates, parked turns, steered turn ends, refused asks, person vs agent words, listings replacing only what they cover).started::stateno longer calls an approval waitneeds you(the listing decides that); the footer test counts agents; the sky test now expects a lead's steer to leave the task's question open, and the person's own words to answer it.cargo fmt --all --check,cargo clippy --workspace --all-targets -D warningsand all 934 Sonny tests pass locally.Not covered