Skip to content

fix(web): let web_fetch read past a truncated page - #2230

Merged
elie222 merged 4 commits into
elie222:mainfrom
tc3oliver:fix/web-fetch-offset
Oct 28, 2026
Merged

elie222 merged 4 commits into
elie222:mainfrom
tc3oliver:fix/web-fetch-offset

Conversation

@tc3oliver

@tc3oliver tc3oliver commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

web_fetch returns at most 50,000 characters (8,000 by default) and cuts longer pages with a bare [Content truncated]. There was no way to read the rest. Models took the cut for the end of the page and reported later sections of long release notes and advisories as missing.

What changed

web_fetch gains an optional offset. A cut now reads [Content truncated; continue with offset 8000]. The keyless, Keenable and Parallel providers share one helper for the window. Parallel drops the skipped text before the result size limit. Keenable has no offset of its own, so it reads the first 100,000 characters at most and refuses a window past that with a clear error.

New model-facing text (no UI copy): the offset description "Characters to skip, to read on after a truncated fetch (default 0)" and the cut line above. The model needs both to know it can continue and from where.

How tested

Tests read a long page in windows through the keyless provider, read a Parallel window past the 1 MB result limit, and check the Keenable request size and read limit; they fail without the change. The other web tests are updated for the new cut line. Typecheck and Biome pass. The unit suite passes except the backup-script and desktop-preparation tests, which fail the same way without this change on macOS.

A page longer than the fetch limit was cut with a bare "[Content truncated]"
and no way to read further. Models often missed the cut and reported that
the rest of the page did not exist.

web_fetch takes an offset, and the cut now names the offset to continue
from. Keyless, Keenable and Parallel share the same window helper.
@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@tc3oliver is attempting to deploy a commit to the Inbox Zero Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

web_fetch can now continue after a truncated page.

  • Web fetch can continue reading a page from its last cut.

Both earlier, unnumbered findings are addressed: Parallel drops the skipped prefix before the byte limit, and FakeWebProvider honors offset.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["web_fetch: url, maxChars, offset"] --> B["Check bounds"]
  B --> C{"Provider"}
  C --> D["Keyless or fake: skip extracted text"]
  C --> E["Parallel: skip text before byte limit"]
  C --> F["Keenable: request prefix within read limit"]
  D --> G["pageWindow"]
  E --> G
  F --> G
  G --> H["Return text and next offset, or read-limit notice"]
Loading

Reviews (3) · Last reviewed commit: "fix(web): bound web_fetch offset and sto..." · Reviewed by Greptile

Comment thread packages/adapters/src/parallel-web.ts Resolved
Comment thread packages/adapter-kit/src/types.ts Resolved
Parallel now drops the skipped prefix before the transport's size limit.
Keenable has no offset, so a window past its readable range is refused
with a clear error. The fake provider honours offset too.
@greptile-apps

greptile-apps Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@github-actions

Copy link
Copy Markdown
Contributor

Playwright screenshots

Feature frames for this PR:

Open screenshot gallery · Dashboard · CI run

Updated for commit 90462e8.

elie222 and others added 2 commits October 28, 2026 16:21
Co-authored-by: Elie Steinbock <[email protected]>

# Conflicts:
#	packages/adapters/src/keyless-http-web.ts
An unbounded offset let a caller skip past what the next read can return,
and the cut line still told the model to continue there. Offset now stops
at the keyless page cap. A cut names the next offset when that read is
still allowed, and says the read limit was reached when it is not.
Keenable returns the characters that still fit in its first 100000
instead of failing a window that overlaps that range.

Co-authored-by: Elie Steinbock <[email protected]>
@elie222
elie222 merged commit 23bbde8 into elie222:main Oct 28, 2026
28 of 29 checks passed
@tc3oliver
tc3oliver deleted the fix/web-fetch-offset branch November 13, 2026 05:07
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.

2 participants