{"record":{"id":"470aa3260e58894b","repo":"JuliusBrussee/caveman","slug":"caveman-build-generated-no-candidate-plans","errorCode":null,"errorMessage":"caveman build: generated no candidate plans","messagePattern":"caveman build: generated no candidate plans","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/agent/src/build.ts","lineNumber":260,"sourceCode":"    true,\n    new Map(),\n    ENGINE_TRANSFORM_CAPABILITIES,\n    new Set(input.evals.some((fixture) =>\n      fixture.quality.some((grader) => grader.type === \"tool_called\"))\n      ? [\"history\", \"tool_result\"] as ContextKind[]\n      : []),\n    // The public compile() enforces the same model/safety policy and catalog\n    // pricing the CLI does — an unpriced or policy-denied model is rejected\n    // here, not only in the CLI.\n    {\n      ...(input.config.allowedModels === undefined ? {} : { allowedModels: input.config.allowedModels }),\n      ...(input.config.deniedModels === undefined ? {} : { deniedModels: input.config.deniedModels }),\n      ...(input.config.forbiddenSafetyClasses === undefined\n        ? {}\n        : { forbiddenSafetyClasses: input.config.forbiddenSafetyClasses }),\n    },\n  );\n  if (candidates.length === 0) throw new Error(\"caveman build: generated no candidate plans\");\n  if (!input.entitled && candidates.some((candidate) => candidate.requires_entitlement && !candidate.static_rejection)) {\n    return emptyResult(\"needs_login\", \"entitled engine required for eligible candidates\");\n  }\n\n  const runnable = candidates.filter((candidate) => !candidate.static_rejection);\n  const staticRejections = candidates.length - runnable.length;\n  const plannedRuns = runnable.length * approved.length * seeds.length;\n  const estimatedCeiling = roundUsd(\n    runnable.reduce((sum, candidate) => sum + candidate.estimated_cost_usd_per_run * approved.length * seeds.length, 0),\n  );\n  if (estimatedCeiling > input.config.maxSearchCostUsd) {\n    return {\n      status: \"search_budget_exceeded\",\n      estimated_ceiling_usd: estimatedCeiling,\n      planned_runs: plannedRuns,\n      completed_runs: 0,\n      static_rejections: staticRejections,\n      actual_cost_usd: 0,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/agent/src/build.ts#L242-L278","documentation":"After generating candidate plans for the compile run, compile requires at least one candidate; an empty list means planning produced nothing to evaluate, so the library throws rather than returning a meaningless result. Generation is driven by the agent graph, context IR, baseline plan, and model candidates under the config's model allow/deny and safety-class constraints.","triggerScenarios":"generateCandidatePlans returns an empty array — e.g. the config's allowedModels/deniedModels/forbiddenSafetyClasses filter out every candidate model, the baseline plan is invalid, or the context IR yields no viable plans.","commonSituations":"An overly restrictive allowedModels list that excludes the baseline model; forbiddenSafetyClasses matching all candidates; a baseline plan referencing a denied model; an empty or degenerate context IR.","solutions":["Widen allowedModels (or clear deniedModels) so at least the baselinePlan.model is permitted","Remove/relax forbiddenSafetyClasses entries that reject every candidate","Verify input.baselinePlan and input.modelCandidates are non-empty and reference allowed models","Log generateCandidatePlans output upstream to see why planning yields zero results"],"exampleFix":"// before\nconfig = { allowedModels: [\"model-x\"], ... } // baseline model-y not allowed\n// after\nconfig = { allowedModels: [\"model-x\", baselinePlan.model], ... }","handlingStrategy":"validation","validationCode":"const allowed = input.config?.allowedModels;\nif (allowed && !allowed.includes(input.baselinePlan.model)) {\n  throw new Error(\"baseline model excluded by allowedModels; candidates will be empty\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  const result = compile(input);\n} catch (e) {\n  if (e instanceof Error && e.message === \"caveman build: generated no candidate plans\") {\n    // relax allowedModels/forbiddenSafetyClasses and retry\n  } else throw e;\n}","preventionTips":["Always include baselinePlan.model in allowedModels","Review deniedModels/forbiddenSafetyClasses for over-broad filters","Smoke-test candidate generation on a trivial agent before full compiles"],"tags":["planning","candidates","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}