diff --git a/src/core/cycle/extract-atoms.ts b/src/core/cycle/extract-atoms.ts index 7d9ea0ed4..0b12b4d79 100644 --- a/src/core/cycle/extract-atoms.ts +++ b/src/core/cycle/extract-atoms.ts @@ -558,7 +558,7 @@ export async function runPhaseExtractAtoms( content: `Source: ${originLabel}\n\n---\n\n${item.content.slice(0, 50_000)}`, }, ], - maxTokens: 2000, + maxTokens: 4096, }); // Post-await yield: closes the "long LLM call past TTL" hazard // codex flagged. The 30s throttle inside maybeYield bounds the @@ -726,7 +726,7 @@ export function parseAtomsResponse(raw: string): ExtractedAtom[] { if (typeof item !== 'object' || item === null) continue; const obj = item as Record; const title = typeof obj.title === 'string' ? obj.title.slice(0, 200) : null; - const atomType = typeof obj.atom_type === 'string' ? obj.atom_type : null; + const atomType = typeof obj.atom_type === 'string' ? obj.atom_type.trim().toLowerCase() : null; const body = typeof obj.body === 'string' ? obj.body : null; if (!title || !atomType || !body) continue; if (!ATOM_TYPES.includes(atomType as typeof ATOM_TYPES[number])) continue;