Back off vault version-check retries and persist rotated refresh tokens first - #1779
Merged
Conversation
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | c576efa | Commit Preview URL Branch Preview URL |
Aug 27 2026, 08:35 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 5a9ae3d | Aug 27 2026, 10:25 PM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
RhysSullivan
force-pushed
the
fix/vault-write-retry-ordering
branch
from
August 27, 2026 20:32
0aa3d9d to
c576efa
Compare
RhysSullivan
marked this pull request as ready for review
August 28, 2026 01:52
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.
Problem
Two bugs on the credential-persistence path. In production both showed up as a request that refreshed an OAuth token coming back a bare 500, and the second one left the connection permanently broken afterwards.
invalid_grantand the connection silently disconnected itself.Fix
persistRefreshedTokenwrites the rotated refresh token before the access token.Testing
New cloud e2e
e2e/cloud/credential-write-durability.test.tscovers both halves black box. It drives a real OAuth refresh through MCP and arms the failures on the WorkOS emulator the product's own client talks to. Contention is modelled two ways, because the two halves of the write policy fail differently:Every scenario reads the emulator's ledger back and asserts the collisions it armed were really served, so a fault whose pattern stopped matching cannot leave a test that passes without ever contending.
All three fail against the pre-fix code (
Internal tool error, and a dead grant on the recovery call) and pass with it. Removing the backoff, restoring the old write order, and shrinking the attempt budget each turn one of them red.No unit tests were added: the e2e scenarios observe everything here. The one unit change is clock mode in the existing workos-vault suite, because a conflicted write now waits before retrying and the TestClock never advances that wait.
Not in scope: refreshes are single-flight only within one request, so concurrent probes of one connection still produce concurrent writers. A cross-request refresh lease is the structural fix and is its own change.