Skip to content

feat(opencode): make webfetch max size configurable#30503

Open
ulises-jeremias wants to merge 6 commits into
anomalyco:devfrom
ulises-jeremias:feat/15459-webfetch-max-size-env-clean
Open

feat(opencode): make webfetch max size configurable#30503
ulises-jeremias wants to merge 6 commits into
anomalyco:devfrom
ulises-jeremias:feat/15459-webfetch-max-size-env-clean

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #15459

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Makes the webfetch response-size limit configurable while keeping the current 5MB default.

  • Adds OPENCODE_WEBFETCH_MAX_SIZE (bytes) runtime flag
  • Applies the value to both size checks in webfetch (content-length pre-check and decoded body size check)
  • Keeps the existing behavior when the env var is not set
  • Updates webfetch tool notes to document the new env var

How did you verify your code works?

From packages/opencode:

  • bun test test/tool/webfetch.test.ts
  • bun typecheck

Added a regression test that sets the runtime flag to 5 bytes and verifies webfetch rejects a 6-byte response with the configured limit.

Screenshots / recordings

N/A (non-UI change)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

* upstream/dev: (736 commits)
  chore: update nix node_modules hashes
  feat(oauth): unify OAuth callback browser pages (anomalyco#34025)
  chore: generate
  refactor(app): replace tab drag handling with dndkit (anomalyco#33880)
  refactor(app): use dropdown for project selector (anomalyco#33984)
  chore: update nix node_modules hashes
  fix(app): bump ghostty-web to prevent terminal resize hangs (anomalyco#34020)
  chore: generate
  feat(sdk): expose active sessions (anomalyco#33991)
  fix(sdk): wake embedded session execution (anomalyco#33992)
  refactor(opencode): stop legacy v2 event emission (anomalyco#33993)
  fix(ui): normalize tooltip trigger layout (anomalyco#33979)
  fix(app): suspend hidden terminal renderer (anomalyco#33990)
  fix(app): enable auto-accept in session settings (anomalyco#33974)
  tweak: hide MCP access token prefix (anomalyco#33711)
  fix(core): refine small model defaults (anomalyco#33926)
  feat(core): split MCP timeout configuration (anomalyco#33977)
  fix(app): simplify question prompt (anomalyco#33968)
  feat(llm): pass strict through tool definitions for Codex parity (anomalyco#33392)
  chore: generate
  ...
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.

[FEATURE]: Make webfetch MAX_RESPONSE_SIZE configurable

1 participant