Skip to content

Sonny: close a task's Rex window once its result is taken - #158

Merged
lydakis merged 4 commits into
mainfrom
claude/project-thread-45hlbm-close
Oct 26, 2026
Merged

lydakis merged 4 commits into
mainfrom
claude/project-thread-45hlbm-close

Conversation

@lydakis

@lydakis lydakis commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Finished tasks no longer crowd the Rex tabs.

What "done" means. A task's window closes when both of these hold:

  • its turn completed;
  • a wait in the project returned that turn. That is the lead's wait tool on its handle, an agent wait turn:… command, or a task waiting on a task it started.

An ended turn on its own is not enough: the lead hasn't checked it yet, so the window stays until the result is taken. These stay open:

  • a task that failed, was stopped, or is waiting on the person;
  • a task whose wait returned before the turn ended, which means it timed out.

Giving the task more work opens its window again, through the existing accepted → show path. The lead's own window never closes. Asking the lead to show a task, or running sonny --bot NAME, still opens it.

This is Rex only for now. The same hook moves into the shared multiplexer layer when Herdr and Tern arrive.

Demo. SONNY_DEMO_WAIT=1 python3 sonny/demo/model.py PORT makes the demo lead wait on its task and report, so the task's window can be seen closing.

Checks

  • cargo fmt --all --check, cargo clippy -p sonny --all-targets -- -D warnings, cargo test -p sonny, including a_wait_names_the_turns_it_takes.
  • Rex isn't available in the cloud, so the live window check runs on the Mac with the demo model.

A task's turn that completed, returned by a wait in the project (the
wait tool's handles or an `agent wait` command), closes the task's
window, so finished work does not crowd the tabs. A failed, stopped or
waiting task stays open; a wait that returned before the turn ended
timed out and closes nothing; a task given more work opens again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-26T04:47:22.317794Z 3754e85 New commits
🔒 Security Review ✅ Completed 2026-10-26T04:48:11.448901Z 3754e85 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: e3a2852e38

ℹ️ 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/main.rs Resolved
Which turns a wait took is read from what it printed once it ends (the
wait tool's result, or `agent wait` lines in a command's output), not
from its arguments: a wait that timed out, or never ran, closes nothing,
and arguments cut short in the event no longer matter. Reconciling after
a reconnect forgets the endings it cannot have seen.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks

lydakis commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

# Conflicts:
#	sonny/src/calls.rs

@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: 3754e8516c

ℹ️ 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
@lydakis
lydakis merged commit 5353fe8 into main Oct 26, 2026
1 check 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