fix(opencode): finish prompt loop by parent link - #40099
Open
miaojixuezhang wants to merge 1 commit into
Open
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one highly relevant related PR: Potential Related PR:
This PR seems directly related to the current PR #40099, as both fix the prompt loop logic by switching from ID-based comparison to parent-link-based logic. However, since PR #38387 already exists, you may want to verify if:
|
miaojixuezhang
marked this pull request as ready for review
August 1, 2026 20:57
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #40098
Type of change
What does this PR do?
A finished assistant turn is linked to its user message by
parentID. Comparing their IDs assumes the client and server clocks agree; when a client clock is ahead, the prompt loop can run the completed turn again. This uses the parent link instead and adds a regression test with deliberately reversed ID order.How did you verify your code works?
bun test test/session/prompt.test.ts— 57 pass, 1 skip.bun typecheckfrompackages/opencode.Screenshots / recordings
Not applicable; this is a prompt-loop fix.
Checklist