Session still crashes with "JSON.stringify cannot serialize BigInt" after parallel scratch queries
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- sql, typescript
- 领域
- backend
调研方向
Start with the existing guard in packages/opencode/src/session/llm.ts around line 112 and the helper in packages/opencode/src/altimate/util/json.ts, which normalises BigInt values for outgoing model messages. Then reproduce with four parallel sql_execute calls returning BIGINT columns to find the unguarded path where tool results are stored, persisted or traced. Done means a session-level test covering that scenario and a second model turn completes, with stored and traced results JSON-serializable.
由索引模型根据 Issue 内容生成。
描述
Problem
A session died with UnknownError: JSON.stringify cannot serialize BigInt. after four parallel scratch sql_execute calls returned BIGINT counts. The run exited with status 1 and no answer, even though the answer had already been computed.
Mechanism
normalizeBigInts(input.messages) already guards outgoing model messages (packages/opencode/src/session/llm.ts:112, packages/opencode/src/altimate/util/json.ts:7), and an earlier fix landed for the same error. A different serialization path (tool-result storage, session persistence or tracing; the exact call site is not yet identified) is still unguarded when DuckDB returns BIGINT values from several concurrent tool calls.
Evidence
- 1 session out of about 1,255 scanned; it had the final table in hand at 47 s and then crashed on the next turn. The build already contained the earlier
normalizeBigIntsfix. - Not seen in sessions with Claude Opus.
Impact
Answer-losing but rare. Fatal when it happens.
Proposed fix
Normalise tool results to JSON-safe values at the single point where a tool result is stored, not only on outgoing model messages (BigInt to number when safe, string otherwise). Find the remaining throw site by reproducing with four parallel BIGINT-returning scratch queries.
Acceptance check
Session-level test: four parallel scratch sql_execute calls returning BIGINT columns, followed by a second model turn, completes without error and the stored/traced results are JSON-serializable.
- 主要语言
- TypeScript
- 星标
- 810
- 派生
- 121
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 88
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AltimateAI/altimate-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
AltimateAI/altimate-code#1454 ·
维护者通常 1 天内回复
-
test: MCP tests fail when the developer's ~/.claude.json has MCP servers (HOME is not sandboxed)未关闭
难度 2/5 1-3 小时 新手友好度 78/100
AltimateAI/altimate-code#1386 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
AltimateAI/altimate-code#1384 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
AltimateAI/altimate-code#1323 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
AltimateAI/altimate-code#1288 ·
维护者通常 1 天内回复
查看 AltimateAI/altimate-code 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
radix-ui/primitives#4228 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 2/5 1-3 小时 新手友好度 70/100
SignalK/freeboard-sk#1093 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[测试] 等待仓库加载后再记录多仓库排序基线可能已有人在做 @myot233 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复