Skip to content

feat(webfetch): configurable max response size - #63

Open
kvnloo wants to merge 4 commits into
devfrom
feat/webfetch-max-size-v3
Open

kvnloo wants to merge 4 commits into
devfrom
feat/webfetch-max-size-v3

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Make WebFetch's response-size cap configurable while keeping 5 MiB as the default.

  • webfetch.max_response_size accepts a positive integer in bytes
  • OPENCODE_WEBFETCH_MAX_SIZE is the fallback when config is unset
  • invalid environment values fall back to 5 MiB
  • both Content-Length and actual buffered-body checks use the resolved limit

Credit / provenance

This carries forward the config design from upstream anomalyco#46812 / anomalyco#46799 by @RaviTharuma and the earlier environment-variable approach from anomalyco#36863 by @ulises-jeremias. This branch refreshes those ideas onto current dev and keeps the combined focused regression coverage.

Current refresh

  • rebased cleanly onto current dev on 2026-10-03
  • 0 commits behind
  • only the ConfigV1 schema, WebFetch implementation, and focused WebFetch tests changed
  • stale unrelated dependency / browser-opening changes were explicitly removed

Verification

The earlier focused downstream proof passed the WebFetch test file. Current upstream CI should revalidate this refreshed head.

github_writes_origin=0 — ready to promote when upstream write access is available.

@github-actions

Copy link
Copy Markdown

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@kvnloo
kvnloo force-pushed the feat/webfetch-max-size-v3 branch from d568537 to 9949e18 Compare October 3, 2026 21:18
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