withSandbox fails with "never called provide()" when the sandbox has no workspace
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.3k
- Forks
- 378
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 254
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/ai
-
openai-base: a Responses max_output_tokens cutoff ends as RUN_ERROR without usage instead of finishReason 'length'Posiblemente ocupada @tombeckenham la tomó hace 8 días. Abiertohas-pr waiting-on: maintainer
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
TanStack/ai#1916 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
AG-UI TOOL_CALL_RESULT metadata is dropped in the live stream reducerPosiblemente ocupada @c446984928 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
ai-sandbox: encrypt snapshot blobs at rest with an encrypting blob store wrapperPosiblemente ocupada @AlemTuzlak la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#2062 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Sandbox takeover: the saved transcript loses everything the first host delivered before the restartPosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#2061 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
withSandbox: each run's save drops the harness tool calls of earlier runsPosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertohas-pr waiting-on: maintainer
TanStack/ai#2059 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/ai
Issues similares
-
bug needs-triage potential-regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws/aws-sdk-js-v3#8408 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
colinhacks/zod#6743 ·
Los mantenedores suelen responder en 1 día
-
[BUG] Packing list: the weight field drops digits on a slow connection and saves the wrong weightAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
openai/openai-node#3124 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
anthropics/anthropic-sdk-typescript#1296 ·
Los mantenedores suelen responder en 8 días