@oh-my-pi/pi-ai 18.4.5 → 18.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.4.6] - 2026-10-01
6
+
7
+ ### Fixed
8
+
9
+ - Fixed forced tool calls failing for Claude Opus 5.5 and Sonnet 5.5 through Amazon Bedrock, including required-tool retries in plan mode.
10
+
5
11
  ## [18.4.5] - 2026-09-30
6
12
 
7
13
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-ai",
3
- "version": "18.4.5",
3
+ "version": "18.4.6",
4
4
  "description": "Unified LLM API with automatic model discovery and provider configuration",
5
5
  "keywords": [
6
6
  "ai",
@@ -155,11 +155,11 @@
155
155
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
156
156
  },
157
157
  "dependencies": {
158
- "@oh-my-pi/omptype": "18.4.5",
159
- "@oh-my-pi/pi-catalog": "18.4.5",
160
- "@oh-my-pi/pi-natives": "18.4.5",
161
- "@oh-my-pi/pi-utils": "18.4.5",
162
- "@oh-my-pi/pi-wire": "18.4.5"
158
+ "@oh-my-pi/omptype": "18.4.6",
159
+ "@oh-my-pi/pi-catalog": "18.4.6",
160
+ "@oh-my-pi/pi-natives": "18.4.6",
161
+ "@oh-my-pi/pi-utils": "18.4.6",
162
+ "@oh-my-pi/pi-wire": "18.4.6"
163
163
  },
164
164
  "devDependencies": {
165
165
  "@types/bun": "^1.3.14"
@@ -459,14 +459,16 @@ export const streamBedrock: StreamFunction<"bedrock-converse-stream"> = (
459
459
  ? (options.anthropicPrefixMismatchBehavior ?? "drop_block")
460
460
  : undefined;
461
461
 
462
- // Bedrock rejects thinking + forced tool_choice. Fable's adaptive
463
- // thinking cannot be disabled, so downgrade its forced choice instead.
464
- if (toolConfig?.toolChoice && additionalModelRequestFields) {
465
- const tc = toolConfig.toolChoice;
466
- if (tc.any || tc.tool) {
467
- if (prefixMismatchBehavior) toolConfig = { ...toolConfig, toolChoice: { auto: {} } };
468
- else additionalModelRequestFields = undefined;
469
- }
462
+ // Some models (Opus/Sonnet 5.5) reject forced tool use outright; keep the
463
+ // tools offered under `auto` and leave thinking intact.
464
+ const forcedChoice = toolConfig?.toolChoice?.any || toolConfig?.toolChoice?.tool;
465
+ if (toolConfig && forcedChoice && !model.compat.supportsForcedToolChoice) {
466
+ toolConfig = { ...toolConfig, toolChoice: { auto: {} } };
467
+ } else if (toolConfig && forcedChoice && additionalModelRequestFields) {
468
+ // Bedrock rejects thinking + forced tool_choice. Fable's adaptive
469
+ // thinking cannot be disabled, so downgrade its forced choice instead.
470
+ if (prefixMismatchBehavior) toolConfig = { ...toolConfig, toolChoice: { auto: {} } };
471
+ else additionalModelRequestFields = undefined;
470
472
  }
471
473
  if (prefixMismatchBehavior) {
472
474
  additionalModelRequestFields = applyBedrockThinkingBinding(