Fix Fast provider retry settlement - #1482
Merged
daniel-lxs merged 1 commit intoAug 19, 2026
Merged
Conversation
Contributor
| // and abort does not roll it back. Discard the failed session | ||
| // and rebuild from visible compatibility history instead of | ||
| // appending the same turn to a poisoned transcript. | ||
| openCodeSession.id = undefined; |
Contributor
There was a problem hiding this comment.
Resetting the session ID here leaves the failed session's native-tool executor bound until the replacement reaches onSessionReady (or the outer finally). runNonTaskSdkPrompt explicitly treats session.abort as non-guaranteed, so that old turn can still call the bridge during this retry window and trigger a visible reply, integration call, or task operation; the replacement then replays the same turn. Unbind the failed session before scheduling the retry so stale calls are rejected.
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.
What changed
session.errorevents and resolved prompt results while preserving the original structured causeWhy
The same provider rejection could previously follow two different paths: a streamed session error preserved the status code, while a resolved prompt result wrapped it in a plain
Errorand lost the structured metadata. That made retry and terminal reporting depend on event ordering.Retrying in the same persistent session also appended the same user turn after abort, and retrying after native tools had run could replay visible or external side effects. Terminal closeouts posted by Roomote were mirrored for rollback compatibility but were absent from the live OpenCode transcript, so a follow-up could not explain the error the user had just seen.
This PR is stacked on #1466 and is intended to merge into
codex/fast-mode-provider-retries.Validation
pnpm --filter @roomote/cloud-agents exec vitest run(99 files, 792 tests)pnpm check-typespnpm lintpnpm knip