Yichen Jiang
7e95a00c8a
fix(llm): align replay state with assembled content and degrade unusable state
...
A max-tokens response that included a tool call persisted assembler-transformed
content next to replay metadata projected from the untransformed native message,
so the next request died in history reconstruction with INVALID_REPLAY_STATE and
the session stayed permanently stuck.
Write side: the finish chunk's replayState becomes a typed ReplayEnvelope —
opaque response-level metadata plus optional per-block entries aligned with the
emitted block sequence. BlockAssembler computes one keep/drop decision for
blocks and entries together, so stored metadata always describes stored content
and retained blocks keep their signatures. pi-ai splits its state into a
version-2 response half and per-block signature entries.
Read side: durable content is authoritative. toPiAssistant degrades any
unusable state — foreign kind, other versions (including the flat v1 form
already on disk), malformed metadata, or content/block mismatches — to the
existing provider-neutral conversion with an onReplayDegrade diagnostic instead
of failing the request, which un-bricks sessions poisoned before this change.
Covered by assembler and replay unit tests, an agent-loop continuation
regression, keyless real-composition continuation tests (native pruned-envelope
replay and legacy flat-state degrade), and the authored keyless snapshot
scenario max-tokens-continue through the assembled ACP app.
2026-08-15 16:07:30 +08:00
..
2026-08-09 11:33:14 +08:00
2026-07-25 16:43:07 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 01:21:12 +08:00
2026-08-09 11:02:16 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-04 17:36:14 +08:00
2026-07-25 15:11:17 +08:00
2026-08-04 17:36:14 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 11:33:14 +08:00
2026-07-31 19:21:16 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 17:26:57 +08:00
2026-08-09 17:26:57 +08:00
2026-08-05 10:57:53 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-04 17:36:14 +08:00
2026-07-24 12:21:10 +08:00
2026-08-04 17:36:14 +08:00
2026-08-09 11:33:14 +08:00
2026-07-30 21:14:03 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:33:14 +08:00
2026-08-08 02:15:44 +08:00
2026-08-09 11:33:14 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 15:35:02 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-09 11:33:14 +08:00
2026-08-06 20:34:57 +08:00
2026-08-09 11:33:14 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-11 18:01:25 +08:00
2026-07-30 14:34:08 +08:00
2026-07-30 14:34:08 +08:00
2026-07-30 14:34:08 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 11:02:16 +08:00
2026-08-08 01:10:57 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 16:39:34 +08:00
2026-08-09 15:35:02 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:33:14 +08:00
2026-08-07 22:52:19 +08:00
2026-08-09 11:33:14 +08:00
2026-08-12 12:30:19 +08:00
2026-08-09 21:10:59 +08:00
2026-08-12 12:30:19 +08:00
2026-08-12 09:59:19 +08:00
2026-08-08 11:49:42 -07:00
2026-08-12 09:59:19 +08:00
2026-08-09 11:33:14 +08:00
2026-08-02 12:45:36 +08:00
2026-08-09 11:33:14 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:02:16 +08:00
2026-07-30 15:06:28 +08:00
2026-08-09 11:02:16 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-09 11:33:14 +08:00
2026-07-31 01:36:20 +08:00
2026-08-09 11:33:14 +08:00
2026-08-12 12:30:19 +08:00
2026-08-09 21:10:59 +08:00
2026-08-12 12:30:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 12:30:19 +08:00
2026-08-09 17:26:57 +08:00
2026-08-12 12:30:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 11:33:14 +08:00
2026-08-02 12:51:10 +08:00
2026-08-09 11:33:14 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 11:33:14 +08:00
2026-08-02 05:58:45 -07:00
2026-08-09 11:33:14 +08:00
2026-08-09 11:02:16 +08:00
2026-08-06 17:46:18 +08:00
2026-08-09 11:02:16 +08:00
2026-08-09 11:33:14 +08:00
2026-08-02 13:26:08 +08:00
2026-08-09 11:33:14 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 12:30:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 13:46:14 +08:00
2026-08-12 23:51:46 +08:00
2026-08-12 23:51:46 +08:00
2026-08-12 23:51:46 +08:00
2026-08-09 11:02:16 +08:00
2026-08-07 23:45:28 +08:00
2026-08-09 11:02:16 +08:00
2026-08-12 12:30:19 +08:00
2026-08-09 15:35:02 +08:00
2026-08-12 12:30:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 11:02:16 +08:00
2026-08-07 22:52:19 +08:00
2026-08-09 11:02:16 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 09:59:19 +08:00
2026-08-11 12:38:57 +08:00
2026-08-12 09:59:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-09 11:33:14 +08:00
2026-08-07 22:04:04 +08:00
2026-08-09 11:33:14 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-12 02:16:39 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 12:30:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 09:59:19 +08:00
2026-08-11 17:43:09 +08:00
2026-08-12 09:59:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 23:28:15 +08:00
2026-08-12 23:28:15 +08:00
2026-08-12 23:28:15 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 12:30:19 +08:00
2026-08-10 14:35:13 +08:00
2026-08-12 12:30:19 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-10 22:19:14 +08:00
2026-08-10 22:19:14 +08:00
2026-08-10 22:19:14 +08:00
2026-08-13 13:31:30 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 13:31:30 +08:00
2026-08-11 16:48:41 +08:00
2026-08-11 16:48:41 +08:00
2026-08-11 16:48:41 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-11 14:26:18 +08:00
2026-08-11 14:26:18 +08:00
2026-08-11 14:26:18 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-13 00:54:38 +08:00
2026-08-12 23:51:46 +08:00
2026-08-12 23:51:46 +08:00
2026-08-12 23:51:46 +08:00
2026-08-12 21:43:35 +08:00
2026-08-12 21:43:35 +08:00
2026-08-12 21:43:35 +08:00
2026-08-12 15:36:27 +08:00
2026-08-12 15:36:27 +08:00
2026-08-12 15:36:27 +08:00
2026-08-12 12:50:45 +08:00
2026-08-12 12:50:45 +08:00
2026-08-12 12:50:45 +08:00
2026-08-13 15:16:12 +08:00
2026-08-13 15:16:12 +08:00
2026-08-13 15:16:12 +08:00
2026-08-13 15:16:12 +08:00
2026-08-13 15:16:12 +08:00
2026-08-13 15:16:12 +08:00
2026-08-13 15:16:11 +08:00
2026-08-13 15:16:11 +08:00
2026-08-13 15:16:11 +08:00
2026-08-13 15:09:21 +08:00
2026-08-13 15:09:21 +08:00
2026-08-13 15:09:21 +08:00
2026-08-13 13:15:47 +08:00
2026-08-13 13:15:47 +08:00
2026-08-13 13:15:47 +08:00
2026-08-15 16:07:30 +08:00
2026-08-15 16:07:30 +08:00
2026-08-15 16:07:30 +08:00