Skip to content

agent_browser_code strict schema breaks every request on Anthropic strict-tool models (minimum/maximum not supported) #208

Description

@vruru

Summary

With pi 0.87.1 and a model that supports strict tools (anthropic/claude-opus-5-5), every request fails once pi-agent-browser-native@0.7.1 is loaded:

400 {"type":"error","error":{"type":"invalid_request_error","message":"tools.25.custom: For 'integer' type, properties maximum, minimum are not supported"}}

agent_browser_code registers constrainedSampling: { type: "json_schema", strict: "prefer" }, and createAgentBrowserCodeParamsSchema() contains keywords Anthropic strict mode doesn't accept:

  • timeoutMs: Type.Integer({ minimum: 1, maximum: AGENT_BROWSER_CODE_MAX_TIMEOUT_MS })
  • code: Type.String({ minLength: 1, maxLength: 65_536 }), session: Type.String({ minLength: 1 })

Pi's strict conversion currently passes them through unchanged (reported upstream: earendil-works/pi#9953), so the whole session breaks, not just this tool.

Suggested fix

Until pi sanitizes this, either drop constrainedSampling from agent_browser_code, or keep it but move the bounds into descriptions and enforce them in execute (the runtime check is needed anyway).

Local workaround confirmed: commenting out the constrainedSampling line in dist/extensions/agent-browser/lib/tool-surface.js makes the schema error go away.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions