anomalyco / anomalyco/opencode
WebChat: slash command output appears at wrong position in timeline
@Brendonovich is already working on this.
Since Jul 24, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Describe the bug
In WebChat, when using slash commands (e.g. /memory, /plan), the command output sometimes appears at the wrong position in the timeline — above the previous message instead of below it.
To Reproduce
- Complete a normal chat turn (send a message, wait for AI response)
- Immediately send a slash command (e.g.
/memory status) - Observe that the slash command output may appear above the previous AI response
Expected behavior
Slash command output should always appear in chronological order at the bottom of the conversation.
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. The messages memo in model.ts and the createTimelineProjection call in message-timeline.tsx both use the unsorted sync array directly.
Proposed Fix
model.ts: sort messages bytime.createdin the messages memomessage-timeline.tsx: addorderedMessagesmemo as defensive layer
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.