{"record":{"id":"ce2d69b297b908cc","repo":"can1357/oh-my-pi","slug":"checker-discovery-failed-result-result-error","errorCode":null,"errorMessage":"Checker discovery failed: ${result.result.error}","messagePattern":"Checker discovery failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cleanse/agent.ts","lineNumber":143,"sourceCode":"\n\treturn {\n\t\tmodel: modelDisplay,\n\t\tsessionFile,\n\t\tasync discoverCheckers(request: string, signal?: AbortSignal): Promise<CustomCleanseCheckerSpec[]> {\n\t\t\tsessionManager.appendCustomEntry(\"cleanse_discovery\", { request });\n\t\t\tconst result = await runStructuredSubagent({\n\t\t\t\tsession: toolSession,\n\t\t\t\tinvocationKind: \"task\",\n\t\t\t\tassignment: prompt.render(discoveryPrompt, { request }),\n\t\t\t\tagent: \"task\",\n\t\t\t\tmodel: modelSelector,\n\t\t\t\toutputSchema: DISCOVERY_SCHEMA,\n\t\t\t\tidentity: { label: \"CleanseDiscovery\" },\n\t\t\t\tenableLsp: true,\n\t\t\t\tenableIrc: false,\n\t\t\t\tsignal,\n\t\t\t});\n\t\t\tif (result.result.error) throw new Error(`Checker discovery failed: ${result.result.error}`);\n\t\t\treturn parseDiscoverySpecs(result.result.structuredOutput?.data);\n\t\t},\n\t\tasync dispatchWorker(\n\t\t\tassignment: CleanseAssignment,\n\t\t\tcontext: {\n\t\t\t\tworker: number;\n\t\t\t\tpeers: readonly CleanseAssignment[];\n\t\t\t\tcheckers: readonly CleanseCheckerDescriptor[];\n\t\t\t},\n\t\t\tsignal?: AbortSignal,\n\t\t): Promise<CleanseAgentOutcome> {\n\t\t\tsessionManager.appendCustomEntry(\"cleanse_dispatch\", {\n\t\t\t\tworker: context.worker,\n\t\t\t\tweight: assignment.weight,\n\t\t\t\tfiles: assignment.groups.map(group => group.file ?? \"<project>\"),\n\t\t\t});\n\t\t\tconst name = `CleanseA${context.worker}`;\n\t\t\toptions.hooks?.onStart?.(name, assignment);","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cleanse/agent.ts#L125-L161","documentation":"The cleanse checker-discovery step runs an LLM prompt with a DISCOVERY_SCHEMA and, if the agent result carries result.error (the sub-agent failed — API error, aborted, invalid response), wraps it in 'Checker discovery failed: ...'. It means discovery could not produce checker specs, not that checkers themselves are broken.","triggerScenarios":"The discovery agent run returns { error } — provider API failure, rate limit, auth failure, signal abort (timeout/cancel), or the model failed to produce a valid structured output.","commonSituations":"Expired/missing API credentials for the cleanse model; rate limits during parallel discovery; network outage; discovery model returning malformed structured output that the runtime reports as an error.","solutions":["Read the embedded result.error text to identify the root cause (auth vs rate limit vs abort)","Re-run cleanse once transient errors/rate limits clear; check provider status if persistent","Verify the configured cleanse model's provider auth is valid and the model is available","Increase the discovery timeout / avoid cancelling so the signal doesn't abort mid-run"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight: verify provider auth before discovery\nconst auth = await discoverAuthStorage();\nif (!auth.get(model.provider)) throw new Error(`provider ${model.provider} not authenticated; cleanse discovery would fail`);","typeGuard":null,"tryCatchPattern":"try {\n  const specs = await discoverCheckers(signal);\n  return specs;\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Checker discovery failed')) {\n    if (!signal.aborted) {\n      await Bun.sleep(2000);\n      return discoverCheckers(signal); // one retry for transient API errors\n    }\n  }\n  throw err;\n}","preventionTips":["Validate provider auth/model availability before starting cleanse","Respect rate limits; stagger parallel discovery runs","Use a reliable model for discovery, not an experimental one","Handle SIGINT/timeouts so the signal abort is distinguished from real failures"],"tags":["llm","discovery","api-error"],"backgroundTag":"agent-run-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}