@@ -68,6 +68,26 @@ interface BedrockInferenceConfig {
6868 temperature ?: number
6969}
7070
71+ /**
72+ * Models that write short user-facing progress updates between tool calls
73+ * ("what I found, what I'm doing next") as separate `thinking` blocks rather than `text` blocks.
74+ *
75+ * At the default `thinking.display` ("omitted" on these models), those blocks come back with an
76+ * empty `thinking` field, so explanations the user asks for before a tool call never reach the UI.
77+ * `display: "updates"` (beta) returns the progress-update text while reasoning stays hidden.
78+ * See #1820.
79+ *
80+ * - https://platform.claude.com/docs/en/build-with-claude/thinking#progress-updates
81+ * - https://platform.claude.com/docs/en/models/opus-5-5/migration-guide#text-between-tool-calls
82+ * - https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#user-facing-progress-updates
83+ */
84+ const PROGRESS_UPDATE_MODEL_PATTERNS = [
85+ "opus-5-5" , // Claude Opus 5.5
86+ "fable-5" , // Claude Fable 5 and 5.1
87+ "mythos-5-1" , // Claude Mythos 5.1
88+ ] as const
89+ const THINKING_DISPLAY_UPDATES_BETA = "thinking-display-updates-2026-08-18"
90+
7191// Define interface for Bedrock additional model request fields
7292// This includes thinking configuration, 1M context beta, and other model-specific parameters
7393interface BedrockAdditionalModelFields {
@@ -79,8 +99,8 @@ interface BedrockAdditionalModelFields {
7999 | {
80100 // Claude 4.7+ adaptive thinking — no budget_tokens, uses output_config.effort instead
81101 type : "adaptive"
82- // "summarized" shows thinking content in UI; omit to keep thinking internal only
83- display ?: "summarized" | "none "
102+ // "updates" returns only progress-update text, "summarized" also reasoning summaries.
103+ display ?: "summarized" | "updates" | "omitted "
84104 }
85105 | { type : "disabled" }
86106 output_config ?: {
@@ -364,6 +384,11 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
364384 * Accepts a model ID (with or without a cross-region/global prefix) and strips
365385 * the prefix via parseBaseModelId before matching.
366386 */
387+ private writesProgressUpdates ( modelId : string ) : boolean {
388+ const baseModelId = this . parseBaseModelId ( modelId )
389+ return PROGRESS_UPDATE_MODEL_PATTERNS . some ( ( pattern ) => baseModelId . includes ( pattern ) )
390+ }
391+
367392 private isAdaptiveThinkingModel ( modelId : string ) : boolean {
368393 const baseModelId = this . getCapabilityModelId ( modelId )
369394 return (
@@ -517,6 +542,17 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
517542 // Omitting thinking enables it by default on these models. Adaptive-only
518543 // models (Fable 5/5.1, Opus 5.5) reject "disabled", so they keep the omit behavior.
519544 additionalModelRequestFields = { thinking : { type : "disabled" } }
545+ } else if ( this . writesProgressUpdates ( modelConfig . id ) ) {
546+ // Omitting `thinking` doesn't turn thinking off on these models (they reject "disabled"),
547+ // it only leaves the default display, which empties the progress updates.
548+ // See PROGRESS_UPDATE_MODEL_PATTERNS.
549+ additionalModelRequestFields = { thinking : { type : "adaptive" , display : "updates" } }
550+ logger . info ( "Requesting progress-update text for Bedrock request with reasoning off" , {
551+ ctx : "bedrock" ,
552+ modelId : modelConfig . id ,
553+ thinking : additionalModelRequestFields . thinking ,
554+ beta : THINKING_DISPLAY_UPDATES_BETA ,
555+ } )
520556 }
521557
522558 const inferenceConfig : BedrockInferenceConfig = {
@@ -559,6 +595,11 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
559595 anthropicBetas . push ( "fine-grained-tool-streaming-2025-05-14" )
560596 }
561597
598+ const thinkingDisplay = additionalModelRequestFields ?. thinking
599+ if ( thinkingDisplay ?. type === "adaptive" && thinkingDisplay . display === "updates" ) {
600+ anthropicBetas . push ( THINKING_DISPLAY_UPDATES_BETA )
601+ }
602+
562603 // Apply anthropic_beta to additionalModelRequestFields if any betas are needed
563604 if ( anthropicBetas . length > 0 ) {
564605 if ( ! additionalModelRequestFields ) {
0 commit comments