Skip to content
PidebugWeb1 file · +6 −3

Fix tool block auto-expand bug across sessions in Vue chat UI

Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk

30msession
0interventions
GOAL

Investigate a bug where tool call blocks in the chat transcript UI would randomly expand on their own, and fix the root cause.

  1. Prompt · +22m
    Tool blocks keep expanding on their own, figure out why
  2. Agent did · +23m
    Searched and read through ChatTranscript.vue, transcript.ts, bridge types.ts, and useBridgeClient.ts to trace how tool block expand/collapse state keys are generated and stored
  3. Agent did · +27m
    Edited ChatTranscript.vue to scope the toolBlockKey function by sessionPath so expand state isn't shared across sessions with reused message keys
  4. Agent did · +28m
    Ran pnpm build:web to verify the fix builds successfully
  5. Agent did · +29m
    Re-checked toolBlockKey implementation, the ChatTranscript session-path prop wiring in AppMainContent.vue, and the transcriptKey normalization in useBridgeClient.ts to confirm the root cause and fix location
  6. Outcome · +30m
    Root cause identified: ChatTranscript.vue is reused across sessions and its message keys (e.g. snapshot:${index}) can repeat, so tool block expand state leaked between sessions. Fixed by scoping toolBlockKey with sessionPath; pnpm build:web passed.
VERDICT

Next time I'd describe the bug with more specifics up front, like which sessions or scroll actions trigger it, since that would have saved a lot of exploratory code reading. The fix itself worked on the first try once the agent traced the key reuse across the reused ChatTranscript component, but I haven't confirmed yet that the actual repro case (switching sessions) is fixed since I never followed up with an interruption or further test.

I tried this · 0

Discussion · 0

How Builds work