You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A Chat opened while the start collects its turn's last results shows the result and cost twice #244
Since #239 (staging ec18c0c), a Chat has one follower in a window. Every reader of it, the reopened Chat included, gets its updates from the first one on (extensions/pine-drama/src/core/replay.ts). Codex found this in its last review of #239. Display only: nothing is lost or stored twice.
What happens
The Studio restarts while a Chat's turn runs. At start, resumeUnfinishedTurnFollowUps follows it.
The turn ends. The start's follower stores the ending with composeTurnEnding (the result message and the turn's cost), then collects the turn's last results (collectResultsFromPine). The turn is owed until that collection is done.
The person opens the Chat during that collection. pineSessions.ts (the chat session content provider) builds the history from the store, so the result and the cost line are already in it. Because hasUnfinishedTurnFollowUp is still true, it also gives an activeResponseCallback.
The callback joins the follower (attachChatToPineTurn). The replay emits the ending again, so the Chat shows the result and the cost twice.
Codex's proposed fix: leave the in-progress turn's response out of the initial history, keep its prompt, and let the replay show it.
The race in that fix: if the follower ends between building the history and the callback's attach, the attach finds no follower and starts a new one, which has nothing to say. The response is then in neither the history nor the reply until the window reloads.
Two ways out of the race
(a) Attach first, then build the history: whatever the follower will show is left out of the history, and whatever it has already finished is in it.
(b) Keep a finished follower's replay readable for a reader that arrives just after it ends, until that turn's response is in the history.
Either way: roughly +20–30 lines, plus a failing-first test that opens the Chat during the final collection and counts the result once.
Severity: wrong display, in the seconds after a restart. Flexibility cuts, item 15.
Still on staging a01a620: by code read, pineSessions.ts builds the history from the store and then attaches to the one follower (attachChatToPineTurn), whose Replay emits the ending again. P2: display only.
Re-checked on staging b744a69 after #249: still real. pineSessions.ts still builds the history from the store and then attaches to the one follower, whose Replay emits the ending again; #249 only adds left-out lines to that follower's stream. P2.
Activity
SitgesRun commentedon Nov 15, 2026
Still on staging a01a620: by code read, pineSessions.ts builds the history from the store and then attaches to the one follower (attachChatToPineTurn), whose Replay emits the ending again. P2: display only.
SitgesRun commentedon Nov 15, 2026
Re-checked on staging b744a69 after #249: still real. pineSessions.ts still builds the history from the store and then attaches to the one follower, whose Replay emits the ending again; #249 only adds left-out lines to that follower's stream. P2.