Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrade query-generator SQL step to Claude Sonnet 5 #49187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Upgrade query-generator SQL step to Claude Sonnet 5 #49187
Changes from all commits
d275d54f404a7bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: fleetdm/fleet
Length of output: 9216
🌐 Web query:
Anthropic Messages API response content blocks thinking text block adaptive thinking output_config.effort Sonnet 5💡 Result:
In the Anthropic Messages API, adaptive thinking is a mechanism for Claude models to dynamically determine the depth of their reasoning based on query complexity [1][2]. For models supporting this, including Claude Sonnet 5, it replaces the legacy
budget_tokensconfiguration [3][2]. To configure adaptive thinking, you use thethinkingobject in the request body withtype: "adaptive"[1][2]. Theoutput_config.effortparameter is used to provide soft guidance on the desired thinking depth [4][1]. Key details: 1. Configuration Structure: Theeffortparameter must be placed within a dedicatedoutput_configobject in the request body, not inside thethinkingobject [4]. 2. Effort Levels: Theeffortparameter supports values such aslow,medium(default),high, andxhigh(availability varies by model) [1]. This allows you to influence how much reasoning Claude applies to a task [1]. 3. Model Support: On models like Claude Sonnet 5, adaptive thinking is enabled by default [2]. You can explicitly disable it by passingthinking: {type: "disabled"}if preferred [2]. Attempting to use the legacy manualthinking: {type: "enabled", budget_tokens: N}configuration on these models will typically result in a 400 error [3][2]. 4. Displaying Thinking: On newer models, thethinkingblock content defaults to"omitted"[3][5]. If you wish to see the reasoning text, you must explicitly setthinking: {type: "adaptive", display: "summarized"}[5]. 5. Usage: Usemax_tokensto set a hard limit on the total output (thinking plus response text) [1]. Adaptive thinking, paired witheffort, is the recommended approach for managing reasoning depth on supported models [3][2].Citations:
🌐 Web query:
Anthropic Messages API response content array text thinking blocks default omitted content[0].text💡 Result:
In the Anthropic Messages API, when extended thinking is enabled, the API response contains an array of content blocks [1]. You should not assume that the first block (response.content) is a text block, as thinking blocks are distinct objects that appear in the content array [1]. Regarding the behavior of thinking content in the response: 1. Thinking Content Types: When extended thinking is enabled, the model returns specialized content blocks of type thinking or redacted_thinking, which are distinct from text blocks [1][2]. 2. Omission and Display: Whether the actual thinking text is returned depends on the configuration provided in the request's thinking parameter [3]. - If configured to return full reasoning, the thinking content is provided in the thinking block [4][5]. - If the configuration (often via an adaptive thinking or display setting) results in the content being omitted or summarized, the thinking block may be present but contain no text, or it may be omitted entirely depending on the specific API version and model behavior [3][6][1]. 3. Robust Handling: Because the structure of the content array varies based on model output and configuration, you must iterate over the response.content array and check the type of each block (e.g., if block.type == "text" or if block.type == "thinking") rather than directly accessing response.content.text [1][5][2]. Attempting to access.text on a thinking block or an unexpected block type will cause an error [1].
Citations:
Extract the text block from Anthropic responses
anthropicResponse.content[0]is not guaranteed to be a text block here; with adaptive thinking enabled, the first block can bethinking/redacted_thinking, which makesrawPromptResponseundefined and breaks JSON parsing. Scancontentfor the firsttype === 'text'block and throw if none is present.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: fleetdm/fleet
Length of output: 50373
🌐 Web query:
Anthropic output_config effort unsupported models ignored or error Claude Haiku 4.5💡 Result:
The error "output_config: Extra inputs are not permitted" occurs when an Anthropic API request includes the
output_configparameter (used for structured outputs or reasoning effort) while using an integration or provider that does not support it [1][2][3]. Key reasons for this error include: 1. Provider Restrictions: Cloud providers like Amazon Bedrock, Google Vertex AI, and Azure AI Foundry often have specific request-body requirements [1][2][4][3]. If these services do not recognize theoutput_configfield, they reject the entire request with an "Extra inputs are not permitted" or similar validation error [2][3]. 2. Model Capability Mismatches: While Claude Haiku 4.5 supports structured outputs in many environments, it may not support all features withinoutput_config(such aseffort) depending on the specific model endpoint or deployment (e.g., via GitHub Copilot or specific proxy services) [4][5][6][7]. 3. Integration Errors: Many tools and SDKs automatically injectoutput_configinto requests (e.g., for automated session title generation or structured output enforcement) [2][3]. If the underlying service (like Vertex AI or Bedrock) has not been updated to accept this parameter, the integration will fail [2][3]. To resolve this issue: - Strip theoutput_configparameter from the request body before sending it to the provider if the provider's documentation confirms it is unsupported [1][4][6]. - If you are using an integration tool (like Claude Code or a proxy), ensure you are on the latest version, as many of these issues are resolved by adding request transformers that selectively strip unsupported fields [2][3][7]. - For structured outputs on restricted providers, rely on system prompt instructions to enforce the output format instead of using theoutput_configAPI parameter [2][3]. For detailed configuration, refer to the provider-specific documentation for Amazon Bedrock or Google Vertex AI, as their support for these parameters can differ from the standard Anthropic API [8][9][10].Citations:
output_configsent to Vertex AI causesinvalid_request_erroron session title generation anthropics/claude-code#52312🌐 Web query:
site:platform.claude.com effort Claude Haiku 4.5 output_config ignored unsupported models💡 Result:
Based on current Claude Platform documentation, Claude Haiku 4.5 does not support the
output_config.effortparameter [1]. In the Claude API, unsupported fields or parameters sent to a model are generally handled in one of two ways: they are either silently ignored [2] or they trigger a validation error [3][4]. When specific parameters likeoutput_config.effort(which is typically reserved for models that support adaptive thinking, such as Claude Opus 4.8 or Claude Fable 5 [4][5]) are passed to a model that does not support them, the API may reject the request with a 400-series error [4]. If you are encountering issues, ensure your request parameters align with the capabilities of Claude Haiku 4.5: 1. Adaptive thinking and theoutput_config.effortparameter are not supported on Claude Haiku 4.5 [1]. 2. For structured outputs, the API usesoutput_config.format[6][4]. Ensure you are not conflatingoutput_config.effortwith otheroutput_configsub-parameters. 3. If you are using a library (such as an OpenAI-compatible SDK), note that some libraries may attempt to map parameters automatically, which can lead to unexpected errors if the underlying model does not support them [2]. You should check your API request payload to ensure that theoutput_configobject only contains fields valid for the model you are using.Citations:
Gate
effortby model. Claude Haiku 4.5 does not acceptoutput_config.effort, so this helper should only attach it for supported Anthropic models (or reject unsupportedbaseModel/effortcombinations). Otherwise aclaude-haiku-*caller can get a 4xx from Anthropic.🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.