Skip to content

fix: Phase 2 — backport 5 high-priority upstream bug fixes#27

Merged
e6qu merged 1 commit intodevfrom
phase2/upstream-fixes
Mar 21, 2026
Merged

fix: Phase 2 — backport 5 high-priority upstream bug fixes#27
e6qu merged 1 commit intodevfrom
phase2/upstream-fixes

Conversation

@e6qu
Copy link
Owner

@e6qu e6qu commented Mar 21, 2026

Phase 2: High-Priority Upstream Bug Fixes

Backported 5 fixes from vouched upstream contributors. 1 cherry-picked cleanly, 4 manually reimplemented due to architectural divergence.

Cherry-picked

Fix forked prompt attachments losing file parts

  • Upstream: anomalyco/opencode#17815 by Kit Langton (@kitlangton)
  • Commit: 0d7e62a53
  • New part.ts with strip()/assign() helpers for prompt part handling
  • Prevents file parts losing metadata during session fork

Reimplemented

Only set thinkingConfig for models with reasoning capability

  • Upstream: anomalyco/opencode#18283 by Protocol Zero (@Protocol-zero-0)
  • Commit: cc818f803
  • Guards thinkingConfig with if (input.model.capabilities.reasoning) check
  • Prevents errors on Google models without reasoning support

Disable chunk timeout by default

  • Upstream: anomalyco/opencode#18264 by James Long (@jlongster)
  • Commit: d69962b0f
  • Removed DEFAULT_CHUNK_TIMEOUT constant; timeout now undefined by default
  • Prevents false timeouts on slow providers

Preserve tagged error messages

Queue-based event route processing

  • Upstream: anomalyco/opencode#18259 by James Long (@jlongster)
  • Commit: 054075189
  • Added event queue in SSE route to prevent backpressure
  • Events are buffered and flushed sequentially instead of writing directly from callbacks

Already applied / not applicable

Fix Status
SIGHUP handler (Dax Raad) Already in our tree
Truncate permission import cycle (Luke Parker, #18292) Already fixed by our Effect-based permission refactor
Ariane Emory timeout fix (#18113) Not found in upstream commits

Test plan

  • bun run typecheck (tsgo) — 0 errors
  • bun test — 1488 pass, 0 fail (2 new from cherry-picked prompt-part tests)

Cherry-picked:
- 0d7e62a53 (#17815, Kit Langton): Fix forked prompt attachments losing
  file parts — new part.ts with strip/assign helpers

Reimplemented:
- cc818f803 (#18283, Protocol Zero): Only set thinkingConfig for models
  with reasoning capability — prevents errors on non-reasoning Google models
- d69962b0f (#18264, James Long): Disable chunk timeout by default —
  prevents false timeouts on slow providers
- 84e62fc66 (#18165, Kit Langton): Preserve tagged error messages —
  use e.message instead of e.toString() in fromError()
- 054075189 (#18259, James Long): Queue-based event route processing —
  prevents backpressure when events arrive faster than SSE can flush

Already applied (skipped):
- SIGHUP handler — already in our tree
- Truncate permission cycle — already fixed by our Effect-based refactor
- Ariane timeout fix — not found in upstream

1488 tests passing, 0 tsgo errors.
@e6qu e6qu merged commit e6ae0ef into dev Mar 21, 2026
1 check passed
@e6qu e6qu deleted the phase2/upstream-fixes branch March 21, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant