{"record":{"id":"a5e1e0d30a1f400b","repo":"earendil-works/pi","slug":"agent-run-produced-no-assistant-text","errorCode":null,"errorMessage":"Agent run produced no assistant text.","messagePattern":"Agent run produced no assistant text\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/evals/src/pi-harness.ts","lineNumber":105,"sourceCode":"\treturn events;\n}\n\nasync function promptAgent(session: AgentSession, input: string, signal: AbortSignal | undefined): Promise<string> {\n\tsignal?.throwIfAborted();\n\tconst previousMessageCount = session.messages.length;\n\tawait session.prompt(input);\n\tconst assistant = session.messages\n\t\t.slice(previousMessageCount)\n\t\t.reverse()\n\t\t.find((message) => message.role === \"assistant\");\n\tif (!assistant) throw new Error(\"Agent run completed without an assistant message.\");\n\tif (assistant.stopReason !== \"stop\") {\n\t\tthrow new Error(\n\t\t\tassistant.errorMessage ?? `Agent run ended with unexpected stop reason: ${assistant.stopReason}.`,\n\t\t);\n\t}\n\tconst output = session.getLastAssistantText();\n\tif (!output) throw new Error(\"Agent run produced no assistant text.\");\n\treturn output;\n}\n\nasync function runPiCodingAgent<TOutput extends JsonValue>(\n\tinput: PiCodingAgentInput,\n\tsignal: AbortSignal | undefined,\n\tsetArtifact: HarnessContext[\"setArtifact\"],\n\toptions: PiCodingAgentHarnessOptions | PiCodingAgentHarnessWithOutput<TOutput>,\n): Promise<SimpleHarnessResult<string | TOutput>> {\n\tconst startedAt = performance.now();\n\tsignal?.throwIfAborted();\n\tconst selection = resolveModelSelection(options.model);\n\tconst modelRuntime = await ModelRuntime.create();\n\tconst model = modelRuntime.getModel(selection.provider, selection.id);\n\tif (!model) throw new Error(`Eval model not found: ${selection.provider}/${selection.id}`);\n\n\tconst root = await mkdtemp(join(tmpdir(), \"pi-eval-\"));\n\tconst cwd = join(root, \"workspace\");","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/evals/src/pi-harness.ts#L87-L123","documentation":"Error \"Agent run produced no assistant text.\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/evals/src/pi-harness.ts:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}