You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prompt loop may repeat a completed turn when client clock is ahead #40098
The legacy prompt loop treats a finished assistant as newer only when lastUser.id < lastAssistant.id. These IDs can be generated on different devices and contain local time. If a web or mobile client clock is ahead of the server, a finished assistant can correctly reference the user through parentID but sort lower, so loop() starts another provider turn and may produce a duplicate response.
Plugins
None required.
OpenCode version
Current dev at 32f278b48f1a495611165d8a9f1ace0b512933e2 (packages/opencode 1.18.11).
Steps to reproduce
Store a user message with ID msg_ffff_client_clock.
Store a finished assistant message with ID msg_0000_server_clock and parentID set to that user ID.
Call SessionPrompt.loop() with no LLM server available.
The loop does not exit and the regression test times out while entering the provider path.
The parent link is the reliable turn relationship; ID ordering is not reliable across clocks.
Screenshot and/or share link
Not applicable; reproduced with a focused unit test.
Operating System
Observed from a mobile web client and reproduced in the test suite on macOS.
Activity
github-actions commentedon Aug 1, 2026
This issue might be a duplicate of existing issues. Please check:
lastUser.id < lastAssistant.idexit condition bug, concrete evidence of duplicate responseslastAssistant.parentID === lastUser.idinstead of ID sort)github-actions commentedon Oct 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.