-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Summary
Web sessions can enter an infinite assistant loop after a finished response.
Reproduction
- Run the opencode server on one machine
- Open the web UI from another machine
- Submit a prompt
- Observe that an assistant message finishes with
stop - Observe that the session immediately returns to
busyand creates another assistant message for the same user prompt
Root cause
The web app generates the user messageID in the browser, while assistant message IDs are generated on the server.
SessionPrompt.loop() uses message ID ordering to decide whether the latest finished assistant message belongs to the latest user message:
lastUser.id < lastAssistant.idThat ordering is not reliable across machines. The correct relationship is lastAssistant.parentID === lastUser.id.
Impact
- repeated assistant messages for the same user prompt
- hidden context growth
- increasingly strange follow-up outputs
- sessions appearing stuck in
busy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)