Skip to content

Message ordering breaks with clock-skewed IDs #17255

@sjawhar

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.tsshouldExitLoop parentID comparison
  • session-turn.tsx — message boundary display

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