From c391abe08dad5ba42ac834217cabe6b435b203f2 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Sat, 9 May 2026 22:04:34 +0200 Subject: [PATCH] fix: remove internal API names from user-facing busy-agent error messages Replace 'Use steer() or followUp()' with plain language guidance. Users see this when sending a message while the agent is still working. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/pi-agent-core/src/agent.ts | 2 +- .../src/core/agent-session-custom-message-queue.test.ts | 4 ++-- packages/pi-coding-agent/src/core/agent-session.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/pi-agent-core/src/agent.ts b/packages/pi-agent-core/src/agent.ts index c6b998b6a..519311c54 100644 --- a/packages/pi-agent-core/src/agent.ts +++ b/packages/pi-agent-core/src/agent.ts @@ -438,7 +438,7 @@ export class Agent { ) { if (this._state.isStreaming) { throw new Error( - "Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.", + "Agent is already processing a prompt. Please wait for it to finish before sending another message.", ); } diff --git a/packages/pi-coding-agent/src/core/agent-session-custom-message-queue.test.ts b/packages/pi-coding-agent/src/core/agent-session-custom-message-queue.test.ts index 77a7e2ccc..cac943f51 100644 --- a/packages/pi-coding-agent/src/core/agent-session-custom-message-queue.test.ts +++ b/packages/pi-coding-agent/src/core/agent-session-custom-message-queue.test.ts @@ -59,7 +59,7 @@ describe("AgentSession custom message queueing", () => { const steered: AgentMessage[] = []; agent.prompt = async () => { throw new Error( - "Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.", + "Agent is already processing a prompt. Please wait for it to finish before sending another message.", ); }; agent.steer = (message) => { @@ -89,7 +89,7 @@ describe("AgentSession custom message queueing", () => { const followUps: AgentMessage[] = []; agent.prompt = async () => { throw new Error( - "Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.", + "Agent is already processing a prompt. Please wait for it to finish before sending another message.", ); }; agent.followUp = (message) => { diff --git a/packages/pi-coding-agent/src/core/agent-session.ts b/packages/pi-coding-agent/src/core/agent-session.ts index 63300ca9c..6e0910971 100644 --- a/packages/pi-coding-agent/src/core/agent-session.ts +++ b/packages/pi-coding-agent/src/core/agent-session.ts @@ -1218,7 +1218,7 @@ export class AgentSession { if (this.isStreaming) { if (!options?.streamingBehavior) { throw new Error( - "Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.", + "Agent is already processing. Please wait for it to finish before sending another message.", ); } if (options.streamingBehavior === "followUp") {