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:
parent
d895cf2a16
commit
c391abe08d
3 changed files with 4 additions and 4 deletions
|
|
@ -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.",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue