diff --git a/package.json b/package.json index 0157fdbf8..1f8f0f902 100644 --- a/package.json +++ b/package.json @@ -140,8 +140,7 @@ "@sinclair/typebox": "0.34.46" }, "patchedDependencies": { - "@mariozechner/pi-ai": "patches/@mariozechner__pi-ai.patch", - "@mariozechner/pi-coding-agent@0.32.3": "patches/@mariozechner__pi-coding-agent@0.32.3.patch" + "@mariozechner/pi-ai": "patches/@mariozechner__pi-ai.patch" } }, "vitest": { diff --git a/patches/@mariozechner__pi-ai.patch b/patches/@mariozechner__pi-ai.patch index 0167c7b85..b4cdf8e51 100644 --- a/patches/@mariozechner__pi-ai.patch +++ b/patches/@mariozechner__pi-ai.patch @@ -1,42 +1,43 @@ diff --git a/dist/providers/google-shared.js b/dist/providers/google-shared.js +index 7bc0a9f5d6241f191cd607ecb37b3acac8d58267..76166a34784cbc0718d4b9bd1fa6336a6dd394ec 100644 --- a/dist/providers/google-shared.js +++ b/dist/providers/google-shared.js -@@ -52,19 +52,25 @@ +@@ -51,9 +51,19 @@ export function convertMessages(model, context) { + parts.push({ text: sanitizeSurrogates(block.text) }); } else if (block.type === "thinking") { - // Thinking blocks require signatures for Claude via Antigravity. +- // Thinking blocks require signatures for Claude via Antigravity. - // If signature is missing (e.g. from GPT-OSS), convert to regular text with delimiters. - if (block.thinkingSignature) { -+ // Only send thought signatures for Claude models - Gemini doesn't support them -+ // and will mimic tags if we include them as text. -+ if (block.thinkingSignature && model.id.includes("claude")) { ++ // Thinking blocks handling varies by model: ++ // - Claude via Antigravity: requires thinkingSignature ++ // - Gemini: skip entirely (doesn't understand thoughtSignature, and mimics tags) ++ // - Other models: convert to text with delimiters ++ const isGemini = model.id.toLowerCase().includes("gemini"); ++ const isClaude = model.id.toLowerCase().includes("claude"); ++ if (isGemini) { ++ // Skip thinking blocks entirely for Gemini - it doesn't support them ++ // and will mimic tags if we convert to text ++ continue; ++ } ++ else if (block.thinkingSignature && isClaude) { ++ // Claude via Antigravity requires the signature parts.push({ thought: true, text: sanitizeSurrogates(block.thinking), - thoughtSignature: block.thinkingSignature, +@@ -61,6 +71,7 @@ export function convertMessages(model, context) { }); } -- else { -- parts.push({ -- text: `\n${sanitizeSurrogates(block.thinking)}\n`, -- }); -+ else if (!model.id.includes("gemini")) { -+ // For non-Gemini, non-Claude models, include as text with delimiters -+ // Skip entirely for Gemini to avoid it mimicking the pattern -+ if (block.thinking && block.thinking.trim()) { -+ parts.push({ -+ text: `\n${sanitizeSurrogates(block.thinking)}\n`, -+ }); -+ } - } -+ // For Gemini models without Claude signature: skip thinking blocks entirely - } - else if (block.type === "toolCall") { - const part = { -@@ -147,6 +153,77 @@ + else { ++ // Other models: convert to text with delimiters + parts.push({ + text: `\n${sanitizeSurrogates(block.thinking)}\n`, + }); +@@ -146,6 +157,77 @@ export function convertMessages(model, context) { + } return contents; } - /** ++/** + * Sanitize JSON Schema for Google Cloud Code Assist API. + * Removes unsupported keywords like patternProperties, const, anyOf, etc. + * and converts to a format compatible with Google's function declarations. @@ -107,11 +108,10 @@ diff --git a/dist/providers/google-shared.js b/dist/providers/google-shared.js + } + return sanitized; +} -+/** + /** * Convert tools to Gemini function declarations format. */ - export function convertTools(tools) { -@@ -157,7 +234,7 @@ +@@ -157,7 +239,7 @@ export function convertTools(tools) { functionDeclarations: tools.map((tool) => ({ name: tool.name, description: tool.description, @@ -120,3 +120,15 @@ diff --git a/dist/providers/google-shared.js b/dist/providers/google-shared.js })), }, ]; +diff --git a/dist/providers/openai-responses.js b/dist/providers/openai-responses.js +index 20fb0a22aaa28f7ff7c2f44a8b628fa1d9d7d936..31bae0aface1319487ce62d35f1f3b6ed334863e 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 8b9d6b142..9db4309ea 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,11 +9,8 @@ overrides: patchedDependencies: '@mariozechner/pi-ai': - hash: 85d925c76d088e594be0dc961cc06cb72fe8b408e28344c4e5a7989417442476 + hash: 628fb051b6f4886984a846a5ee7aa0a571c3360d35b8d114e4684e5edcd100c5 path: patches/@mariozechner__pi-ai.patch - '@mariozechner/pi-coding-agent@0.32.3': - hash: d0d5ffa1bfda8a0f9d14a5e73a074014346d3edbdb2ffc91444d3be5119f5745 - path: patches/@mariozechner__pi-coding-agent@0.32.3.patch importers: @@ -33,22 +30,16 @@ importers: version: 0.32.3(ws@8.18.3)(zod@4.3.4) '@mariozechner/pi-ai': specifier: ^0.32.3 - version: 0.32.3(patch_hash=85d925c76d088e594be0dc961cc06cb72fe8b408e28344c4e5a7989417442476)(ws@8.18.3)(zod@4.3.4) + version: 0.32.3(patch_hash=628fb051b6f4886984a846a5ee7aa0a571c3360d35b8d114e4684e5edcd100c5)(ws@8.18.3)(zod@4.3.4) '@mariozechner/pi-coding-agent': specifier: ^0.32.3 - version: 0.32.3(patch_hash=d0d5ffa1bfda8a0f9d14a5e73a074014346d3edbdb2ffc91444d3be5119f5745)(ws@8.18.3)(zod@4.3.4) + version: 0.32.3(ws@8.18.3)(zod@4.3.4) '@mariozechner/pi-tui': specifier: ^0.32.3 version: 0.32.3 '@sinclair/typebox': specifier: 0.34.46 version: 0.34.46 - '@slack/bolt': - specifier: ^4.5.0 - version: 4.6.0(@types/express@5.0.6) - '@slack/web-api': - specifier: ^7.11.1 - version: 7.13.0 '@whiskeysockets/baileys': specifier: 7.0.0-rc.9 version: 7.0.0-rc.9(audio-decode@2.2.3)(sharp@0.34.5) @@ -1104,32 +1095,6 @@ packages: '@sinclair/typebox@0.34.46': resolution: {integrity: sha512-kiW7CtS/NkdvTUjkjUJo7d5JsFfbJ14YjdhDk9KoEgK6nFjKNXZPrX0jfLA8ZlET4cFLHxOZ/0vFKOP+bOxIOQ==} - '@slack/bolt@4.6.0': - resolution: {integrity: sha512-xPgfUs2+OXSugz54Ky07pA890+Qydk22SYToi8uGpXeHSt1JWwFJkRyd/9Vlg5I1AdfdpGXExDpwnbuN9Q/2dQ==} - engines: {node: '>=18', npm: '>=8.6.0'} - peerDependencies: - '@types/express': ^5.0.0 - - '@slack/logger@4.0.0': - resolution: {integrity: sha512-Wz7QYfPAlG/DR+DfABddUZeNgoeY7d1J39OCR2jR+v7VBsB8ezulDK5szTnDDPDwLH5IWhLvXIHlCFZV7MSKgA==} - engines: {node: '>= 18', npm: '>= 8.6.0'} - - '@slack/oauth@3.0.4': - resolution: {integrity: sha512-+8H0g7mbrHndEUbYCP7uYyBCbwqmm3E6Mo3nfsDvZZW74zKk1ochfH/fWSvGInYNCVvaBUbg3RZBbTp0j8yJCg==} - engines: {node: '>=18', npm: '>=8.6.0'} - - '@slack/socket-mode@2.0.5': - resolution: {integrity: sha512-VaapvmrAifeFLAFaDPfGhEwwunTKsI6bQhYzxRXw7BSujZUae5sANO76WqlVsLXuhVtCVrBWPiS2snAQR2RHJQ==} - engines: {node: '>= 18', npm: '>= 8.6.0'} - - '@slack/types@2.19.0': - resolution: {integrity: sha512-7+QZ38HGcNh/b/7MpvPG6jnw7mliV6UmrquJLqgdxkzJgQEYUcEztvFWRU49z0x4vthF0ixL5lTK601AXrS8IA==} - engines: {node: '>= 12.13.0', npm: '>= 6.12.0'} - - '@slack/web-api@7.13.0': - resolution: {integrity: sha512-ERcExbWrnkDN8ovoWWe6Wgt/usanj1dWUd18dJLpctUI4mlPS0nKt81Joh8VI+OPbNnY1lIilVt9gdMBD9U2ig==} - engines: {node: '>= 18', npm: '>= 8.6.0'} - '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} @@ -1188,9 +1153,6 @@ packages: '@types/http-errors@2.0.5': resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==} - '@types/jsonwebtoken@9.0.10': - resolution: {integrity: sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==} - '@types/linkify-it@5.0.0': resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} @@ -1206,9 +1168,6 @@ packages: '@types/mime-types@2.1.4': resolution: {integrity: sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==} - '@types/ms@2.1.0': - resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} - '@types/node@10.17.60': resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==} @@ -1224,9 +1183,6 @@ packages: '@types/range-parser@1.2.7': resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} - '@types/retry@0.12.0': - resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} - '@types/send@1.2.1': resolution: {integrity: sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==} @@ -1401,9 +1357,6 @@ packages: async-mutex@0.5.0: resolution: {integrity: sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==} - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - atomic-sleep@1.0.0: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} @@ -1418,9 +1371,6 @@ packages: resolution: {integrity: sha512-En9AY6EG1qYqEy5L/quryzbA4akBpJrnBZNxeKTqGHC2xT9Qc4aZ8b7CcbOMFTTc/MGdoNyp+SN4zInZNKxMYA==} engines: {node: '>=14'} - axios@1.13.2: - resolution: {integrity: sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==} - balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1536,10 +1486,6 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - commander@14.0.2: resolution: {integrity: sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==} engines: {node: '>=20'} @@ -1594,10 +1540,6 @@ packages: supports-color: optional: true - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} @@ -1676,10 +1618,6 @@ packages: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} - es-set-tostringtag@2.1.0: - resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} - engines: {node: '>= 0.4'} - esbuild@0.27.2: resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} engines: {node: '>=18'} @@ -1703,9 +1641,6 @@ packages: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} - eventemitter3@4.0.7: - resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} - eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} @@ -1762,23 +1697,10 @@ packages: resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} engines: {node: '>= 18.0.0'} - follow-redirects@1.15.11: - resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - foreground-child@3.3.1: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - form-data@4.0.5: - resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} - engines: {node: '>= 6'} - formdata-polyfill@4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -1875,10 +1797,6 @@ packages: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} - has-tostringtag@1.0.2: - resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} - engines: {node: '>= 0.4'} - hashery@1.4.0: resolution: {integrity: sha512-Wn2i1In6XFxl8Az55kkgnFRiAlIAushzh26PTjL2AKtQcEfXrcLa7Hn5QOWGZEf3LU057P9TwwZjFyxfS1VuvQ==} engines: {node: '>=20'} @@ -1932,9 +1850,6 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} - is-electron@2.2.2: - resolution: {integrity: sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==} - is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1954,10 +1869,6 @@ packages: is-promise@4.0.0: resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - is-url@1.2.4: resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} @@ -2021,10 +1932,6 @@ packages: jsonc-parser@3.3.1: resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} - jsonwebtoken@9.0.3: - resolution: {integrity: sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==} - engines: {node: '>=12', npm: '>=6'} - jszip@3.10.1: resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==} @@ -2126,27 +2033,6 @@ packages: lit@3.3.2: resolution: {integrity: sha512-NF9zbsP79l4ao2SNrH3NkfmFgN/hBYSQo90saIVI1o5GpjAdCPVstVzO1MrLOakHoEhYkrtRjPK6Ob521aoYWQ==} - lodash.includes@4.3.0: - resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} - - lodash.isboolean@3.0.3: - resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} - - lodash.isinteger@4.0.4: - resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} - - lodash.isnumber@3.0.3: - resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==} - - lodash.isplainobject@4.0.6: - resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} - - lodash.isstring@4.0.1: - resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} - - lodash.once@4.1.1: - resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} - lodash.snakecase@4.1.1: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} @@ -2226,18 +2112,10 @@ packages: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - mime-db@1.54.0: resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} engines: {node: '>= 0.6'} - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - mime-types@3.0.2: resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} engines: {node: '>=18'} @@ -2366,26 +2244,10 @@ packages: oxlint-tsgolint: optional: true - p-finally@1.0.0: - resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} - engines: {node: '>=4'} - - p-queue@6.6.2: - resolution: {integrity: sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==} - engines: {node: '>=8'} - p-queue@9.0.1: resolution: {integrity: sha512-RhBdVhSwJb7Ocn3e8ULk4NMwBEuOxe+1zcgphUy9c2e5aR/xbEsdVXxHJ3lynw6Qiqu7OINEyHlZkiblEpaq7w==} engines: {node: '>=20'} - p-retry@4.6.2: - resolution: {integrity: sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==} - engines: {node: '>=8'} - - p-timeout@3.2.0: - resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} - engines: {node: '>=8'} - p-timeout@7.0.1: resolution: {integrity: sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg==} engines: {node: '>=20'} @@ -2509,9 +2371,6 @@ packages: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - punycode.js@2.3.1: resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} engines: {node: '>=6'} @@ -2585,10 +2444,6 @@ packages: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} - retry@0.13.1: - resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} - engines: {node: '>= 4'} - reusify@1.1.0: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -2836,10 +2691,6 @@ packages: resolution: {integrity: sha512-XuELoRpMR+sq8fuWwX7P0bcj+PRNiicOKDEb3fGNURhxWVyykCi9BNq7c4uVz7h7P0sj8qgBsr5SWS6yBClq3g==} engines: {node: '>=16'} - tsscmp@1.0.6: - resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} - engines: {node: '>=0.6.x'} - tsx@4.21.0: resolution: {integrity: sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==} engines: {node: '>=18.0.0'} @@ -3490,7 +3341,7 @@ snapshots: '@mariozechner/pi-agent-core@0.32.3(ws@8.18.3)(zod@4.3.4)': dependencies: - '@mariozechner/pi-ai': 0.32.3(patch_hash=85d925c76d088e594be0dc961cc06cb72fe8b408e28344c4e5a7989417442476)(ws@8.18.3)(zod@4.3.4) + '@mariozechner/pi-ai': 0.32.3(patch_hash=628fb051b6f4886984a846a5ee7aa0a571c3360d35b8d114e4684e5edcd100c5)(ws@8.18.3)(zod@4.3.4) '@mariozechner/pi-tui': 0.32.3 transitivePeerDependencies: - '@modelcontextprotocol/sdk' @@ -3500,7 +3351,7 @@ snapshots: - ws - zod - '@mariozechner/pi-ai@0.32.3(patch_hash=85d925c76d088e594be0dc961cc06cb72fe8b408e28344c4e5a7989417442476)(ws@8.18.3)(zod@4.3.4)': + '@mariozechner/pi-ai@0.32.3(patch_hash=628fb051b6f4886984a846a5ee7aa0a571c3360d35b8d114e4684e5edcd100c5)(ws@8.18.3)(zod@4.3.4)': dependencies: '@anthropic-ai/sdk': 0.71.2(zod@4.3.4) '@google/genai': 1.34.0 @@ -3520,10 +3371,10 @@ snapshots: - ws - zod - '@mariozechner/pi-coding-agent@0.32.3(patch_hash=d0d5ffa1bfda8a0f9d14a5e73a074014346d3edbdb2ffc91444d3be5119f5745)(ws@8.18.3)(zod@4.3.4)': + '@mariozechner/pi-coding-agent@0.32.3(ws@8.18.3)(zod@4.3.4)': dependencies: '@mariozechner/pi-agent-core': 0.32.3(ws@8.18.3)(zod@4.3.4) - '@mariozechner/pi-ai': 0.32.3(patch_hash=85d925c76d088e594be0dc961cc06cb72fe8b408e28344c4e5a7989417442476)(ws@8.18.3)(zod@4.3.4) + '@mariozechner/pi-ai': 0.32.3(patch_hash=628fb051b6f4886984a846a5ee7aa0a571c3360d35b8d114e4684e5edcd100c5)(ws@8.18.3)(zod@4.3.4) '@mariozechner/pi-tui': 0.32.3 chalk: 5.6.2 cli-highlight: 2.1.11 @@ -3769,71 +3620,6 @@ snapshots: '@sinclair/typebox@0.34.46': {} - '@slack/bolt@4.6.0(@types/express@5.0.6)': - dependencies: - '@slack/logger': 4.0.0 - '@slack/oauth': 3.0.4 - '@slack/socket-mode': 2.0.5 - '@slack/types': 2.19.0 - '@slack/web-api': 7.13.0 - '@types/express': 5.0.6 - axios: 1.13.2 - express: 5.2.1 - path-to-regexp: 8.3.0 - raw-body: 3.0.2 - tsscmp: 1.0.6 - transitivePeerDependencies: - - bufferutil - - debug - - supports-color - - utf-8-validate - - '@slack/logger@4.0.0': - dependencies: - '@types/node': 25.0.3 - - '@slack/oauth@3.0.4': - dependencies: - '@slack/logger': 4.0.0 - '@slack/web-api': 7.13.0 - '@types/jsonwebtoken': 9.0.10 - '@types/node': 25.0.3 - jsonwebtoken: 9.0.3 - transitivePeerDependencies: - - debug - - '@slack/socket-mode@2.0.5': - dependencies: - '@slack/logger': 4.0.0 - '@slack/web-api': 7.13.0 - '@types/node': 25.0.3 - '@types/ws': 8.18.1 - eventemitter3: 5.0.1 - ws: 8.18.3 - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - - '@slack/types@2.19.0': {} - - '@slack/web-api@7.13.0': - dependencies: - '@slack/logger': 4.0.0 - '@slack/types': 2.19.0 - '@types/node': 25.0.3 - '@types/retry': 0.12.0 - axios: 1.13.2 - eventemitter3: 5.0.1 - form-data: 4.0.5 - is-electron: 2.2.2 - is-stream: 2.0.1 - p-queue: 6.6.2 - p-retry: 4.6.2 - retry: 0.13.1 - transitivePeerDependencies: - - debug - '@standard-schema/spec@1.1.0': {} '@testing-library/dom@10.4.1': @@ -3911,11 +3697,6 @@ snapshots: '@types/http-errors@2.0.5': {} - '@types/jsonwebtoken@9.0.10': - dependencies: - '@types/ms': 2.1.0 - '@types/node': 25.0.3 - '@types/linkify-it@5.0.0': {} '@types/long@4.0.2': {} @@ -3929,8 +3710,6 @@ snapshots: '@types/mime-types@2.1.4': {} - '@types/ms@2.1.0': {} - '@types/node@10.17.60': {} '@types/node@25.0.3': @@ -3943,8 +3722,6 @@ snapshots: '@types/range-parser@1.2.7': {} - '@types/retry@0.12.0': {} - '@types/send@1.2.1': dependencies: '@types/node': 25.0.3 @@ -4178,8 +3955,6 @@ snapshots: dependencies: tslib: 2.8.1 - asynckit@0.4.0: {} - atomic-sleep@1.0.0: {} audio-buffer@5.0.0: @@ -4200,14 +3975,6 @@ snapshots: audio-type@2.2.1: optional: true - axios@1.13.2: - dependencies: - follow-redirects: 1.15.11 - form-data: 4.0.5 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - balanced-match@1.0.2: {} balanced-match@3.0.1: {} @@ -4340,10 +4107,6 @@ snapshots: color-name@1.1.4: {} - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - commander@14.0.2: {} commander@8.3.0: {} @@ -4380,8 +4143,6 @@ snapshots: dependencies: ms: 2.1.3 - delayed-stream@1.0.0: {} - depd@2.0.0: {} dequal@2.0.3: @@ -4455,13 +4216,6 @@ snapshots: dependencies: es-errors: 1.3.0 - es-set-tostringtag@2.1.0: - dependencies: - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - has-tostringtag: 1.0.2 - hasown: 2.0.2 - esbuild@0.27.2: optionalDependencies: '@esbuild/aix-ppc64': 0.27.2 @@ -4503,8 +4257,6 @@ snapshots: event-target-shim@5.0.1: {} - eventemitter3@4.0.7: {} - eventemitter3@5.0.1: {} events@3.3.0: {} @@ -4595,21 +4347,11 @@ snapshots: transitivePeerDependencies: - supports-color - follow-redirects@1.15.11: {} - foreground-child@3.3.1: dependencies: cross-spawn: 7.0.6 signal-exit: 4.1.0 - form-data@4.0.5: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - es-set-tostringtag: 2.1.0 - hasown: 2.0.2 - mime-types: 2.1.35 - formdata-polyfill@4.0.10: dependencies: fetch-blob: 3.2.0 @@ -4730,10 +4472,6 @@ snapshots: has-symbols@1.1.0: {} - has-tostringtag@1.0.2: - dependencies: - has-symbols: 1.1.0 - hashery@1.4.0: dependencies: hookified: 1.14.0 @@ -4783,8 +4521,6 @@ snapshots: dependencies: binary-extensions: 2.3.0 - is-electron@2.2.2: {} - is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -4797,8 +4533,6 @@ snapshots: is-promise@4.0.0: {} - is-stream@2.0.1: {} - is-url@1.2.4: {} isarray@1.0.0: {} @@ -4860,19 +4594,6 @@ snapshots: jsonc-parser@3.3.1: {} - jsonwebtoken@9.0.3: - dependencies: - jws: 4.0.1 - lodash.includes: 4.3.0 - lodash.isboolean: 3.0.3 - lodash.isinteger: 4.0.4 - lodash.isnumber: 3.0.3 - lodash.isplainobject: 4.0.6 - lodash.isstring: 4.0.1 - lodash.once: 4.1.1 - ms: 2.1.3 - semver: 7.7.3 - jszip@3.10.1: dependencies: lie: 3.3.0 @@ -4973,20 +4694,6 @@ snapshots: lit-element: 4.2.2 lit-html: 3.3.2 - lodash.includes@4.3.0: {} - - lodash.isboolean@3.0.3: {} - - lodash.isinteger@4.0.4: {} - - lodash.isnumber@3.0.3: {} - - lodash.isplainobject@4.0.6: {} - - lodash.isstring@4.0.1: {} - - lodash.once@4.1.1: {} - lodash.snakecase@4.1.1: {} lodash@4.17.21: {} @@ -5050,14 +4757,8 @@ snapshots: braces: 3.0.3 picomatch: 2.3.1 - mime-db@1.52.0: {} - mime-db@1.54.0: {} - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - mime-types@3.0.2: dependencies: mime-db: 1.54.0 @@ -5183,27 +4884,11 @@ snapshots: '@oxlint/win32-x64': 1.36.0 oxlint-tsgolint: 0.10.1 - p-finally@1.0.0: {} - - p-queue@6.6.2: - dependencies: - eventemitter3: 4.0.7 - p-timeout: 3.2.0 - p-queue@9.0.1: dependencies: eventemitter3: 5.0.1 p-timeout: 7.0.1 - p-retry@4.6.2: - dependencies: - '@types/retry': 0.12.0 - retry: 0.13.1 - - p-timeout@3.2.0: - dependencies: - p-finally: 1.0.0 - p-timeout@7.0.1: {} package-json-from-dist@1.0.1: {} @@ -5343,8 +5028,6 @@ snapshots: forwarded: 0.2.0 ipaddr.js: 1.9.1 - proxy-from-env@1.1.0: {} - punycode.js@2.3.1: {} qified@0.5.3: @@ -5431,8 +5114,6 @@ snapshots: retry@0.12.0: {} - retry@0.13.1: {} - reusify@1.1.0: {} rimraf@5.0.10: @@ -5743,8 +5424,6 @@ snapshots: tslog@4.10.2: {} - tsscmp@1.0.6: {} - tsx@4.21.0: dependencies: esbuild: 0.27.2 diff --git a/src/agents/pi-embedded-subscribe.ts b/src/agents/pi-embedded-subscribe.ts index 70afba5e0..d22c51dc4 100644 --- a/src/agents/pi-embedded-subscribe.ts +++ b/src/agents/pi-embedded-subscribe.ts @@ -248,7 +248,9 @@ export function subscribeEmbeddedPiSession(params: { }; const emitBlockChunk = (text: string) => { - const chunk = text.trimEnd(); + // Strip any tags that may have leaked into the output (e.g., from Gemini mimicking history) + const strippedText = stripThinkingSegments(stripUnpairedThinkingTags(text)); + const chunk = strippedText.trimEnd(); if (!chunk) return; if (chunk === lastBlockReplyText) return; lastBlockReplyText = chunk;