Description
When the client and server clocks are out of sync (e.g. browser on a local machine, server on a
remote host), client-generated message IDs sort after server-generated assistant IDs because IDs are
timestamp-based. This causes two bugs:
- Prompt loop never exits — the exit check compares user vs assistant message IDs by sort order.
With clock skew, the user ID is always "newer" so the condition never triggers, causing 15+ loop
iterations instead of 1.
- Assistant messages not rendered — SessionTurn only scans forward from the user message index to
find assistant replies. With skewed IDs, the assistant sorts before the user message and is never
found.
I was trying to use opencode on my coder.com env and i would basically see no responses in web ui while llm usage was going up, but TUI was completely fine
Expected behavior
The prompt loop should exit after one iteration and assistant messages should render regardless of
clock differences between client and server.
Plugins
None
OpenCode version
1.2.6
Steps to reproduce
- Run the OpenCode server on a remote host where the clock differs from the client browser by
several seconds
- Send a prompt
- Observe the prompt loop running many iterations and assistant messages not appearing in the UI
Screenshot and/or share link
No response
Operating System
Linux
Terminal
No response
Description
When the client and server clocks are out of sync (e.g. browser on a local machine, server on a
remote host), client-generated message IDs sort after server-generated assistant IDs because IDs are
timestamp-based. This causes two bugs:
With clock skew, the user ID is always "newer" so the condition never triggers, causing 15+ loop
iterations instead of 1.
find assistant replies. With skewed IDs, the assistant sorts before the user message and is never
found.
I was trying to use opencode on my coder.com env and i would basically see no responses in web ui while llm usage was going up, but TUI was completely fine
Expected behavior
The prompt loop should exit after one iteration and assistant messages should render regardless of
clock differences between client and server.
Plugins
None
OpenCode version
1.2.6
Steps to reproduce
several seconds
Screenshot and/or share link
No response
Operating System
Linux
Terminal
No response