Skip to content

Allow web_fetch to continue beyond truncated text #6316

Open

Description

@david-dev666

Problem / Motivation

web_fetch returns only the first maxChars characters of extracted text. When truncated is true, an agent has no way to read the remaining sections without requesting an increasingly large prefix, repeating content in its context.

Proposed Solution

Add a nonnegative character offset and return nextOffset and totalLength for text results. Apply the slice after extraction and keep the untrusted-content banner on every chunk. Offset defaults to zero; image results and network policy stay unchanged.

Alternatives Considered

Increase maxChars and fetch the same prefix again, or use an external fetch tool. A continuation offset allows bounded tool results with the existing extractors.

Related Component

Other

Additional Context

A focused implementation covers Jina, readability, and plain text. Related tool and network-security tests pass (105 tests). Each call fetches the URL again, so content or extractor changes can shift offsets; this limitation is documented.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions