@devries-cameron20 / composio Mirror · read-only / commits / 90c312a01
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 16:00 UTC

docs(changelog): name Python dynamic-key validation as a call-time change

The Backward Compatibility carve-out claimed objects declaring no properties were unaffected. On next, the Python converter read neither patternProperties nor schema-valued additionalProperties, so those objects became empty Pydantic models and every dynamic key was dropped in silence. Those keys are now validated and can raise ValidationError. Document it as the third call-time behavior change, with before/after, narrow the carve-out to objects with no dynamic-key constraints, and note that the prior 'unrelated pattern' behavior was TypeScript-only.

jkomyno committed Aug 7, 2026 at 22:25 UTC 90c312a01151f5eed0c0d96ee28ddd1c4a6553a1
1 file changed +29 -2
docs/content/changelog/08-06-26-free-form-tool-arguments.mdx
+29 -2
@@ -49,7 +49,7 @@ The CLI-side fix ships with the CLI binary rather than the npm packages above. U
49
50 #### Dynamic keys apply only where they should
51
52 -Where a schema declares `patternProperties` or a schema-valued `additionalProperties`, each key is now validated against exactly the schemas that claim it. Previously a key could pass by satisfying an unrelated pattern instead of its own.
52 +Where a schema declares `patternProperties` or a schema-valued `additionalProperties`, each key is now validated against exactly the schemas that claim it. In TypeScript a key could previously pass by satisfying an unrelated pattern instead of its own. In Python neither keyword was read at all, so dynamic keys were never validated.
53
54 - Every matching `patternProperties` entry validates its key.
55 - `additionalProperties` applies only to keys that no declared property and no pattern matches.
@@ -57,6 +57,31 @@ Where a schema declares `patternProperties` or a schema-valued `additionalProper
57
58 Root-level `patternProperties` and boolean- or schema-valued `additionalProperties` also survive tool schema parsing; they were previously dropped before any converter could see them.
59
60 +<Callout type="warn">
61 +**Behavior change**
62 +
63 +Because the Python converter read neither keyword, an object that declared no properties became an empty Pydantic model: every dynamic key was dropped and the call ran without it. Those keys are now validated — at the root, nested under a declared property, and inside array items — and preserved when they pass.
64 +
65 +</Callout>
66 +
67 +**Before:**
68 +
69 +```python
70 +# `metadata` is {"type": "object"} with "patternProperties": {"^count_": {"type": "integer"}}
71 +wrapped.run({"metadata": {"count_a": "not-an-integer"}})
72 +# The tool executed with {"metadata": {}} - every dynamic key was dropped in silence
73 +```
74 +
75 +**After:**
76 +
77 +```python
78 +wrapped.run({"metadata": {"count_a": "not-an-integer"}})
79 +# Raises ValidationError before execution
80 +
81 +wrapped.run({"metadata": {"count_a": 3}})
82 +# The tool executes with {"metadata": {"count_a": 3}} intact
83 +```
84 +
85 In Python, an invalid `patternProperties` or schema-valued `additionalProperties` schema now raises while the tool is wrapped instead of being ignored. This includes an external, anchored, or unresolvable `$ref`, a `patternProperties` key that is not a valid regular expression, or a dynamic-key subschema that is not valid Draft 7. A `$ref` in these schemas must be a local JSON Pointer such as `#/properties/foo`. The rule is transitive: a local pointer whose target carries a non-local reference raises too. A `$ref`-shaped value under `const`, `default`, `enum`, or `examples` is instance data rather than a reference, and is left alone.
86
87 ### Behavior Change for Python Agentic Providers
@@ -114,6 +139,8 @@ This is also what makes free-form object arguments reach execution intact throug
139
140 Accepting and preserving free-form object content is backward compatible: payloads that previously failed now succeed, and payloads that previously arrived empty now arrive complete.
141
117 -The two unknown-key rejections described above (Python agentic providers and the Claude Agent SDK provider) are the behavior changes at call time. Tools whose schemas set `additionalProperties: true`, or whose objects declare no properties, are unaffected.
142 +The two unknown-key rejections described above (Python agentic providers and the Claude Agent SDK provider) are two of the three behavior changes at call time. The third is [Python dynamic-key validation](#dynamic-keys-apply-only-where-they-should): a key that used to be dropped in silence now raises a `ValidationError` when it does not match the `patternProperties` or `additionalProperties` schema that claims it.
143 +
144 +`additionalProperties: true` still opts an object out of unknown-key rejection, and so does declaring no properties. Neither opts out of the third change: if the object also carries `patternProperties` or a schema-valued `additionalProperties`, its keys are validated against those schemas. Objects with no dynamic-key constraints at all are unaffected.
145
146 The one remaining change happens earlier, while a Python tool is wrapped: an invalid dynamic-key schema now raises instead of being ignored. Only tools whose `patternProperties` or schema-valued `additionalProperties` contain an invalid reference, regular expression, or Draft 7 subschema are affected.