From c4ab46a087aedfa2154d024524e5f4d08ecb7fc4 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 8 Dec 2025 16:21:25 +0000 Subject: [PATCH] fix: send plain string message in tau-rpc instead of structured object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pi-agent-core's Agent.prompt() expects a plain string, not a structured message object. The RPC handler passes input.message directly to agent.prompt(), so sending { role: "user", content: [...] } causes "(command produced no output)" errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/process/tau-rpc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/process/tau-rpc.ts b/src/process/tau-rpc.ts index 0c14cdbb3..09c4a1f32 100644 --- a/src/process/tau-rpc.ts +++ b/src/process/tau-rpc.ts @@ -121,10 +121,12 @@ class TauRpcClient { const child = this.child; if (!child) throw new Error("tau rpc child not initialized"); await new Promise((resolve, reject) => { + // Pi-agent-core's Agent.prompt() expects a plain string, not a structured message. + // The RPC handler in pi-coding-agent passes input.message directly to agent.prompt(). const ok = child.stdin.write( `${JSON.stringify({ type: "prompt", - message: { role: "user", content: [{ type: "text", text: prompt }] }, + message: prompt, })}\n`, (err) => (err ? reject(err) : resolve()), );