You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
webfetch returns page chrome verbatim and gives no guidance on API endpoints — strip boilerplate before markdown conversion, document 404 handling #190
Observed in the same session: a fetch of github.com/.../pull/182/checks returned ~10KB of GitHub navigation menus, marketing links, sign-in prompts, cookie text, and footer boilerplate — the actual CI-status content was a few lines. The fetch also failed to answer the question (pass/fail per check was ambiguous), forcing another round-trip. Additionally, the model then fetched api.github.com/repos/.../check-runs without auth, got a predictable 404, and burned another call.
Requested change
Code + prompt, one file.
Code in packages/opencode/src/tool/webfetch.ts, in the HTML pipeline, before markdown conversion. Use the HTML parser the package already depends on — do NOT add a dependency, do NOT add per-domain rules:
HTML pages carry heavy navigation/footer chrome. For structured data, prefer
API endpoints or raw file URLs (raw.githubusercontent.com, api.github.com)
over rendered pages. A 404 from an API endpoint usually means authentication
is required — do not retry variants of the same unauthenticated request.
Acceptance criteria
Fetching a GitHub PR page no longer returns the nav menu / footer / "Skip to content" / marketing blocks.
Completed in PR #219 (#219) and the core-path port/fix in PR #234 (#234), both merged. Checked current dev-vibecoded at 2225f76: the core HTML pipeline removes navigation/header/footer/aside and chrome roles/classes before markdown/text conversion, uses the existing HTML parser, preserves legitimate cookie/footer content, and includes API/raw-URL and cautious 404 guidance. Regression fixtures cover chrome removal and retained content.
Known limitation, outside this issue's acceptance criteria: GitHub's dynamically loaded CI content is not guaranteed to be fully visible through webfetch. The chrome removal and no-new-dependency scope is complete; this is not a remaining implementation item for #190.
Activity
agenteinstinct1-max commentedon Oct 11, 2026
Completed in PR #219 (#219) and the core-path port/fix in PR #234 (#234), both merged. Checked current dev-vibecoded at 2225f76: the core HTML pipeline removes navigation/header/footer/aside and chrome roles/classes before markdown/text conversion, uses the existing HTML parser, preserves legitimate cookie/footer content, and includes API/raw-URL and cautious 404 guidance. Regression fixtures cover chrome removal and retained content.
Known limitation, outside this issue's acceptance criteria: GitHub's dynamically loaded CI content is not guaranteed to be fully visible through webfetch. The chrome removal and no-new-dependency scope is complete; this is not a remaining implementation item for #190.