The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(auxiliary): recognise Bedrock's "doesn't support"/"is deprecated" sampling-param rejections
teknium19219f56e4438
diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.pyindex 2bf36e4ec10..69581fb9c17 100644--- a/agent/auxiliary_client.py+++ b/agent/auxiliary_client.py@@ -3155,8 +3155,12 @@ def _is_unsupported_parameter_error(exc: Exception, param: str) -> bool:if not param_lower:return Falseerr_lower = str(exc).lower()+ # Bedrock Converse rejects sampling params for reasoning-first models with the contraction+ # ("This model doesn't support the temperature field", xAI Grok) and inference-profile Claude+ # with "`temperature` is deprecated for this model" (#111043).return param_lower in err_lower and _contains_any(err_lower, ("unsupported parameter", "unsupported_parameter", "not supported", "does not support",+ "doesn't support", "is deprecated for this model","unknown parameter", "unrecognized request argument", "unrecognized parameter", "invalid parameter",))diff --git a/tests/agent/test_unsupported_parameter_retry.py b/tests/agent/test_unsupported_parameter_retry.pyindex b14b2254f8c..0147e819389 100644--- a/tests/agent/test_unsupported_parameter_retry.py+++ b/tests/agent/test_unsupported_parameter_retry.py@@ -34,6 +34,10 @@ class TestIsUnsupportedParameterError:("temperature", "HTTP 400: Unsupported parameter: temperature"),("temperature", "Error code: 400 - {'error': {'code': 'unsupported_parameter', 'param': 'temperature'}}"),("temperature", "this model does not support temperature"),+ # Bedrock Converse wordings (xAI Grok contraction, inference-profile Claude deprecation, #111043)+ ("temperature", "An error occurred (ValidationException) when calling the Converse operation: "+ "This model doesn't support the temperature field. Remove temperature and try again."),+ ("temperature", "ValidationException: `temperature` is deprecated for this model."),# max_tokens phrasings("max_tokens", "HTTP 400: Unsupported parameter: max_tokens"),("max_tokens", "Unknown parameter: max_tokens — use max_completion_tokens"),