Skip to content

test(opencode): cover message ID rollover loop - #150

Merged
MagMueller merged 1 commit into
mainfrom
rollover-regression
Aug 15, 2026
Merged

test(opencode): cover message ID rollover loop#150
MagMueller merged 1 commit into
mainfrom
rollover-regression

Conversation

@MagMueller

@MagMueller MagMueller commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an exact regression for the August 14 message-ID rollover
  • construct an older completed turn whose IDs sort above a newer user message
  • prove the prompt loop reaches model lookup for the newer turn instead of silently exiting

This is the test-only follow-up to #149 and addresses the P3 Cubic review note. It does not change production behavior.

Verification

  • bun test test/session/prompt.test.ts -t 'nonmonotonic message IDs|message ID rollover' — 2 passed
  • bun typecheck in packages/opencode — passed
  • repository filtered typecheck in the push hook — 17/17 passed

Summary by cubic

Adds a regression test for the August 14 message‑ID rollover to ensure the prompt loop starts a new user turn instead of silently exiting. Previously the loop could exit when older completed turn IDs sorted above a newer user message; the test proves it now reaches provider model lookup for the newer turn.

Reviewer notes

  • Adds rolloverNoLLMServer test case in packages/opencode/test/session/prompt.test.ts.
  • Mocks a blocking provider via ProviderSvc.getModel to signal when model lookup begins.
  • Constructs an older completed assistant turn whose IDs sort above a newer user message and asserts prompt.loop starts the newer turn.
  • Test-only change; no production code or behavior modified.

Written for commit dbb9ba9. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@MagMueller
MagMueller merged commit e634099 into main Aug 15, 2026
3 checks passed
@MagMueller
MagMueller deleted the rollover-regression branch August 15, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant