can1357/oh-my-pi · error
No response returned by agent creation architect.
Error message
No response returned by agent creation architect.
What it means
The architect sub-session's prompt() completed but extractAssistantText found no assistant text in the session message state, so there is nothing to parse into an agent spec. This guards against empty/degenerate model responses being treated as a valid spec.
Source
Thrown at packages/coding-agent/src/modes/components/agents-hub.ts:797
skills: [],
contextFiles: [],
promptTemplates: [],
slashCommands: [],
});
const unsubscribe = session.subscribe(event => {
if (event.type === "message_update" && "assistantMessageEvent" in event) {
const ame = event.assistantMessageEvent;
if (ame.type === "text_delta") {
this.#createStreamingText += ame.delta;
this.#tui.requestRender();
}
}
});
try {
await session.prompt(userPrompt, { expandPromptTemplates: false });
const raw = extractAssistantText(session.state.messages);
if (!raw) {
throw new Error("No response returned by agent creation architect.");
}
return parseGeneratedAgentSpec(raw);
} finally {
unsubscribe();
await session.dispose();
}
}
async #saveGeneratedAgent(): Promise<void> {
const spec = this.#createSpec;
if (!spec) return;
const dirs = getConfigDirs("agents", {
user: this.#createScope === "user",
project: this.#createScope === "project",
cwd: this.#cwd,
});
const targetDir = dirs[0]?.path;
if (!targetDir) {View on GitHub (pinned to 9690622007)
Solutions
- Retry the agent creation — transient empty responses usually succeed on a second run
- Check the selected model actually produces text output (not tool-only) and is configured correctly
- Inspect logs/provider response for content-filter or abort causes
- Switch to a different available model for the architect
Example fix
// before selectedModel: tool-only endpoint model -> empty assistant text // after selectedModel: standard chat model -> assistant text parsed into spec
Defensive patterns
Strategy: retry
Validate before calling
const raw = extractAssistantText(session.state.messages);
if (!raw) throw new Error("Empty architect response — retry needed"); Type guard
function hasAssistantText(messages: unknown): boolean {
return extractAssistantText(messages as never).trim().length > 0;
} Try / catch
try {
return await hub.runAgentCreationArchitect(desc);
} catch (err) {
if (err instanceof Error && err.message.includes("No response returned")) {
return await hub.runAgentCreationArchitect(desc); // one retry
}
throw err;
} Prevention
- Retry transient empty completions automatically with backoff
- Select a chat-capable (non-tool-only) model for the architect
- Monitor provider status for content-filter/abort incidents
- Log raw session messages to diagnose empty responses
When it happens
Trigger: session.prompt(userPrompt) resolves but the session state contains no assistant message text — e.g. the model returned only tool calls, the response was empty, or messages were filtered out before extraction.
Common situations: Model hits an output-content filter; provider returns an empty completion; the session aborted mid-turn leaving no assistant text; a non-chat model misconfigured for the sub-session.
Related errors
- completion() returned no structured response.
- completion() returned no text output.
- Model output is not a JSON object
- Model output is missing required fields (identifier, whenToU
- Generated identifier is invalid (must be lowercase kebab-cas
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/338bdce71b2fe9d6.
Report an issue: GitHub.