From 50c33dfcdff8481da49f4d779519875245beb809 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 9 Dec 2025 21:52:49 +0000 Subject: [PATCH] chore: bump pi deps for tau rpc --- package.json | 4 ++-- src/process/tau-rpc.ts | 27 +++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9e6f306e8..79eceec80 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ "packageManager": "pnpm@10.23.0", "dependencies": { "@grammyjs/transformer-throttler": "^1.2.1", - "@mariozechner/pi-ai": "^0.16.0", - "@mariozechner/pi-coding-agent": "^0.16.0", + "@mariozechner/pi-ai": "^0.17.0", + "@mariozechner/pi-coding-agent": "^0.17.0", "@sinclair/typebox": "^0.34.41", "@whiskeysockets/baileys": "7.0.0-rc.9", "ajv": "^8.17.1", diff --git a/src/process/tau-rpc.ts b/src/process/tau-rpc.ts index 8578d1968..018846127 100644 --- a/src/process/tau-rpc.ts +++ b/src/process/tau-rpc.ts @@ -78,7 +78,29 @@ class TauRpcClient { // Parse the line once to track agent lifecycle signals. try { - const evt = JSON.parse(line) as { type?: string; message?: unknown }; + const evt = JSON.parse(line) as { + type?: string; + command?: string; + success?: boolean; + error?: string; + message?: unknown; + }; + + if (evt.type === "response" && evt.command === "prompt") { + if (evt.success === false) { + const pending = this.pending; + this.pending = undefined; + this.buffer = []; + if (pending) { + clearTimeout(pending.timer); + pending.reject( + new Error(evt.error ?? "tau rpc prompt failed (response=false)"), + ); + } + this.child?.kill("SIGKILL"); + return; + } + } if (evt?.type === "agent_end") { // Tau signals the end of the prompt/response cycle; resolve with all buffered output. @@ -124,7 +146,8 @@ class TauRpcClient { const ok = child.stdin.write( `${JSON.stringify({ type: "prompt", - message: { role: "user", content: [{ type: "text", text: prompt }] }, + // RPC v0.17+ accepts raw string prompts and normalizes internally. + message: prompt, })}\n`, (err) => (err ? reject(err) : resolve()), );