fix(agent): tolerate intent annotations on no-argument platform tools

This commit is contained in:
RockChinQ
2026-09-05 17:15:20 +08:00
parent 8f0a55a1f4
commit f5d6a3b348
2 changed files with 32 additions and 0 deletions
@@ -573,6 +573,10 @@ def _normalize_platform_params(
if not isinstance(parameters, dict):
raise ValueError('parameters must be an object')
allowed = set((definition.parameters.get('properties') or {}).keys())
# Some model responses annotate no-argument calls with a textual intent.
# Keep the original trace, but never pass this annotation to the adapter.
if not allowed and isinstance(parameters.get('_call'), str):
parameters = {key: value for key, value in parameters.items() if key != '_call'}
extra = set(parameters) - allowed
if extra:
raise ValueError(f'Unexpected parameters: {", ".join(sorted(extra))}')