Reproducing the same class of bug on OpenAI direct provider with openai/gpt-5.5 in OpenCode v1.14.48 (headless opencode run mode under the aidevops framework). Variable name in the TypeError is different (J.type vs $.annotations) because the minified binary names differ per build, but the failure shape and timing are identical to this issue, supporting the Effect Schema migration root-cause hypothesis in #24005.
Error
ERROR service=llm providerID=openai modelID=gpt-5.5 session.id=ses_1e717b7f0ffeH5ltHMkwPumHPg
small=false agent=Build+ mode=primary error={"error":{}} stream error
ERROR service=session.processor session.id=ses_1e717b7f0ffeH5ltHMkwPumHPg
messageID=msg_e18e8ab0200110H3hpwjgZIy25
error=undefined is not an object (evaluating 'J.type')
stack=TypeError: undefined is not an object (evaluating 'J.type')
at fetch (/$bunfs/root/chunk-n2wbvcp2.js:488:2526)
at processTicksAndRejections (native:7:39)
Wrapped stream error is {"error":{}} (empty inner) — same empty-Error wrapping pattern as #26129 / #21979.
Crash sequence (from session ndjson)
The crash fires immediately after a successful step-finish event with reason: "tool-calls":
{"type":"step_finish","timestamp":1778534361830,"sessionID":"ses_1e717b7f0ffeH5ltHMkwPumHPg",
"part":{"reason":"tool-calls","type":"step-finish",
"tokens":{"total":29538,"input":755,"output":111,"reasoning":0,
"cache":{"write":0,"read":28672}}}}
{"type":"error","timestamp":1778534362048,"sessionID":"ses_1e717b7f0ffeH5ltHMkwPumHPg",
"error":{"name":"UnknownError",
"data":{"message":"undefined is not an object (evaluating 'J.type')"}}}
218 ms between events — consistent with the next streaming part arriving from the provider and failing Effect Schema deserialization. The minified J.type access strongly suggests the schema is unwrapping a streaming part object expecting .type to discriminate the union, and receiving undefined instead (likely an empty/null streaming delta after tool_calls).
Reproduction
Headless config: OpenAI direct provider, OAuth via aidevops account pool, gpt-5.5 model, tool-calling enabled (Build+ agent with TodoWrite, Bash, Edit, etc.). Crashes after 1–5 tool-call cycles. Observed 3/4 times in the last 24h on Ultimate-Multisite/ultimate-multisite headless workers; the 4th attempt succeeded on resume via next_action: "resume_session_with_completion_contract", suggesting the malformed chunk is transient/intermittent rather than deterministic for a given prompt.
Same reasoning model class as #26107 (Free Models Thinking/Reasoning crashes) — possibly the empty/null delta corresponds to a reasoning step boundary in gpt-5.5's response stream.
Side-signal (possibly unrelated)
The sandbox boot also emits 4× schema rejections before the model crash:
WARN service=server kind=Payload
reason=Expected Auth, got {"type":"pending","refresh":"","access":"","expires":0}
schema rejection
This is the OAuth refresh path emitting a pending placeholder Auth object that the Effect Schema rejects. The session continues past this and only crashes later during streaming, so it may be cosmetic — but it confirms Effect Schema is now actively rejecting payloads that earlier schemas accepted.
Environment
- OpenCode v1.14.48 (Linux x86_64, Bun runtime)
- OpenAI direct provider (not Copilot/Zen/openai-compatible — direct OAuth)
- Model:
openai/gpt-5.5
- Mode:
opencode run (headless, non-TUI)
- Agent: Build+ with tool-calling
- Same model on
anthropic/claude-sonnet-4-6 direct provider: 5/5 success in same window, so the bug is isolated to the OpenAI streaming chunk parser, not the harness.
Happy to provide full session ndjson, stderr captures, or run version bisection if useful.
aidevops.sh v3.15.31 plugin for OpenCode v1.14.48 with claude-opus-4-7 spent 1h 7m and 74,137 tokens on this with the user in an interactive session.