fix(opencode): finish prompt loop by parent link - #40099
Conversation
|
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:
|
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
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