Skip to content

Message ordering breaks with clock-skewed IDs #17255

Closed as not planned
Closed as not planned

Description

@sjawhar

Several places in the frontend compare message IDs with > / >= operators to determine ordering (session restore, fork boundaries, timeline queuing). This assumes IDs sort lexicographically in creation order, which breaks when messages arrive with clock skew.

Additionally, shouldExitLoop in prompt.ts doesn't guard against undefined parentID, which can cause the prompt loop to continue indefinitely instead of exiting.

Affected areas:

  • session.tsx — restore/fork cutoff logic
  • message-timeline.tsx — queued message filtering
  • prompt.ts — shouldExitLoop parentID comparison
  • session-turn.tsx — message boundary display

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 12, 2026
  2. github-actions commented on Mar 12, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Please use one of the three required templates (Bug Report, Feature Request, or Question). For a bug report, this means including fields like Description, Steps to Reproduce, OpenCode version, and Operating System.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. sjawhar commented on Mar 12, 2026

    @sjawhar
    Author

    Duplicate of #11863. PR #17256 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions