withSandbox fails with "never called provide()" when the sandbox has no workspace
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
TanStack AI version
@tanstack/ai 1.1.0, @tanstack/ai-sandbox 1.1.0, @tanstack/ai-sandbox-local-process 1.0.0
Framework/Library version
Node.js 26.13.0 and 24.22.2. No UI framework.
Describe the bug and the steps to reproduce it
workspace is optional on SandboxConfig, but a sandbox without one fails at the first chat():
Middleware "sandbox" declares it provides "sandbox-projection" but never called provide() in setup().
Expected: the run works and projects nothing. Or, if a workspace is necessary, the type makes workspace required.
Steps. Run pnpm install && pnpm start. It needs no API key, because the model is fakeText from @tanstack/ai/testing.
const sandbox = defineSandbox({
id: 'no-workspace',
provider: localProcessSandbox(),
// no `workspace`
})
chat({
adapter, // fakeText() with one scripted answer
threadId: 'thread-1',
messages: [{ role: 'user', content: 'hi' }],
middleware: [withSandbox(sandbox)],
})
Output, the same in 3 of 3 runs:
FAILED: Middleware "sandbox" declares it provides "sandbox-projection" but never called provide() in setup().
We hit this with a sandbox that resumes an existing provider sandbox, which already holds its files. A workaround is workspace: defineWorkspace({ source: { type: 'none' } }). With that, the same script finishes.
Suspected cause (not confirmed). withSandbox lists ProjectionCapability in provides (middleware.ts), but it calls provideWorkspaceProjection only inside if (workspace !== undefined).
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://github.com/adelrodriguez/tanstack-ai-repros/tree/main/withsandbox-without-workspace
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
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.
- Lingua principale
- TypeScript
- Stelle
- 3.3k
- Fork
- 378
- Merge medio
- 1g 2h
- PR unite (30g)
- 254
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/ai
-
openai-base: a Responses max_output_tokens cutoff ends as RUN_ERROR without usage instead of finishReason 'length'Forse già presa @tombeckenham l’ha presa 8 giorni fa. Apertahas-pr waiting-on: maintainer
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
TanStack/ai#1916 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
AG-UI TOOL_CALL_RESULT metadata is dropped in the live stream reducerForse già presa @c446984928 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
ai-sandbox: encrypt snapshot blobs at rest with an encrypting blob store wrapperForse già presa @AlemTuzlak l’ha presa 1 giorno fa. Apertawaiting-on: maintainer
TanStack/ai#2062 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Sandbox takeover: the saved transcript loses everything the first host delivered before the restartForse già presa @tombeckenham l’ha presa 1 giorno fa. Apertawaiting-on: maintainer
TanStack/ai#2061 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
withSandbox: each run's save drops the harness tool calls of earlier runsForse già presa @tombeckenham l’ha presa 1 giorno fa. Apertahas-pr waiting-on: maintainer
TanStack/ai#2059 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
bug needs-triage potential-regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aws/aws-sdk-js-v3#8408 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
colinhacks/zod#6743 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Packing list: the weight field drops digits on a slow connection and saves the wrong weightAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
openai/openai-node#3124 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
anthropics/anthropic-sdk-typescript#1296 ·
I maintainer di solito rispondono entro 8 giorni