#6316

Allow web_fetch to continue beyond truncated text

Opendavid-dev666opened 11d ago

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.

Activity

0

No activity yet.