Skip to content

fix: support authoritative tool parameter bindings#447

Merged
chubes4 merged 2 commits into
mainfrom
fix/446-authoritative-parameter-bindings
Jul 20, 2026
Merged

fix: support authoritative tool parameter bindings#447
chubes4 merged 2 commits into
mainfrom
fix/446-authoritative-parameter-bindings

Conversation

@chubes4

@chubes4 chubes4 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an explicit authoritative: true parameter-binding contract so resolved host context wins over tool-call input
  • reject caller substitutes when authoritative context is absent, while preserving explicit 0, false, null, and authoritative defaults
  • remove authoritative parameters from provider-facing model schemas and validate malformed or unknown binding metadata

Compatibility and API notes

  • ordinary bindings retain their existing caller/model-wins behavior
  • authoritative is optional and must be boolean; normalized declarations retain it only when true
  • supported binding metadata is now explicit: source, path, sensitive, default, and authoritative; unknown fields fail declaration validation
  • absent authoritative values are removed before required-parameter validation, so required bindings fail safely rather than accepting model input

Test evidence

  • php tests/tool-runtime-smoke.php
  • php tests/default-provider-turn-adapter-smoke.php
  • composer smoke
  • composer phpstan
  • composer validate --strict
  • syntax checks for all changed PHP files
  • git diff --check

Fixes #446

@chubes4

chubes4 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the independent review blockers in ea26a4d:

  • authoritative precedence is now context > binding-local default > top-level parameter default > absent, with caller input excluded throughout
  • explicit 0, false, null, and top-level default cases are covered
  • authoritative fields are removed recursively from allOf/anyOf/oneOf composition branches
  • sanitization now happens in WP_Agent_Provider_Turn_Request, so custom and default adapters receive the same safe declaration
  • execution tamper resistance and ordinary caller-wins bindings remain covered

Validation passed: focused runtime/provider/default-adapter smoke tests, full composer smoke, composer phpstan, composer validate --strict, PHP syntax checks, and git diff --check.

@chubes4
chubes4 merged commit a476564 into main Jul 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: support authoritative non-overridable tool parameter bindings

1 participant