fix: send plain string message in tau-rpc instead of structured object
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 <noreply@anthropic.com>
This commit is contained in:
parent
7a7c59e91a
commit
c4ab46a087
@ -121,10 +121,12 @@ class TauRpcClient {
|
|||||||
const child = this.child;
|
const child = this.child;
|
||||||
if (!child) throw new Error("tau rpc child not initialized");
|
if (!child) throw new Error("tau rpc child not initialized");
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((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(
|
const ok = child.stdin.write(
|
||||||
`${JSON.stringify({
|
`${JSON.stringify({
|
||||||
type: "prompt",
|
type: "prompt",
|
||||||
message: { role: "user", content: [{ type: "text", text: prompt }] },
|
message: prompt,
|
||||||
})}\n`,
|
})}\n`,
|
||||||
(err) => (err ? reject(err) : resolve()),
|
(err) => (err ? reject(err) : resolve()),
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user