{"record":{"id":"338bdce71b2fe9d6","repo":"can1357/oh-my-pi","slug":"no-response-returned-by-agent-creation-architect","errorCode":null,"errorMessage":"No response returned by agent creation architect.","messagePattern":"No response returned by agent creation architect\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/modes/components/agents-hub.ts","lineNumber":797,"sourceCode":"\t\t\tskills: [],\n\t\t\tcontextFiles: [],\n\t\t\tpromptTemplates: [],\n\t\t\tslashCommands: [],\n\t\t});\n\t\tconst unsubscribe = session.subscribe(event => {\n\t\t\tif (event.type === \"message_update\" && \"assistantMessageEvent\" in event) {\n\t\t\t\tconst ame = event.assistantMessageEvent;\n\t\t\t\tif (ame.type === \"text_delta\") {\n\t\t\t\t\tthis.#createStreamingText += ame.delta;\n\t\t\t\t\tthis.#tui.requestRender();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tawait session.prompt(userPrompt, { expandPromptTemplates: false });\n\t\t\tconst raw = extractAssistantText(session.state.messages);\n\t\t\tif (!raw) {\n\t\t\t\tthrow new Error(\"No response returned by agent creation architect.\");\n\t\t\t}\n\t\t\treturn parseGeneratedAgentSpec(raw);\n\t\t} finally {\n\t\t\tunsubscribe();\n\t\t\tawait session.dispose();\n\t\t}\n\t}\n\n\tasync #saveGeneratedAgent(): Promise<void> {\n\t\tconst spec = this.#createSpec;\n\t\tif (!spec) return;\n\t\tconst dirs = getConfigDirs(\"agents\", {\n\t\t\tuser: this.#createScope === \"user\",\n\t\t\tproject: this.#createScope === \"project\",\n\t\t\tcwd: this.#cwd,\n\t\t});\n\t\tconst targetDir = dirs[0]?.path;\n\t\tif (!targetDir) {","sourceCodeStart":779,"sourceCodeEnd":815,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/modes/components/agents-hub.ts#L779-L815","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nselectedModel: tool-only endpoint model -> empty assistant text\n// after\nselectedModel: standard chat model -> assistant text parsed into spec","handlingStrategy":"retry","validationCode":"const raw = extractAssistantText(session.state.messages);\nif (!raw) throw new Error(\"Empty architect response — retry needed\");","typeGuard":"function hasAssistantText(messages: unknown): boolean {\n  return extractAssistantText(messages as never).trim().length > 0;\n}","tryCatchPattern":"try {\n  return await hub.runAgentCreationArchitect(desc);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"No response returned\")) {\n    return await hub.runAgentCreationArchitect(desc); // one retry\n  }\n  throw err;\n}","preventionTips":["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"],"tags":["llm-output","empty-response","agents"],"backgroundTag":"empty-model-response","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}