@oh-my-pi/pi-ai 13.13.2 → 13.14.2

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,30 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [13.14.2] - 2026-03-21
6
+ ### Changed
7
+
8
+ - Updated thinking configuration format from `levels` array to `minLevel` and `maxLevel` properties for improved clarity
9
+ - Corrected context window from 400000 to 272000 tokens for GPT-5.4 mini and nano variants on Codex transport
10
+ - Normalized GPT-5.4 variant priority handling to use parsed variant instead of special-casing raw model IDs
11
+ - Added support for `mini` variant in OpenAI model parsing regex
12
+
13
+ ### Fixed
14
+
15
+ - Fixed inconsistent thinking level configuration across multiple model definitions
16
+
17
+ ## [13.14.0] - 2026-03-20
18
+
19
+ ### Fixed
20
+
21
+ - Fixed resumed OpenAI Responses sessions to avoid replaying stale same-provider native history on the first follow-up after process restart ([#488](https://github.com/can1357/oh-my-pi/issues/488))
22
+
23
+ ### Added
24
+
25
+ - Added bundled GPT-5.4 mini model metadata for OpenAI, OpenAI Codex, and GitHub Copilot, including low-to-xhigh thinking support and GitHub Copilot premium multiplier metadata
26
+ - Added bundled GPT-5.4 nano model metadata for OpenAI and OpenAI Codex, including low-to-xhigh thinking support
27
+
28
+
5
29
  ## [13.13.2] - 2026-03-18
6
30
  ### Changed
7
31
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-ai",
4
- "version": "13.13.2",
4
+ "version": "13.14.2",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -41,7 +41,7 @@
41
41
  "@aws-sdk/client-bedrock-runtime": "^3",
42
42
  "@bufbuild/protobuf": "^2.11",
43
43
  "@google/genai": "^1.43",
44
- "@oh-my-pi/pi-utils": "13.13.2",
44
+ "@oh-my-pi/pi-utils": "13.14.2",
45
45
  "@sinclair/typebox": "^0.34",
46
46
  "@smithy/node-http-handler": "^4.4",
47
47
  "ajv": "^8.18",
@@ -40,7 +40,13 @@ type SemVer = {
40
40
 
41
41
  type GeminiKind = "pro" | "flash";
42
42
  type AnthropicKind = "opus" | "sonnet";
43
- type OpenAIVariant = "base" | "codex" | "codex-max" | "codex-mini" | "codex-spark" | "max" | "nano";
43
+ type OpenAIVariant = "base" | "codex" | "codex-max" | "codex-mini" | "codex-spark" | "mini" | "max" | "nano";
44
+
45
+ const CODEX_GPT_5_4_PRIORITY_BY_VARIANT: Partial<Record<OpenAIVariant, number>> = {
46
+ base: 0,
47
+ mini: 1,
48
+ nano: 2,
49
+ };
44
50
 
45
51
  interface GeminiModel {
46
52
  family: "gemini";
@@ -296,6 +302,20 @@ function applyOpenAICatalogPolicy(model: ApiModel<Api>, parsedModel: OpenAIModel
296
302
  // Codex models: 400K figure includes output budget; input window is 272K.
297
303
  if (parsedModel.variant.startsWith("codex") && parsedModel.variant !== "codex-spark") {
298
304
  model.contextWindow = 272000;
305
+ return;
306
+ }
307
+ // GPT-5.4 mini/nano use plain OpenAI IDs on the Codex transport, but Codex still
308
+ // enforces the lower prompt budget for these variants. Codex discovery can also
309
+ // report inconsistent priorities for the GPT-5.4 family, so normalize by parsed
310
+ // variant instead of special-casing raw model ids.
311
+ if (model.api === "openai-codex-responses" && semverEqual(parsedModel.version, "5.4")) {
312
+ const normalizedPriority = CODEX_GPT_5_4_PRIORITY_BY_VARIANT[parsedModel.variant];
313
+ if (normalizedPriority !== undefined) {
314
+ model.priority = normalizedPriority;
315
+ }
316
+ if (parsedModel.variant === "mini" || parsedModel.variant === "nano") {
317
+ model.contextWindow = 272000;
318
+ }
299
319
  }
300
320
  }
301
321
 
@@ -374,7 +394,10 @@ function inferAnthropicSupportedEfforts<TApi extends Api>(
374
394
  parsedModel: AnthropicModel,
375
395
  model: ApiModel<TApi>,
376
396
  ): readonly Effort[] {
377
- if (model.api === "anthropic-messages" && semverGte(parsedModel.version, "4.6")) {
397
+ if (
398
+ (model.api === "anthropic-messages" || model.api === "bedrock-converse-stream") &&
399
+ semverGte(parsedModel.version, "4.6")
400
+ ) {
378
401
  return parsedModel.kind === "opus" ? DEFAULT_REASONING_EFFORTS_WITH_XHIGH : DEFAULT_REASONING_EFFORTS;
379
402
  }
380
403
  return inferFallbackEfforts(model);
@@ -427,6 +450,14 @@ function inferThinkingControlMode<TApi extends Api>(
427
450
  return "budget";
428
451
 
429
452
  case "bedrock-converse-stream":
453
+ if (parsedModel.family === "anthropic") {
454
+ if (semverGte(parsedModel.version, "4.6") && parsedModel.kind === "opus") {
455
+ return "anthropic-adaptive";
456
+ }
457
+ if (semverGte(parsedModel.version, "4.5")) {
458
+ return "anthropic-budget-effort";
459
+ }
460
+ }
430
461
  return "budget";
431
462
 
432
463
  default:
@@ -460,7 +491,7 @@ function parseGeminiModel(modelId: string): GeminiModel | null {
460
491
  }
461
492
 
462
493
  function parseAnthropicModel(modelId: string): AnthropicModel | null {
463
- const match = /claude-(opus|sonnet)-(\d+(?:[.-]\d+){0,2})\b/.exec(modelId);
494
+ const match = /claude-(opus|sonnet)-(\d{1,2}(?:[.-]\d{1,2}){0,2})\b/.exec(modelId);
464
495
  if (!match) {
465
496
  return null;
466
497
  }
@@ -472,7 +503,7 @@ function parseAnthropicModel(modelId: string): AnthropicModel | null {
472
503
  }
473
504
 
474
505
  function parseOpenAIModel(modelId: string): OpenAIModel | null {
475
- const match = /gpt-(\d+(?:\.\d+){0,2})(?:-(codex-spark|codex-mini|codex-max|codex|max|nano))?\b/.exec(modelId);
506
+ const match = /gpt-(\d+(?:\.\d+){0,2})(?:-(codex-spark|codex-mini|codex-max|codex|mini|max|nano))?\b/.exec(modelId);
476
507
  if (!match) {
477
508
  return null;
478
509
  }