Files
hermes-agent/agent
Teknium 79b45d1647 fix: signed reasoning replays after resume on Anthropic and Bedrock Converse
What users saw
- Anthropic (last-turn-only Claude models, e.g. Sonnet 4.5): after `chat --resume`
  or on the next gateway/TUI turn, the previous answer's signed thinking block was
  stripped, so its reasoning was lost.
- Bedrock Converse (non-Claude reasoning models, e.g. deepseek.v3): every resumed
  or later turn sent prior reasoning without its signature, and Bedrock rejected it
  with ValidationException "The reasoning block signature is missing or invalid".
  Streamed reasoning was also stored as two concatenated copies.

Root causes
- 33d6139ccd replaced "keep the latest assistant turn" with "keep the in-flight
  tool loop". Once a new user message closes that loop, the latest turn lands
  before loop_start and its signed thinking is dropped.
- d6f3199584 persisted Converse reasoning into reasoning_details, so the reasoning
  extractor now also read it and duplicated the streamed text. On reload, non-Claude
  turns replayed that text with the signature removed, because they could not tell
  their own signatures apart from a foreign model's.

Fix
- anthropic_message_convert: loop_start never goes past the latest assistant turn.
- bedrock_adapter + transports/bedrock: Converse turns record the model that produced them (a private
  `bedrock.native_assistant` reasoning_details record). When the same model reads
  them back, they replay verbatim with signatures. Other models keep the per-model
  policy. reasoning_content is now joined per block, not per streamed delta.
- test_chat_reasoning_variants: the long-session Portal test asserted the old
  "never replay reasoning_details to the Portal" contract that 336b11584c
  removed on purpose. It now asserts every earlier turn's blocks replay verbatim
  and every turn is answered.
2026-10-11 03:07:37 -07:00
..
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
…
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:28:23 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:28:23 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
…
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 21:35:58 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 19:54:07 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 19:54:07 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 19:54:07 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 21:29:48 +02:00