mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-09-14 23:15:14 -04:00
Some models (gpt-5.x via codex) zero-fill optional tool params instead of omitting them, so every tree/markdown/html call carried backendNodeId: 0, failed with NodeNotFound, and got retried blind -- one 'go to hacker news' burned 19 tool calls and 18 full page loads. Registry ids start at 1, so 0 can never name a real node. Make 0-means-omitted part of the tool contract: state it in the schema descriptions and normalize it in parseValue. Required ids (nodeDetails) are untouched. In-band guidance alone was not enough -- the model re-emitted the identical call even when the error spelled out the fix -- but keep it for genuinely stale ids: NodeNotFound and FrameNotLoaded now carry an actionable message in the agent, slash-command, and MCP paths instead of a bare error name.