Files
adnaan 6f1f5ba907 refactor(store): name the three stream-phase predicates instead of inlining them
TURN_ACTIVE_PHASES / REQUEST_IN_FLIGHT_PHASES / OVERLAY_AUTHORITATIVE_PHASES now
live side by side in types/thread.ts, each documenting the distinct question it
answers and what collapsing it into another one would break:

- dropping tool_pending from TURN_ACTIVE_PHASES hides the active state while the
  user is deciding on an approval
- adding tool_pending to REQUEST_IN_FLIGHT_PHASES suspends session persistence
  indefinitely during human decisions
- adding tool_running to OVERLAY_AUTHORITATIVE_PHASES widens the memo window and
  amplifies writes that change the messages reference without bumping the version

Call sites (selectMessageListState, selectIsStreaming, the ChatMessage live
selector, useMessageQueue) now reference the sets. useMessageQueue's comment
claimed parity with selectIsStreaming while the code included tool_pending; the
code was right, the comment is now accurate. The doc also records that
startToolExecution writes 'tool_running' but the restore lives in
core/tools.ts executeToolCalls, which is the hardest coupling in the subsystem.
2026-08-30 23:36:52 +08:00
..