Skip to content

browser_snapshot: allow overriding the 250-element cap #25

Description

@vincentvella

Problem. browser_snapshot hard-caps at 250 nodes (src/pageSnapshot.ts:28, const MAX = 250). Dense UIs (data tables, long forms) get silently truncated; an agent that doesn't check the truncated: true flag works from an incomplete view of the page.

Proposed. Add an optional limit parameter to the browser_snapshot tool (in src/toolSpecs.ts), threaded into SNAPSHOT_JS to replace the hardcoded MAX (keep 250 as the default). Optionally also honor a DEVLOOP_SNAPSHOT_MAX env default. Keep emitting truncated when the cap is hit.

Affected: src/pageSnapshot.ts, src/toolSpecs.ts (tool param), both substrate injectors.

Filed from the weekly repo audit.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions