From ddb6d97bf090e825a6ec6a9afa9e0c9516d9072e Mon Sep 17 00:00:00 2001 From: True Byte Date: Tue, 21 Jul 2026 05:39:46 +0800 Subject: [PATCH] feat(pi): add 'max' thinking level support (#2267) * feat(pi): add 'max' thinking level support Pi recently introduced a new 'max' thinking level beyond 'xhigh'. This adds it to the type union, the UI options array, and the runtime type guard so Paseo users can select it. Changes: - rpc-types.ts: add 'max' to PiThinkingLevel union - agent.ts: add max entry to PI_THINKING_OPTIONS - agent.ts: add 'max' to isPiThinkingLevel guard * fix(pi): clarify xhigh description after adding max level xhigh's 'Maximum reasoning' is now misleading since max is the true maximum. Changed to 'Very deep reasoning' per review feedback. --- packages/server/src/server/agent/providers/pi/agent.ts | 6 ++++-- packages/server/src/server/agent/providers/pi/rpc-types.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/server/src/server/agent/providers/pi/agent.ts b/packages/server/src/server/agent/providers/pi/agent.ts index e87ff42ec..d5fcec39d 100644 --- a/packages/server/src/server/agent/providers/pi/agent.ts +++ b/packages/server/src/server/agent/providers/pi/agent.ts @@ -173,7 +173,8 @@ const PI_THINKING_OPTIONS: ReadonlyArray<{ { id: "low", label: "Low", description: "Faster reasoning" }, { id: "medium", label: "Medium", description: "Balanced reasoning", isDefault: true }, { id: "high", label: "High", description: "Deeper reasoning" }, - { id: "xhigh", label: "XHigh", description: "Maximum reasoning" }, + { id: "xhigh", label: "XHigh", description: "Very deep reasoning" }, + { id: "max", label: "Max", description: "Extreme reasoning" }, ] as const; export interface PiRpcAgentClientOptions { @@ -329,7 +330,8 @@ function isPiThinkingLevel(value: string | null | undefined): value is PiThinkin value === "low" || value === "medium" || value === "high" || - value === "xhigh" + value === "xhigh" || + value === "max" ); } diff --git a/packages/server/src/server/agent/providers/pi/rpc-types.ts b/packages/server/src/server/agent/providers/pi/rpc-types.ts index 5174f98fe..949ff9303 100644 --- a/packages/server/src/server/agent/providers/pi/rpc-types.ts +++ b/packages/server/src/server/agent/providers/pi/rpc-types.ts @@ -1,4 +1,4 @@ -export type PiThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh"; +export type PiThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"; export interface PiImageContent { type: "image";