Skip to content

Sonny: declined review findings (attach and reconnect races) #150

Open

Description

@lydakis

Review findings on the Sonny PRs that were declined under the merge rule. Each one needs a race between the follow boundary and a history read, not ordinary use. They are kept here to fix later.

  • A reply that finishes between the follow boundary and the history read can be drawn twice (Add Sonny, a terminal coordinator for a folder's agents #146, review comment r4373361419). History draws the persisted message, and the queued text_delta events stream it again. The duplicate guard then drops the message event that would finalize the stream. The window is the few milliseconds between caught_up() and the end of history_after(), on first attach or on reconnect. Fixing it means reconciling queued deltas against the history snapshot. A cheaper step is to keep the message event's finalization bookkeeping (streamed, said, live) even when its rendering is suppressed.

Activity

  1. lydakis commented on Oct 26, 2026

    @lydakis
    OwnerAuthor

    Declined from #146, round 7 (#146 (comment)): when Sonny reconciles the fleet and builds /status, it reads only the first page of bots (256 bots, or the byte limit). In a project with more bots than one page holds, a running task that sorts past that page gets no Rex window and doesn't appear in /status. A project with more than 256 bots is outside ordinary use. The fix is to follow next_after in both places.


    Generated by Claude Code

  2. lydakis commented on Oct 26, 2026

    @lydakis
    OwnerAuthor

    Declined from #158 (thread): when a shell agent wait prints more than 64 KiB, the stored output is a head/tail preview, so calls::returned can't parse the JSON. Those tasks' Rex windows then stay open instead of closing. The fix would be to read the retained stdout artifact when the shell result was truncated.


    Generated by Claude Code

  3. lydakis commented on Oct 31, 2026

    @lydakis
    OwnerAuthor

    Update: the first-page-only read of a project's bots in reconcile is fixed in the consolidation PR, which now follows next_after (/status already did). That matters at the bot counts the lookout now handles. The two entries left are the attach double-draw race and Rex windows after a truncated agent wait.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions