Uh oh!
There was an error while loading. Please reload this page.
fix: slash command message ordering in timeline - #38612
Conversation
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
382d543 to
7b4aa5eCompareSort messages by time.created in both model.ts and message-timeline.tsx to fix event-stream race condition where slash command output arrives before previous turn final events, causing incorrect timeline positioning. - model.ts: sort messages in the messages memo by time.created (id as tiebreaker), fixing ordering at the data source - message-timeline.tsx: add orderedMessages memo as defensive layer, passing sorted messages to createTimelineProjection
7b4aa5e to
c18980eCompareThanks for updating your PR! It now meets our contributing guidelines. 👍 |
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes#38613
Type of change
What does this PR do?
Fix the WebChat slash command message ordering bug where command output appears at the wrong position in the timeline.
Root cause: event-stream race condition — when slash command output messages arrive before the previous turn's final flush events, the sync data array contains messages in the wrong order. Both
model.tsandmessage-timeline.tsxuse the unsorted sync array directly.Fix:
time.createdin themessagesmemo (id as tiebreaker), fixing ordering at the data sourceorderedMessagesmemo as defensive layer, passing sorted messages tocreateTimelineProjectioninstead of rawsessionMessagesHow did you verify your code works?
Screenshots / recordings
Not applicable — behavioral fix, no UI changes.
Checklist