fix(sandbox-vercel): forward credentials when resuming sessions#16500
Open
doneumark wants to merge 2 commits into
Open
fix(sandbox-vercel): forward credentials when resuming sessions#16500doneumark wants to merge 2 commits into
doneumark wants to merge 2 commits into
Conversation
4c2b7f0 to
06aa1dc
Compare
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.
Background
@ai-sdk/sandbox-vercelforwards Vercel Sandbox create settings intoSandbox.create()andSandbox.getOrCreate(), including access-token credentials (token,teamId,projectId). However,resumeSession()reattaches by callingSandbox.get({ name })without forwarding those settings.In non-Vercel environments that use access-token auth, first session creation succeeds but a later
agent.createSession({ sessionId, resumeFrom })can fail when the provider tries to resume the named sandbox and@vercel/sandboxfalls back to OIDC:Summary
Sandbox.get()fromresumeSession().Sandbox.getOrCreate().token,teamId,projectId, andsignal.@ai-sdk/sandbox-vercel.Manual Verification
I verified the failure mode against the installed package source by reproducing the code path where
createSession()uses access-token settings butresumeSession()callsSandbox.get({ name })without them. The updated unit test covers the credential forwarding needed for that path.Automated checks run locally:
Note:
pnpm --filter @ai-sdk/harness buildwas also attempted after building@ai-sdk/provider-utils, but its DTS build failed resolving@ai-sdk/provider-utilsdeclarations. The focused@ai-sdk/sandbox-verceltests/typecheck/build pass after dependencies are installed.Checklist
pnpm changesetin the project root)Related Issues
No existing issue found when searching
vercel/aiandvercel/sandboxforsandbox-vercel resumeSession Sandbox.get credentials.Made with Cursor