{"record":{"id":"700eb969179862eb","repo":"coleam00/Archon","slug":"node-node-id-output-format-declared-but-the-700eb9","errorCode":null,"errorMessage":"Node '${node.id}': output_format declared but the provider returned no schema-valid structured output. The model likely replied with prose, refused, or emitted unparseable JSON.","messagePattern":"Node '(.+?)': output_format declared but the provider returned no schema-valid structured output\\. The model likely replied with prose, refused, or emitted unparseable JSON\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/dag-executor.ts","lineNumber":3073,"sourceCode":"      }\n\n      // No structured output at all (prose / refusal / parse miss / timeout).\n      getLog().warn(\n        { nodeId: node.id, workflowRunId: workflowRun.id },\n        'dag.structured_output_missing'\n      );\n      if (canReask) {\n        await scheduleReask(['no JSON object was found in the response']);\n        continue;\n      }\n      // Surface the real cause: a timeout/abort produces no structured output too,\n      // and reporting it as \"the model replied with prose\" would mislead.\n      if (nodeIdleTimedOut) {\n        throw new Error(\n          `Node '${node.id}': timed out (no output for ${String(effectiveIdleTimeout / 60000)} min) before producing the required structured output.`\n        );\n      }\n      throw new Error(\n        `Node '${node.id}': output_format declared but the provider returned no schema-valid structured output. ` +\n          'The model likely replied with prose, refused, or emitted unparseable JSON.'\n      );\n    }\n\n    // Only post \"completed via idle timeout\" when output exists — zero-output timeout falls through to the empty-output guard below.\n    if (nodeIdleTimedOut && (nodeOutputText.trim() !== '' || structuredOutput !== undefined)) {\n      getLog().warn(\n        { nodeId: node.id, timeoutMs: effectiveIdleTimeout },\n        'dag_node_completed_via_idle_timeout'\n      );\n      await safeSendMessage(\n        platform,\n        conversationId,\n        `⚠️ Node \\`${node.id}\\` completed via idle timeout (no output for ${String(effectiveIdleTimeout / 60000)} min). The AI likely finished but the subprocess didn't exit cleanly.`,\n        nodeContext\n      );\n    }","sourceCodeStart":3055,"sourceCodeEnd":3091,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/dag-executor.ts#L3055-L3091","documentation":"A node declared output_format but the provider returned no schema-valid structured output and the turn did NOT idle-time out — the model finished without producing valid structured data (prose answer, refusal, or JSON that failed to parse). The executor throws this explanatory error instead of treating the turn as an empty-success.","triggerScenarios":"Model replied in prose, refused the task, or emitted JSON that could not be parsed into an object; all reask attempts (asking for valid JSON) were exhausted or not possible.","commonSituations":"Prompt does not request JSON strongly enough; model refuses due to safety/policy; model wraps JSON in markdown fences or explanation text the parser misses; schema so complex the model never satisfies it and gives up.","solutions":["Strengthen the prompt: explicitly demand a single raw JSON object matching output_format, with an example.","Check whether the model refused and rephrase the task or switch models.","Enable/raise reask attempts so the model gets another chance after a parse miss.","Simplify the output_format schema, or split it across nodes."],"exampleFix":"// before\nprompt: \"Analyze this code and tell me what you find.\"\n// after\nprompt: \"Analyze this code. Respond with ONLY a JSON object: {\\\"findings\\\": [...]}\"\n+ output_format:\n  type: object\n  required: [findings]","handlingStrategy":"try-catch","validationCode":"// smoke-test the prompt/schema pair before production\nconst probe = await askModel(promptRequiringJson);\nif (!extractsJsonObject(probe)) console.warn('Prompt does not reliably yield JSON');","typeGuard":"function extractsJsonObject(text: string): text is string {\n  try { return typeof JSON.parse(stripFences(text)) === 'object'; } catch { return false; }\n}","tryCatchPattern":"try {\n  await runNode(node);\n} catch (e) {\n  if (String(e).includes('no schema-valid structured output')) console.error('Model replied with prose/refusal — strengthen JSON instructions or switch model');\n  else throw e;\n}","preventionTips":["End prompts with an explicit 'respond with ONLY a raw JSON object' instruction.","Prefer models with native structured-output/JSON modes.","Enable reask attempts to recover from first-attempt parse misses.","Simplify schemas the model repeatedly fails to satisfy."],"tags":["structured-output","parsing","model-output"],"backgroundTag":"no-valid-structured-output","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}