Files
magpie/internal
yetone b587eb3069 claude: a summary request branches before its call's line is read (#6128, recih on X)
park() marks a streamed call with the conversation it answered while its
callLine.uuid is still empty. branch()'s no-call path only took lines with a
uuid, so it skipped the call and logged "no run waits on a reply to this
conversation". Claude Code can write the call's transcript line late, after
the tool has run, so waiting for the uuid never helps.

branch() now also takes pending lines with no uuid whose conversation
matches, records their tool-call ids in savedSession.cutCalls, and
cutSessionBeforeCalls cuts the session before the first assistant line
holding one of them. It asks again until cutWait; if the line never appears
the session as it stands on disk is already the conversation before the call.
A line whose uuid is known still wins. The match is still on the conversation
before the reply and on the run's own account.

Run (through mote-run): go vet for darwin, windows and linux; gofmt -l clean;
go test -count=1 -timeout 45m ./internal/gateway: one red,
TestKeyLimitReservationsStayInTheirWindow total/tokens and total/cost, which
is red at base 7a606eecd without this change and is #6165.
TestClaudeBranchForSummaryBeforeTheCallLineIsRead covers a parked call with
no uuid, a call line written 60ms into the cut, and a line that never comes.
Broke it by hand (len(unread) ignored): red with recih's message.

Not tried: a real TUI run. Other code that needs a uuid (noteLines, cutSessionAt)
was read: they guard lines noted from Claude Code's output and are not
reached by this path.
2026-11-11 23:02:04 +08:00
..
…
…
…
…
…
2026-11-11 08:14:28 +08:00
…
…