You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session still crashes with "JSON.stringify cannot serialize BigInt" after parallel scratch queries #1486
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 normalizeBigInts fix.
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.
This looks fixed on main. #1518 (Closes #1486) merged into feat/analyst-harness-dab-2026-10, not main, so the issue didn't auto-close. That branch landed on main via #1441 (squash commit b12bce3, 2026-10-16).
I checked the files #1518 changed against main: 224 of its 225 substantive added lines are on main as written. The other 1 lines read differently on main now. I did not diff each one, but at least sql-materialize.ts and sql-execute.ts were edited again afterwards in #1448.
Activity
devin-ai-integration commentedon Oct 20, 2026
This looks fixed on main. #1518 (
Closes #1486) merged intofeat/analyst-harness-dab-2026-10, notmain, so the issue didn't auto-close. That branch landed on main via #1441 (squash commit b12bce3, 2026-10-16).I checked the files #1518 changed against main: 224 of its 225 substantive added lines are on main as written. The other 1 lines read differently on main now. I did not diff each one, but at least
sql-materialize.tsandsql-execute.tswere edited again afterwards in #1448.Suggest closing.
Written by Devin