Files
orca/config/scripts
Brennan Benson 4c2a2ac3d9 A Claude chat shows the turns made outside it (#31615)
* A Claude chat shows the turns made outside it

When a Claude chat's agent next opens, turns written to the same
conversation elsewhere (claude --resume in a terminal) are appended once,
in order, under the existing "Continued outside this chat." divider.

Streamed reply and thinking rows are now keyed by their source block
(message id and block index), which Claude also saves on each transcript
row, so the chat can tell which saved rows it already shows. The read goes
back from the end of the transcript only to the chat's saved turn-end leaf,
replays the rows through Claude's own translator in an isolated sink, and
commits them in one settlement that writes nothing if the chat moved.
Imported prompts are display-only and never settle a send; any failure
opens the chat normally.

* test(claude): name the transcript row shapes the catch-up test builds

* fix(claude): read a catch-up row's uuid once as a string

* fix(claude): parse transcript tail rows without type assertions

* refactor(native-chat): share the catch-up open runner across agents

The Codex catch-up's agent-neutral parts move to one module: the open-time
envelope (its own deadline and cancellation, never gating the open), the
bounded staged batch, the single settlement commit that re-checks the
journal before writing, and the "Continued outside this chat." divider.
Codex keeps only how it reads its saved turns and what the chat already
holds. No behavior change; the other agents' catch-up builds on this
instead of copying it.

* refactor(claude): catch up through the shared history catch-up runner

* chore: remove unrelated pnpm executable metadata

* refactor(native-chat): the catch-up runner reads the chat's view only when the agent asks

* chore: remove regenerated pnpm executable metadata

* fix(native-chat): the catch-up deadline also bounds waiting for its commit to be written

A journal write barrier that never settled after the import was admitted held
the provider's open past the catch-up deadline. The wait now ends with the
deadline or the open's cancellation, like every other step.

* test: type the history catch-up sink fixture without assertions

* fix(native-chat): bound and revoke history preparation

* test(claude): expect source block identity in stream cadence

* fix(claude): preserve final output and history coverage

* feat(native-chat): validate expected saved items during history catch-up

* fix(claude): integrate conditional history settlement

* fix(claude): use new content and provider prompt identities for catch-up

* fix(claude): retain qualified completed leaves through session exit

* fix(claude): preserve unresolved membership for recovered follow-ups

* test(claude): use fork epoch reason for rewind preservation

* fix(claude): consolidate translator sink type imports

* fix(claude): preserve source message times during catch-up

* fix(claude): narrow staged history mutations to items

* test: bound Claude retained-leaf catch-up work

* fix(claude): settle imported work at source boundaries

* test(claude): keep shared journal harness portable

* test(mobile): await editor listener cleanup before snapshot

* test: isolate retained slice measurements and accept closed socket EPIPE
2026-10-24 00:51:33 -07:00
..
2026-05-15 05:44:25 -04:00