ai-claude-code and ai-sandbox: add "sideEffects": false so translateSdkStream tree-shakes
维护者通常 1 天内回复
@tombeckenham 已经在做这个了。
开始于 2026年11月4日。
评估
这个 Issue 还没有评估数据。
描述
TanStack AI version
@tanstack/ai-claude-code 1.0.1, @tanstack/ai-sandbox 1.1.0 (@tanstack/ai 1.1.0)
Framework/Library version
Vite 8.0.0 (Rolldown), TanStack Start 1.169, Nitro 3
Describe the bug and the steps to reproduce it
@tanstack/ai and @tanstack/ai-skills set "sideEffects": false in package.json. @tanstack/ai-claude-code and @tanstack/ai-sandbox do not. So a bundler must keep every module that the root entry of @tanstack/ai-claude-code imports, also when the app uses only translateSdkStream.
- Import only the translator in a server module:
import { translateSdkStream } from "@tanstack/ai-claude-code" - Build with Vite 8 (Rolldown).
- The server output keeps side-effect imports of
@modelcontextprotocol/sdk(types.jsplusajv, about 475 kB) and ofhonowith@hono/node-server(about 27 kB). They come from@tanstack/ai-sandbox/dist/esm/tool-bridge.jsthrough the root entry of@tanstack/ai-claude-code. No sandbox code is called.
With this Rolldown rule, both imports go away and the build still works:
build: {
rolldownOptions: {
treeshake: {
moduleSideEffects: [
{ test: /\/@tanstack\/ai-(claude-code|sandbox)\//, sideEffects: false },
],
},
},
},
Expected: "sideEffects": false in both packages, as in @tanstack/ai. A subpath export for the translator, such as @tanstack/ai-claude-code/translate, would also let an app that only translates stream-json skip the required @tanstack/ai-sandbox peer.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
The steps above. The rule shows the fix.
- 主要语言
- TypeScript
- 星标
- 3.3k
- 派生
- 378
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 254
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/ai 的其他 Issue
-
openai-base: a Responses max_output_tokens cutoff ends as RUN_ERROR without usage instead of finishReason 'length'可能已有人在做 @tombeckenham 于 8 天前认领。 未关闭has-pr waiting-on: maintainer
难度 2/5 1-3 小时 新手友好度 74/100
TanStack/ai#1916 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
AG-UI TOOL_CALL_RESULT metadata is dropped in the live stream reducer可能已有人在做 @c446984928 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
维护者通常 1 天内回复
-
ai-sandbox: encrypt snapshot blobs at rest with an encrypting blob store wrapper可能已有人在做 @AlemTuzlak 于 1 天前认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
-
Sandbox takeover: the saved transcript loses everything the first host delivered before the restart可能已有人在做 @tombeckenham 于 1 天前认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
-
withSandbox: each run's save drops the harness tool calls of earlier runs可能已有人在做 @tombeckenham 于 1 天前认领。 未关闭has-pr waiting-on: maintainer
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
Yeraze/meshmonitor#6239 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
better-auth/better-auth#12292 · 1 个 reaction ·
维护者通常 1 天内回复
-
The sample email preview's ResizeObserver is never disconnected and keeps raising errors after leaving Settings可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
area:ui bug effort:S priority:P2
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Typo in WSL project description on Projects page可能已有人在做 @akhil9tiet 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 75/100
microsoft/opensource.microsoft.com#1066 · 1 条评论 ·