diff --git a/CHANGELOG.md b/CHANGELOG.md index c38630e8e..4a1404b96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ - Streamed `` segments are stripped before partial replies are emitted. - System prompt now tags allowlisted owner numbers as the user identity to avoid mistaken “friend” assumptions. - LM Studio/Ollama replies now require tags; streaming ignores content until begins. +- LM Studio responses API: tools payloads no longer include `strict: null`, and LM Studio no longer gets forced `/` tags. - `process log` pagination is now line-based (omit `offset` to grab the last N lines). - macOS WebChat: assistant bubbles now update correctly when toggling light/dark mode. - macOS: avoid spawning a duplicate gateway process when an external listener already exists. diff --git a/patches/@mariozechner__pi-ai.patch b/patches/@mariozechner__pi-ai.patch new file mode 100644 index 000000000..8ac6d7d8e --- /dev/null +++ b/patches/@mariozechner__pi-ai.patch @@ -0,0 +1,12 @@ +diff --git a/dist/providers/openai-responses.js b/dist/providers/openai-responses.js +index 20fb0a22aaa28f7ff7c2f44a8b628fa1d9d7d936..c2bc63f483f3285b00755901ba97db810221cea6 100644 +--- a/dist/providers/openai-responses.js ++++ b/dist/providers/openai-responses.js +@@ -486,7 +486,6 @@ function convertTools(tools) { + name: tool.name, + description: tool.description, + parameters: tool.parameters, // TypeBox already generates JSON Schema +- strict: null, + })); + } + function mapStopReason(status) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adf49549a..86f28ae6a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + '@mariozechner/pi-ai': + hash: bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832 + path: patches/@mariozechner__pi-ai.patch + importers: .: @@ -19,7 +24,7 @@ importers: version: 0.30.2(ws@8.18.3)(zod@4.2.1) '@mariozechner/pi-ai': specifier: ^0.30.2 - version: 0.30.2(ws@8.18.3)(zod@4.2.1) + version: 0.30.2(patch_hash=bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832)(ws@8.18.3)(zod@4.2.1) '@mariozechner/pi-coding-agent': specifier: ^0.30.2 version: 0.30.2(ws@8.18.3)(zod@4.2.1) @@ -3247,7 +3252,7 @@ snapshots: '@mariozechner/pi-agent-core@0.30.2(ws@8.18.3)(zod@4.2.1)': dependencies: - '@mariozechner/pi-ai': 0.30.2(ws@8.18.3)(zod@4.2.1) + '@mariozechner/pi-ai': 0.30.2(patch_hash=bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832)(ws@8.18.3)(zod@4.2.1) '@mariozechner/pi-tui': 0.30.2 transitivePeerDependencies: - '@modelcontextprotocol/sdk' @@ -3257,7 +3262,7 @@ snapshots: - ws - zod - '@mariozechner/pi-ai@0.30.2(ws@8.18.3)(zod@4.2.1)': + '@mariozechner/pi-ai@0.30.2(patch_hash=bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832)(ws@8.18.3)(zod@4.2.1)': dependencies: '@anthropic-ai/sdk': 0.71.2(zod@4.2.1) '@google/genai': 1.34.0 @@ -3280,7 +3285,7 @@ snapshots: '@mariozechner/pi-coding-agent@0.30.2(ws@8.18.3)(zod@4.2.1)': dependencies: '@mariozechner/pi-agent-core': 0.30.2(ws@8.18.3)(zod@4.2.1) - '@mariozechner/pi-ai': 0.30.2(ws@8.18.3)(zod@4.2.1) + '@mariozechner/pi-ai': 0.30.2(patch_hash=bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832)(ws@8.18.3)(zod@4.2.1) '@mariozechner/pi-tui': 0.30.2 chalk: 5.6.2 cli-highlight: 2.1.11 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 871880305..869f33732 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,6 @@ packages: - - "." - - "ui" + - . + - ui onlyBuiltDependencies: - '@whiskeysockets/baileys' @@ -8,3 +8,6 @@ onlyBuiltDependencies: - esbuild - protobufjs - sharp + +patchedDependencies: + '@mariozechner/pi-ai': patches/@mariozechner__pi-ai.patch diff --git a/src/agents/pi-embedded-runner.ts b/src/agents/pi-embedded-runner.ts index b2a216453..19e82499d 100644 --- a/src/agents/pi-embedded-runner.ts +++ b/src/agents/pi-embedded-runner.ts @@ -417,8 +417,7 @@ export async function runEmbeddedPiAgent(params: { node: process.version, model: `${provider}/${modelId}`, }; - const reasoningTagHint = - provider === "lmstudio" || provider === "ollama"; + const reasoningTagHint = provider === "ollama"; const systemPrompt = buildSystemPrompt({ appendPrompt: buildAgentSystemPromptAppend({ workspaceDir: resolvedWorkspace, diff --git a/src/auto-reply/reply.ts b/src/auto-reply/reply.ts index fa7f9b80c..04fe831cd 100644 --- a/src/auto-reply/reply.ts +++ b/src/auto-reply/reply.ts @@ -1177,8 +1177,7 @@ export async function getReplyFromConfig( prompt: commandBody, extraSystemPrompt: groupIntro || undefined, ownerNumbers: ownerList.length > 0 ? ownerList : undefined, - enforceFinalTag: - provider === "lmstudio" || provider === "ollama" ? true : undefined, + enforceFinalTag: provider === "ollama" ? true : undefined, provider, model, thinkLevel: resolvedThinkLevel,