What happened?
When an assistant makes multiple edits across several assistant messages within a single user turn, the turn changes summary at the bottom of the conversation only displays the changes from the last assistant message, not the cumulative changes of the entire turn.
This leads to confusing UX where the user sees a small diff (e.g., +31 -20) when in reality the assistant made substantial changes across multiple steps (e.g., +161 -126 followed by +31 -20).
Which area seems affected?
UI or design system
How much does this affect you?
Breaks an important workflow
Steps to reproduce
- Start a new session
- Ask the assistant to make changes to a file
- The assistant makes an edit (e.g., +161 -126)
- The assistant then makes another edit to fix an issue (e.g., +31 -20)
- Observe that the turn changes summary at the bottom only shows +31 -20, omitting the first edit entirely
What did you expect to happen?
The turn changes summary should reflect all file changes made during the entire user turn — from the user's last message to the point where the assistant finishes and waits for the next user input.
PawWork version
local (dev build)
OS version
macOS 15.3
Can you reproduce it again?
Yes, every time
Diagnostics
Root Cause
turnChangeMessageID in session-turn.tsx uses findLast to select only the last assistant message that has visible turn changes:
const turnChangeMessageID = createMemo(() => {
const messages = assistantMessages()
return (
messages.findLast((item) => item.time.completed && hasVisibleTurnChanges(props.turnChanges?.[item.id]))?.id ??
messages.findLast((item) => item.time.completed)?.id
)
})
The server records turn changes per assistant messageID, not per user turn. When multiple assistant messages each have their own TurnChangeDisplay, only the last one's stats are surfaced in the UI.
Evidence
From a recent session export, two edit tool calls were made in separate assistant messages (msg_df1c89ad... and msg_df1c8fcb...) under the same user message. The UI only showed the second message's stats (+31 -20) while omitting the first (+161 -126).
Affected Code
packages/ui/src/components/session-turn.tsx — turnChangeMessageID logic
packages/app/src/pages/session/message-timeline.tsx — turnChanges store and fetch logic
packages/opencode/src/session/turn-change.ts — server-side turn change recording
Suggested Fix
Option A (client-side): Accumulate TurnChangeDisplay.files across all assistant messages belonging to the same user turn, merging stats for files touched multiple times.
Option B (server-side): Record turn changes at the user-turn level rather than per assistant message.
What happened?
When an assistant makes multiple edits across several assistant messages within a single user turn, the turn changes summary at the bottom of the conversation only displays the changes from the last assistant message, not the cumulative changes of the entire turn.
This leads to confusing UX where the user sees a small diff (e.g., +31 -20) when in reality the assistant made substantial changes across multiple steps (e.g., +161 -126 followed by +31 -20).
Which area seems affected?
UI or design system
How much does this affect you?
Breaks an important workflow
Steps to reproduce
What did you expect to happen?
The turn changes summary should reflect all file changes made during the entire user turn — from the user's last message to the point where the assistant finishes and waits for the next user input.
PawWork version
local (dev build)
OS version
macOS 15.3
Can you reproduce it again?
Yes, every time
Diagnostics
Root Cause
turnChangeMessageIDinsession-turn.tsxusesfindLastto select only the last assistant message that has visible turn changes:The server records turn changes per assistant
messageID, not per user turn. When multiple assistant messages each have their ownTurnChangeDisplay, only the last one's stats are surfaced in the UI.Evidence
From a recent session export, two
edittool calls were made in separate assistant messages (msg_df1c89ad...andmsg_df1c8fcb...) under the same user message. The UI only showed the second message's stats (+31 -20) while omitting the first (+161 -126).Affected Code
packages/ui/src/components/session-turn.tsx—turnChangeMessageIDlogicpackages/app/src/pages/session/message-timeline.tsx—turnChangesstore and fetch logicpackages/opencode/src/session/turn-change.ts— server-side turn change recordingSuggested Fix
Option A (client-side): Accumulate
TurnChangeDisplay.filesacross all assistant messages belonging to the same user turn, merging stats for files touched multiple times.Option B (server-side): Record turn changes at the user-turn level rather than per assistant message.