ai-sandbox: rotating Git source credentials changes the sandbox key
@AlemTuzlak is already working on this.
Since Sep 23, 2026.
Assessment
This issue has not been assessed yet.
Description
TanStack AI version
@tanstack/[email protected], @tanstack/[email protected], @tanstack/[email protected] (npm latest versions when tested).
Framework/Library version
No UI framework. Bun 1.4.2 on Linux.
Describe the bug and the steps to reproduce it
Changing only gitSource({ auth: { token } }) changes the sandbox instance key, even with the same threadId, sandbox ID, repository, and reuse: 'thread'.
This comes up with GitHub App installation tokens, which expire after one hour. Renewing the token changes the lookup key, so a later run cannot find the previous sandbox record even if its container is still available.
To reproduce, download the three files from the gist below and run:
bun install
bun repro.ts
The script computes keys before and after changing a Git token, then does the same for a workspace secret. It does not create a sandbox or make any network requests; no Docker daemon or real credentials are needed to run it.
Actual output:
Git token rotation changes key: true
Workspace secret rotation changes key: false
Expected: both comparisons return false. Renewing a credential with equivalent access should not by itself invalidate sandbox reuse.
In computeWorkspaceHash(), workspace.secrets is excluded, but source.auth.token remains in the hashed object. gitSource accepts a string token and bootstrap forwards it directly to handle.git.clone().
The provisioning guide documents SecretRef authentication for gitSkill, but the main workspace source does not accept it. Is there a supported way to use rotating credentials for the main Git source without changing its sandbox key?
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://gist.github.com/HCaupert/c42a7faf5b38dec95d43b0aa98abc501
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 331
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 155
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TanStack/ai
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
waiting-on: maintainer
-
waiting-on: maintainer
Difficulty 3/5 1-2 days Newbie friendliness 70/100
-
waiting-on: maintainer
-
waiting-on: maintainer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
IBM/node-sdk-core#373 ·
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 88/100