earendil-works/pi · error · Error

Agent is already processing. Specify streamingBehavior…

Error message

Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.

What it means

AgentSession.prompt detected isStreaming without a streamingBehavior option; by default a prompt during active streaming is an error unless the caller opts into 'steer' or 'followUp' queueing.

Solutions

  1. Pass streamingBehavior: 'steer' to redirect the current response or 'followUp' to queue the message
  2. Wait for isStreaming to become false before submitting
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/coding-agent/src/core/agent-session.ts:1180 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/17bd4f4569e4cc2d. Report an issue: GitHub.

Appendix: source

Thrown at packages/coding-agent/src/core/agent-session.ts:1180

					return;
				}
				if (inputResult.action === "transform") {
					currentText = inputResult.text;
					currentImages = inputResult.images ?? currentImages;
				}
			}

			// Expand skill commands (/skill:name args) and prompt templates (/template args)
			let expandedText = currentText;
			if (expandPromptTemplates) {
				expandedText = this._expandSkillCommand(expandedText);
				expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
			}

			// If streaming, queue via steer() or followUp() based on option
			if (this.isStreaming) {
				if (!options?.streamingBehavior) {
					throw new Error(
						"Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.",
					);
				}
				if (options.streamingBehavior === "followUp") {
					await this._queueFollowUp(expandedText, currentImages);
				} else {
					await this._queueSteer(expandedText, currentImages);
				}
				preflightResult?.(true);
				return;
			}

			// Flush any pending bash messages before the new prompt
			this._flushPendingBashMessages();

			// Validate model
			if (!this.model) {
				throw new Error(formatNoModelSelectedMessage());

View on GitHub (pinned to 4af9d21d3b)