Skip to content

fix(opencode): order legacy message loop by time - #40990

Merged
thdxr merged 1 commit into
devfrom
message-loop-order
Aug 7, 2026
Merged

fix(opencode): order legacy message loop by time#40990
thdxr merged 1 commit into
devfrom
message-loop-order

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • select the latest user, assistant, and completed assistant by creation time with ID as a same-millisecond tie-breaker
  • apply the same ordering to pending compaction and subtask work
  • end a completed response loop when the assistant points to the latest user through parentID
  • preserve existing tool-call continuation behavior

Testing

  • bun test test/session/message-v2.test.ts --timeout 30000 --only-failures (39 passed)
  • bun test test/session/prompt.test.ts --test-name-pattern "loop exits for a completed parent turn" --timeout 30000 --only-failures (1 passed)
  • Full prompt test file in implementation worktree (57 passed, 1 skipped)
  • Prettier
  • git diff --check

Requested by: @thdxr (Dax Raad via Slack)

@thdxr
thdxr enabled auto-merge (squash) August 7, 2026 03:56
@thdxr
thdxr merged commit db581e4 into dev Aug 7, 2026
11 checks passed
@thdxr
thdxr deleted the message-loop-order branch August 7, 2026 04:08
HQ123-BOOP pushed a commit to HQ123-BOOP/LibreCode that referenced this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant