Skip to content

fix: preserve Chat thinking block order - #41

Merged
klioen merged 2 commits into
mainfrom
fix/chat-thinking-order
Sep 23, 2026
Merged

klioen merged 2 commits into
mainfrom
fix/chat-thinking-order

Conversation

@klioen

@klioen klioen commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve Pi assistant content block order across thinking, text, and tool calls
  • use stable block-level IDs so streaming updates replace blocks without moving them
  • keep restored snapshots and live event timelines consistent
  • preserve visible provider errors when no text block exists

Root cause

SpireCode aggregated every assistant text block into one message and inserted that message before iterating thinking blocks. The same message-first ordering was used for live events, so the reducer correctly retained the wrong initial position.

Validation

  • red regression test reproduced text -> thinking output from thinking -> text source
  • focused Chat tests: 3 files, 20 tests passed
  • pnpm check: 63 files, 384 tests passed; 18 release tests passed
  • git diff --check

@klioen
klioen merged commit b4eba1a into main Sep 23, 2026
3 of 4 checks passed
@klioen
klioen deleted the fix/chat-thinking-order branch September 23, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant