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>
This commit is contained in:
Mikael Hugo 2026-05-09 22:04:34 +02:00
parent d895cf2a16
commit c391abe08d
3 changed files with 4 additions and 4 deletions

View file

@ -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.",
);
}

View file

@ -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) => {

View file

@ -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") {