chore: refresh pi-ai patch repro note
This commit is contained in:
@@ -34,12 +34,13 @@ index 188a8294f26fe1bfe3fb298a7f58e4d8eaf2a529..a3aeb6a7ff53bc4f7f44362adb950b2c
|
|||||||
const reasoningItem = JSON.parse(block.thinkingSignature);
|
const reasoningItem = JSON.parse(block.thinkingSignature);
|
||||||
output.push(reasoningItem);
|
output.push(reasoningItem);
|
||||||
}
|
}
|
||||||
@@ -470,6 +476,15 @@ function convertMessages(model, context) {
|
@@ -470,6 +476,16 @@ function convertMessages(model, context) {
|
||||||
}
|
}
|
||||||
if (output.length === 0)
|
if (output.length === 0)
|
||||||
continue;
|
continue;
|
||||||
+ // OpenAI rejects standalone reasoning items when replaying a tool-only turn.
|
+ // OpenAI rejects standalone reasoning items when replaying a tool-only turn.
|
||||||
+ // Only submit reasoning items when we also submit an assistant message item.
|
+ // Only submit reasoning items when we also submit an assistant message item.
|
||||||
|
+ // Repro: pnpm test src/agents/openai-responses.reasoning-replay.test.ts
|
||||||
+ const hasMessage = output.some((item) => item?.type === "message");
|
+ const hasMessage = output.some((item) => item?.type === "message");
|
||||||
+ if (!hasMessage) {
|
+ if (!hasMessage) {
|
||||||
+ for (let i = output.length - 1; i >= 0; i -= 1) {
|
+ for (let i = output.length - 1; i >= 0; i -= 1) {
|
||||||
@@ -50,7 +51,7 @@ index 188a8294f26fe1bfe3fb298a7f58e4d8eaf2a529..a3aeb6a7ff53bc4f7f44362adb950b2c
|
|||||||
messages.push(...output);
|
messages.push(...output);
|
||||||
}
|
}
|
||||||
else if (msg.role === "toolResult") {
|
else if (msg.role === "toolResult") {
|
||||||
@@ -515,7 +530,7 @@ function convertTools(tools) {
|
@@ -515,7 +531,7 @@ function convertTools(tools) {
|
||||||
name: tool.name,
|
name: tool.name,
|
||||||
description: tool.description,
|
description: tool.description,
|
||||||
parameters: tool.parameters,
|
parameters: tool.parameters,
|
||||||
@@ -63,12 +64,13 @@ diff --git a/dist/providers/openai-responses.js b/dist/providers/openai-response
|
|||||||
index f07085c64390b211340d6a826b28ea9c2e77302f..523ed38a5a6151d6ff08dd89120315e7aaaf19b6 100644
|
index f07085c64390b211340d6a826b28ea9c2e77302f..523ed38a5a6151d6ff08dd89120315e7aaaf19b6 100644
|
||||||
--- a/dist/providers/openai-responses.js
|
--- a/dist/providers/openai-responses.js
|
||||||
+++ b/dist/providers/openai-responses.js
|
+++ b/dist/providers/openai-responses.js
|
||||||
@@ -436,6 +436,15 @@ function convertMessages(model, context) {
|
@@ -436,6 +436,16 @@ function convertMessages(model, context) {
|
||||||
}
|
}
|
||||||
if (output.length === 0)
|
if (output.length === 0)
|
||||||
continue;
|
continue;
|
||||||
+ // OpenAI rejects standalone reasoning items when replaying a tool-only turn.
|
+ // OpenAI rejects standalone reasoning items when replaying a tool-only turn.
|
||||||
+ // Only submit reasoning items when we also submit an assistant message item.
|
+ // Only submit reasoning items when we also submit an assistant message item.
|
||||||
|
+ // Repro: pnpm test src/agents/openai-responses.reasoning-replay.test.ts
|
||||||
+ const hasMessage = output.some((item) => item?.type === "message");
|
+ const hasMessage = output.some((item) => item?.type === "message");
|
||||||
+ if (!hasMessage) {
|
+ if (!hasMessage) {
|
||||||
+ for (let i = output.length - 1; i >= 0; i -= 1) {
|
+ for (let i = output.length - 1; i >= 0; i -= 1) {
|
||||||
|
|||||||
42
pnpm-lock.yaml
generated
42
pnpm-lock.yaml
generated
@@ -8,21 +8,9 @@ overrides:
|
|||||||
'@sinclair/typebox': 0.34.47
|
'@sinclair/typebox': 0.34.47
|
||||||
|
|
||||||
patchedDependencies:
|
patchedDependencies:
|
||||||
'@mariozechner/pi-agent-core':
|
|
||||||
hash: 01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4
|
|
||||||
path: patches/@mariozechner__pi-agent-core.patch
|
|
||||||
'@mariozechner/pi-ai@0.42.2':
|
'@mariozechner/pi-ai@0.42.2':
|
||||||
hash: 53800c5f6cd7b43591675f7d836e599255e4a39cdd38d166b8e35947c835db93
|
hash: d8d7c692952a4064a56dc4c67818939d17a48886eb355867de2bcc9118915c97
|
||||||
path: patches/@mariozechner__pi-ai@0.42.2.patch
|
path: patches/@mariozechner__pi-ai@0.42.2.patch
|
||||||
'@mariozechner/pi-coding-agent':
|
|
||||||
hash: 58af7c712ebe270527c2ad9d3351fac39d6cd4b81cc475a258d87840b446b90e
|
|
||||||
path: patches/@mariozechner__pi-coding-agent.patch
|
|
||||||
playwright-core@1.57.0:
|
|
||||||
hash: 66f1f266424dbe354068aaa5bba87bfb0e1d7d834a938c25dd70d43cdf1c1b02
|
|
||||||
path: patches/playwright-core@1.57.0.patch
|
|
||||||
qrcode-terminal:
|
|
||||||
hash: ed82029850dbdf551f5df1de320945af52b8ea8500cc7bd4f39258e7a3d92e12
|
|
||||||
path: patches/qrcode-terminal.patch
|
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
@@ -45,13 +33,13 @@ importers:
|
|||||||
version: 1.3.4
|
version: 1.3.4
|
||||||
'@mariozechner/pi-agent-core':
|
'@mariozechner/pi-agent-core':
|
||||||
specifier: ^0.42.2
|
specifier: ^0.42.2
|
||||||
version: 0.42.2(patch_hash=01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4)(ws@8.19.0)(zod@4.3.5)
|
version: 0.42.2(ws@8.19.0)(zod@4.3.5)
|
||||||
'@mariozechner/pi-ai':
|
'@mariozechner/pi-ai':
|
||||||
specifier: ^0.42.2
|
specifier: ^0.42.2
|
||||||
version: 0.42.2(patch_hash=53800c5f6cd7b43591675f7d836e599255e4a39cdd38d166b8e35947c835db93)(ws@8.19.0)(zod@4.3.5)
|
version: 0.42.2(patch_hash=d8d7c692952a4064a56dc4c67818939d17a48886eb355867de2bcc9118915c97)(ws@8.19.0)(zod@4.3.5)
|
||||||
'@mariozechner/pi-coding-agent':
|
'@mariozechner/pi-coding-agent':
|
||||||
specifier: ^0.42.2
|
specifier: ^0.42.2
|
||||||
version: 0.42.2(patch_hash=58af7c712ebe270527c2ad9d3351fac39d6cd4b81cc475a258d87840b446b90e)(ws@8.19.0)(zod@4.3.5)
|
version: 0.42.2(ws@8.19.0)(zod@4.3.5)
|
||||||
'@mariozechner/pi-tui':
|
'@mariozechner/pi-tui':
|
||||||
specifier: ^0.42.2
|
specifier: ^0.42.2
|
||||||
version: 0.42.2
|
version: 0.42.2
|
||||||
@@ -129,13 +117,13 @@ importers:
|
|||||||
version: 0.2.0
|
version: 0.2.0
|
||||||
playwright-core:
|
playwright-core:
|
||||||
specifier: 1.57.0
|
specifier: 1.57.0
|
||||||
version: 1.57.0(patch_hash=66f1f266424dbe354068aaa5bba87bfb0e1d7d834a938c25dd70d43cdf1c1b02)
|
version: 1.57.0
|
||||||
proper-lockfile:
|
proper-lockfile:
|
||||||
specifier: ^4.1.2
|
specifier: ^4.1.2
|
||||||
version: 4.1.2
|
version: 4.1.2
|
||||||
qrcode-terminal:
|
qrcode-terminal:
|
||||||
specifier: ^0.12.0
|
specifier: ^0.12.0
|
||||||
version: 0.12.0(patch_hash=ed82029850dbdf551f5df1de320945af52b8ea8500cc7bd4f39258e7a3d92e12)
|
version: 0.12.0
|
||||||
sharp:
|
sharp:
|
||||||
specifier: ^0.34.5
|
specifier: ^0.34.5
|
||||||
version: 0.34.5
|
version: 0.34.5
|
||||||
@@ -3787,9 +3775,9 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- tailwindcss
|
- tailwindcss
|
||||||
|
|
||||||
'@mariozechner/pi-agent-core@0.42.2(patch_hash=01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4)(ws@8.19.0)(zod@4.3.5)':
|
'@mariozechner/pi-agent-core@0.42.2(ws@8.19.0)(zod@4.3.5)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@mariozechner/pi-ai': 0.42.2(patch_hash=53800c5f6cd7b43591675f7d836e599255e4a39cdd38d166b8e35947c835db93)(ws@8.19.0)(zod@4.3.5)
|
'@mariozechner/pi-ai': 0.42.2(patch_hash=d8d7c692952a4064a56dc4c67818939d17a48886eb355867de2bcc9118915c97)(ws@8.19.0)(zod@4.3.5)
|
||||||
'@mariozechner/pi-tui': 0.42.2
|
'@mariozechner/pi-tui': 0.42.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@modelcontextprotocol/sdk'
|
- '@modelcontextprotocol/sdk'
|
||||||
@@ -3799,7 +3787,7 @@ snapshots:
|
|||||||
- ws
|
- ws
|
||||||
- zod
|
- zod
|
||||||
|
|
||||||
'@mariozechner/pi-ai@0.42.2(patch_hash=53800c5f6cd7b43591675f7d836e599255e4a39cdd38d166b8e35947c835db93)(ws@8.19.0)(zod@4.3.5)':
|
'@mariozechner/pi-ai@0.42.2(patch_hash=d8d7c692952a4064a56dc4c67818939d17a48886eb355867de2bcc9118915c97)(ws@8.19.0)(zod@4.3.5)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@anthropic-ai/sdk': 0.71.2(zod@4.3.5)
|
'@anthropic-ai/sdk': 0.71.2(zod@4.3.5)
|
||||||
'@google/genai': 1.34.0
|
'@google/genai': 1.34.0
|
||||||
@@ -3819,11 +3807,11 @@ snapshots:
|
|||||||
- ws
|
- ws
|
||||||
- zod
|
- zod
|
||||||
|
|
||||||
'@mariozechner/pi-coding-agent@0.42.2(patch_hash=58af7c712ebe270527c2ad9d3351fac39d6cd4b81cc475a258d87840b446b90e)(ws@8.19.0)(zod@4.3.5)':
|
'@mariozechner/pi-coding-agent@0.42.2(ws@8.19.0)(zod@4.3.5)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@mariozechner/clipboard': 0.3.0
|
'@mariozechner/clipboard': 0.3.0
|
||||||
'@mariozechner/pi-agent-core': 0.42.2(patch_hash=01312ceb1f6be7e42822c24c9a7a4f7db56b24ae114a364855bd3819779d1cf4)(ws@8.19.0)(zod@4.3.5)
|
'@mariozechner/pi-agent-core': 0.42.2(ws@8.19.0)(zod@4.3.5)
|
||||||
'@mariozechner/pi-ai': 0.42.2(patch_hash=53800c5f6cd7b43591675f7d836e599255e4a39cdd38d166b8e35947c835db93)(ws@8.19.0)(zod@4.3.5)
|
'@mariozechner/pi-ai': 0.42.2(patch_hash=d8d7c692952a4064a56dc4c67818939d17a48886eb355867de2bcc9118915c97)(ws@8.19.0)(zod@4.3.5)
|
||||||
'@mariozechner/pi-tui': 0.42.2
|
'@mariozechner/pi-tui': 0.42.2
|
||||||
chalk: 5.6.2
|
chalk: 5.6.2
|
||||||
cli-highlight: 2.1.11
|
cli-highlight: 2.1.11
|
||||||
@@ -5686,11 +5674,11 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
pngjs: 7.0.0
|
pngjs: 7.0.0
|
||||||
|
|
||||||
playwright-core@1.57.0(patch_hash=66f1f266424dbe354068aaa5bba87bfb0e1d7d834a938c25dd70d43cdf1c1b02): {}
|
playwright-core@1.57.0: {}
|
||||||
|
|
||||||
playwright@1.57.0:
|
playwright@1.57.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
playwright-core: 1.57.0(patch_hash=66f1f266424dbe354068aaa5bba87bfb0e1d7d834a938c25dd70d43cdf1c1b02)
|
playwright-core: 1.57.0
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.2
|
fsevents: 2.3.2
|
||||||
|
|
||||||
@@ -5775,7 +5763,7 @@ snapshots:
|
|||||||
'@thi.ng/bitstream': 2.4.37
|
'@thi.ng/bitstream': 2.4.37
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
qrcode-terminal@0.12.0(patch_hash=ed82029850dbdf551f5df1de320945af52b8ea8500cc7bd4f39258e7a3d92e12): {}
|
qrcode-terminal@0.12.0: {}
|
||||||
|
|
||||||
qs@6.14.1:
|
qs@6.14.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { type Api, getEnvApiKey, type Model } from "@mariozechner/pi-ai";
|
|||||||
import type { ClawdbotConfig } from "../config/config.js";
|
import type { ClawdbotConfig } from "../config/config.js";
|
||||||
import type { ModelProviderConfig } from "../config/types.js";
|
import type { ModelProviderConfig } from "../config/types.js";
|
||||||
import { getShellEnvAppliedKeys } from "../infra/shell-env.js";
|
import { getShellEnvAppliedKeys } from "../infra/shell-env.js";
|
||||||
import { normalizeProviderId } from "./model-selection.js";
|
|
||||||
import {
|
import {
|
||||||
type AuthProfileStore,
|
type AuthProfileStore,
|
||||||
ensureAuthProfileStore,
|
ensureAuthProfileStore,
|
||||||
@@ -10,6 +9,7 @@ import {
|
|||||||
resolveApiKeyForProfile,
|
resolveApiKeyForProfile,
|
||||||
resolveAuthProfileOrder,
|
resolveAuthProfileOrder,
|
||||||
} from "./auth-profiles.js";
|
} from "./auth-profiles.js";
|
||||||
|
import { normalizeProviderId } from "./model-selection.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
ensureAuthProfileStore,
|
ensureAuthProfileStore,
|
||||||
|
|||||||
@@ -559,7 +559,9 @@ export function buildEmbeddedSandboxInfo(
|
|||||||
bashElevated?: BashElevatedDefaults,
|
bashElevated?: BashElevatedDefaults,
|
||||||
): EmbeddedSandboxInfo | undefined {
|
): EmbeddedSandboxInfo | undefined {
|
||||||
if (!sandbox?.enabled) return undefined;
|
if (!sandbox?.enabled) return undefined;
|
||||||
const elevatedAllowed = Boolean(bashElevated?.enabled && bashElevated.allowed);
|
const elevatedAllowed = Boolean(
|
||||||
|
bashElevated?.enabled && bashElevated.allowed,
|
||||||
|
);
|
||||||
return {
|
return {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
workspaceDir: sandbox.workspaceDir,
|
workspaceDir: sandbox.workspaceDir,
|
||||||
|
|||||||
Reference in New Issue
Block a user