Skip to content

upstream: provider/security fixes not yet ported #1478

Open

Description

@devin-ai-integration

Tracking issue for the weekly upstream security/provider fix port. Fork base: OpenCode v1.17.9 (#964, frozen 2026-07-18). Upstream reviewed through v1.19.5. Scope: fixes in packages/opencode/src/{provider,session,tool,mcp,auth,plugin}, packages/core, the server auth/PTY surface and AI SDK provider bumps.

Run 2026-10-28

Base unchanged: still v1.17.9. No newer full upstream merge has landed; the last one is #964.

Ported

Opened from last run's branches

Not applicable

Still open (not merged)

Queued (ranked)

  1. fix(opencode): retry raw network finish errors anomalyco/opencode#43813: retry raw network_error finish reasons. Retry. Port after fix(session): recover from stalled model requests #1426 lands
  2. fix(opencode): expand retryable error patterns anomalyco/opencode#40707 / #40694 / #43806: broaden retryable error patterns (session/retry.ts). Retry. Waiting on fix(session): recover from stalled model requests #1426
  3. fix(opencode): cap session retries with jitter anomalyco/opencode#41939: retry jitter. Retry
  4. fix(provider): filter unreplayable Bedrock reasoning before caching anomalyco/opencode#45769: drop unsigned Bedrock reasoning before caching. Bedrock. Check against fix(bedrock): non-empty Converse streams in the release build and cached tokens billed once #1425
  5. fix(opencode): hoist Bedrock tool images except Claude, Nova, and Llama 4 anomalyco/opencode#50272: Bedrock tool-result images. Bedrock
  6. AI SDK provider bumps: needs a dedicated PR plus a regression run (versions listed in the 2026-10-14 run)
  7. fix(opencode): retry xAI capacity stream errors anomalyco/opencode#43640: xAI capacity errors retryable. Other provider
  8. fix(core): limit subagent nesting depth anomalyco/opencode#37124: subagent recursion depth limit. Design-level, note only

Summary

Ported 2: PTY connect route authorization (#58258 → #1615) and the failed-RPC TUI hang (#54936 → #1617); also opened last run's MCP auth (#1612) and malformed-cost (#1613) PRs. Review requested from @anandgupta42 on all four.
New tests fail on main and pass with the fixes; tsgo (opencode, server) and analyze.ts --markers --strict are clean locally.
Next: #43813 and the retry patterns once #1426 merges, then the Bedrock items. Run note: git proxy still 403s, so branches were pushed via the GitHub REST API.

Written by Devin

Run 2026-10-21

Base unchanged: still v1.17.9. No newer full upstream merge has landed; the last one is #964.

Ported (branch pushed; PR still needs opening, see run note)

Already present

Still open from last run

Queued (ranked)

  1. fix(opencode): retry raw network finish errors anomalyco/opencode#43813: retry raw network_error finish reasons (session/llm/ai-sdk.ts). Retry. It also needs upstream's generic ResponseStreamError → retryable APIError mapping in message-v2.ts, and fix(session): recover from stalled model requests #1426 deliberately limits that mapping to the idle watchdog. Port after fix(session): recover from stalled model requests #1426 lands
  2. fix(opencode): expand retryable error patterns anomalyco/opencode#40707 / #40694 / #43806: broaden retryable error patterns (session/retry.ts). Retry. Waiting on fix(session): recover from stalled model requests #1426
  3. fix(opencode): cap session retries with jitter anomalyco/opencode#41939: retry jitter. Retry
  4. fix(provider): filter unreplayable Bedrock reasoning before caching anomalyco/opencode#45769: drop unsigned Bedrock reasoning before caching. Bedrock. Check against fix(bedrock): non-empty Converse streams in the release build and cached tokens billed once #1425
  5. fix(opencode): hoist Bedrock tool images except Claude, Nova, and Llama 4 anomalyco/opencode#50272: Bedrock tool-result images. Bedrock
  6. AI SDK provider bumps: needs a dedicated PR plus a regression run (versions listed in the 2026-10-14 run)
  7. fix(opencode): retry xAI capacity stream errors anomalyco/opencode#43640: xAI capacity errors retryable. Other provider
  8. fix(core): limit subagent nesting depth anomalyco/opencode#37124: subagent recursion depth limit. Design-level, note only

Summary

Ported 2 fixes onto branches: MCP auth URL scoping (#33924 → #1572) and the malformed-cost guard (#43248 → #1573). Tests fail on main and pass with the fixes; tsgo and analyze.ts --markers --strict are clean.
The PRs could not be opened: Devin's PR tool returned Unauthorized and the git proxy returned 403. A maintainer can open them from the compare links above.
Next: #43813 and the retry patterns once #1426 merges, then the Bedrock items.

Note: session/session.ts has a second getUsage copy that nothing imports (callers use session/index.ts). It was left untouched.

Run 2026-10-14

Ported

Covered by an open fork PR (skipped)

Already present

Not applicable

  • Core read tool fix (1ac6b4b): the fork runs the opencode tool implementation, not the core one
  • Core runner fixes (49593c1, 709af58, 0033bb3): they target the upstream v2 runner, which the fork doesn't ship
  • fff / codemode / Copilot / Codex / Mistral variant fixes: features or providers the fork doesn't carry at this base

Queued (ranked)

  1. fix(mcp): scope auth status to server URL anomalyco/opencode#33924: scope MCP auth status to the configured server URL (mcp/index.ts getAuthStatus uses auth.get instead of auth.getForUrl). Security
  2. fix(provider): handle SSE reader cancel rejections anomalyco/opencode#44944: catch rejected reader.cancel(err) promise in the SSE watchdog (provider.ts), avoiding an unhandled rejection after a stall. Hang
  3. fix(opencode): expand retryable error patterns anomalyco/opencode#40707 / #40694 / #43806: broaden retryable provider/network error patterns (session/retry.ts). Retry. Overlaps fix(session): recover from stalled model requests #1426, so wait for it to land
  4. fix(opencode): retry raw network finish errors anomalyco/opencode#43813: retry raw network_error finish reasons. Retry
  5. fix(opencode): cap session retries with jitter anomalyco/opencode#41939: retry jitter and capped retry policy. Retry. The fork already caps at RETRY_MAX_ATTEMPTS = 5, so only jitter is missing
  6. fix(session): ignore malformed model costs anomalyco/opencode#43248: ignore malformed (non-finite) model cost fields in Session.getUsage. Cost
  7. fix(provider): filter unreplayable Bedrock reasoning before caching anomalyco/opencode#45769: drop unsigned/unreplayable Bedrock reasoning before caching (provider/transform.ts). Bedrock. Check against fix(bedrock): non-empty Converse streams in the release build and cached tokens billed once #1425 first
  8. fix(opencode): hoist Bedrock tool images except Claude, Nova, and Llama 4 anomalyco/opencode#50272: Bedrock tool-result images. Bedrock
  9. AI SDK provider bumps (needs a dedicated PR + regression run): amazon-bedrock 4.0.112 -> 4.0.166, anthropic 3.0.82 -> 3.0.111, openai 3.0.53 -> 3.0.88, azure 3.0.49 -> 3.0.93, xai 3.0.82 -> 3.0.139, togetherai 2.0.41 -> 2.0.68, google-vertex 4.0.128 -> 4.0.181, gateway 3.0.104 -> 3.0.191
  10. fix(opencode): retry xAI capacity stream errors anomalyco/opencode#43640: xAI capacity errors retryable. Other provider
  11. fix(core): limit subagent nesting depth anomalyco/opencode#37124: subagent recursion depth limit (tool/task.ts). Design-level; note only

Summary

Ported 2: MCP OAuth loopback bind (#1476) and OpenAI 5min header timeout (#1477). #46903 and the Bedrock fixes are skipped because open PRs #1426 and #1425 already cover them.
Top of the queue: MCP auth URL scoping (#33924), then SSE cancel rejection (#44944) and the retry-pattern ports once #1426 merges.
Run note: git clone/push through the git proxy returned 403, so branches were pushed via the GitHub REST API, and analyze.ts used its pattern fallback because upstream couldn't be fetched.

Written by Devin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions