Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

[release/0.43] Guard reasoning effort parameter against unsupported models#5011

Merged
bhavyaus merged 1 commit into
release/0.43from
dev/bhavyau/fix-effort-guard-0.43
Apr 6, 2026
Merged

[release/0.43] Guard reasoning effort parameter against unsupported models#5011
bhavyaus merged 1 commit into
release/0.43from
dev/bhavyau/fix-effort-guard-0.43

Conversation

@bhavyaus
Copy link
Copy Markdown
Contributor

@bhavyaus bhavyaus commented Apr 6, 2026

Cherry-pick of #5010 into release/0.43.

Fixes microsoft/vscode#308078

Problem

When a subagent inherits the parent agent's reasoningEffort but is routed to a model that doesn't support the effort parameter (e.g. claude-haiku-4.5 via search subagent), the API returns a 400 error: "This model does not support the effort parameter."

Fix

  • Messages API (messagesApi.ts): Only set effort in output_config when endpoint.supportsReasoningEffort?.length is truthy
  • Responses API (responsesApi.ts): Same guard — only include effort when the model declares support
  • Tests: 6 new unit tests covering the effort guard in createMessagesRequestBody

When a subagent inherits the parent agent's reasoningEffort but is
routed to a model that doesn't support the effort parameter (e.g.
claude-haiku-4.5 via search subagent), the API returns a 400 error.

Fix: only include the effort parameter in the request body when the
endpoint declares supportsReasoningEffort with at least one value.

Affects both Messages API (Anthropic) and Responses API (OpenAI).

Includes unit tests for the Messages API effort guard.
@bhavyaus bhavyaus enabled auto-merge April 6, 2026 20:51
@Yoyokrazy Yoyokrazy disabled auto-merge April 6, 2026 20:53
@Yoyokrazy Yoyokrazy closed this Apr 6, 2026
@bhavyaus bhavyaus reopened this Apr 6, 2026
@bhavyaus bhavyaus enabled auto-merge April 6, 2026 21:45
@bhavyaus bhavyaus merged commit 7f62714 into release/0.43 Apr 6, 2026
29 of 30 checks passed
@bhavyaus bhavyaus deleted the dev/bhavyau/fix-effort-guard-0.43 branch April 6, 2026 22:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants