@f5-sales-demo/pi-ai 23.10.3 → 23.10.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/pi-ai",
4
- "version": "23.10.3",
4
+ "version": "23.10.4",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -46,7 +46,7 @@
46
46
  "@anthropic-ai/sdk": "0.124.0",
47
47
  "@aws-sdk/client-bedrock-runtime": "3.1127.0",
48
48
  "@bufbuild/protobuf": "2.14.1",
49
- "@f5-sales-demo/pi-utils": "23.10.3",
49
+ "@f5-sales-demo/pi-utils": "23.10.4",
50
50
  "@google/genai": "2.21.0",
51
51
  "@sinclair/typebox": "0.34.52",
52
52
  "@smithy/node-http-handler": "4.12.1",
@@ -150,9 +150,6 @@ export function applyCodexInteractionMetadata<TApi extends Api>(
150
150
  const budget = resolveCodexContextBudget(model.id, "standard", advertisedLimit)!;
151
151
  return {
152
152
  ...model,
153
- ...(model.provider === "openai-codex" && model.id === "gpt-6.1-sol"
154
- ? { compat: { supportsWebSocketSteering: true, ...model.compat } as Model<TApi>["compat"] }
155
- : {}),
156
153
  thinking:
157
154
  model.provider === "openai-codex"
158
155
  ? (model.thinking ?? interaction.thinking)
@@ -192,7 +192,7 @@ function getCacheControl(
192
192
  }
193
193
 
194
194
  // Stealth mode: Mimic Claude Code headers and tool prefixing.
195
- export const claudeCodeVersion = "2.1.312";
195
+ export const claudeCodeVersion = "2.1.314";
196
196
  export const claudeToolPrefix: string = "proxy_";
197
197
  export const claudeCodeSystemInstruction = "You are a Claude agent, built on Anthropic's Claude Agent SDK.";
198
198
 
@@ -2279,6 +2279,7 @@ class CodexWebSocketConnection {
2279
2279
  #waiters: Array<() => void> = [];
2280
2280
  #connectPromise?: Promise<void>;
2281
2281
  #activeRequest = false;
2282
+ #steeringUnsupported = false;
2282
2283
  #steerWaiters = new Map<string, { resolve: (ack: CodexSteerAck) => void; reject: (error: Error) => void }>();
2283
2284
 
2284
2285
  constructor(url: string, headers: Record<string, string>, options: CodexWebSocketConnectionOptions) {
@@ -2413,12 +2414,33 @@ class CodexWebSocketConnection {
2413
2414
  waiter.resolve(
2414
2415
  parsed.type === "response.steer.accepted" && steer?.id
2415
2416
  ? { accepted: true, id: steer.id }
2416
- : { accepted: false },
2417
+ : {
2418
+ accepted: false,
2419
+ code: typeof parsed.code === "string" ? parsed.code : undefined,
2420
+ message: typeof parsed.message === "string" ? parsed.message : undefined,
2421
+ },
2417
2422
  );
2418
2423
  } else if (parsed.type === "response.steer.failed" && steer?.id)
2419
2424
  this.#push(createCodexWebSocketTransportError("accepted steering was not committed"));
2420
2425
  return;
2421
2426
  }
2427
+ // This rejection belongs to the sole in-flight steering submission,
2428
+ // not to the independent response that is still streaming.
2429
+ if (
2430
+ parsed.type === "error" &&
2431
+ parsed.code === "unsupported_native_inflight_message" &&
2432
+ this.#steerWaiters.size === 1
2433
+ ) {
2434
+ this.#steeringUnsupported = true;
2435
+ const waiter = this.#steerWaiters.values().next().value!;
2436
+ this.#steerWaiters.clear();
2437
+ waiter.resolve({
2438
+ accepted: false,
2439
+ code: parsed.code,
2440
+ message: typeof parsed.message === "string" ? parsed.message : undefined,
2441
+ });
2442
+ return;
2443
+ }
2422
2444
  this.#push(parsed);
2423
2445
  } catch (error) {
2424
2446
  this.#push(createCodexWebSocketTransportError(String(error)));
@@ -2437,6 +2459,7 @@ class CodexWebSocketConnection {
2437
2459
  previousResponseId: string,
2438
2460
  input: import("./openai-codex/request-transformer").InputItem[],
2439
2461
  ): Promise<CodexSteerAck> {
2462
+ if (this.#steeringUnsupported) return { accepted: false, code: "unsupported_native_inflight_message" };
2440
2463
  if (!this.#socket || !this.isOpen()) throw new Error("Steering socket unavailable");
2441
2464
  const id = previousResponseId;
2442
2465
  const { promise, resolve, reject } = Promise.withResolvers<CodexSteerAck>();