Skip to content

Lookout: a turn's end reaches the lead with its reply, or waits for it - #378

Merged
lydakis merged 2 commits into
mainfrom
claude/project-thread-k1awif-steer
Oct 30, 2026
Merged

lydakis merged 2 commits into
mainfrom
claude/project-thread-k1awif-steer

Conversation

@lydakis

@lydakis lydakis commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Fixes #359.

The problem

When the person writes in a task while the lead is mid-turn, a steer goes out as soon as those words have been read. It doesn't wait for other reads that are still running. If a task's turn-end reply was still being fetched at that moment, Updates::take() put the turn's end into the steer with no reply. When the read came back, replied() found nothing pending and dropped the reply. A resting lead's note had the same gap once SETTLE_MAX (15 s) ran out with a read still in flight.

Pattern

Claude Code's background-task notification and Codex's subagent wait both hand back a finished subagent together with its final message, never the "done" without the result. The lookout now does the same: a turn's end is told with its reply, or not yet.

What changes

  • Updates keeps replying, the set of turns whose reply is being read. The lookout adds a turn when it starts a reply read. replied() always removes it, whether or not the read found words, so a failed read never holds a turn. A dropped connection clears the whole set, since the old reads answer a channel that's gone.
  • take() leaves a held turn's end (act or theirs) pending for the next note. The rest of the task's news, the person's words included, still goes out now.
  • When everything left is waiting on a reply, wake() puts the news back and sends no note, rather than an empty one.

Tests

  • a_steer_leaves_a_turn_whose_reply_is_being_read_for_the_next_note: the steer carries the person's words and not the turn. No note goes while the read is out. The next note has the turn with its reply.
  • a_reply_read_with_no_words_holds_its_turn_no_more
  • cargo test -p sonny and cargo clippy --workspace --all-targets -D warnings pass locally. CI runs the live lookout suite.

No visible change, so no screenshots.

A steer went out as soon as the person's words were read, while a task's
turn-end reply could still be on its way; the steer took the turn's end
without it, and the reply was dropped when it came. A resting lead's
note had the same gap once SETTLE_MAX ran out with a read in flight.

Updates now keeps the turns whose reply is being read. A note leaves
such a turn's end for a later note, sends nothing when that is all there
is, and the read clears its turn whether or not it found words; a
dropped connection clears them all. The person's words in a steer still
go at once.

Fixes #359.

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

chatgpt-codex-connector Bot commented Oct 29, 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-29T23:45:15.080490Z 2a14aa2 New commits
🔒 Security Review ✅ Completed 2026-10-29T23:46:49.347296Z 2a14aa2 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.

ℹ️ 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/lookout/updates.rs Resolved
A task whose only news is a turn whose reply is still being read took
one of the note's task places and told nothing, so with enough of them
a task with news, an approval among them, waited behind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGH7ReQfFZ1hChr3jXE
@lydakis
lydakis merged commit ca0f7e9 into main Oct 30, 2026
4 checks 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.

Lookout: a steer can take a completion whose reply is still being read, dropping the reply

2 participants