You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(compiler): enable JSON mode + harden plan handling (closes#71)
Concept generation can fail in two ways when the LLM emits malformed
JSON for the concepts plan: (a) the parser raises and the function
returns with zero concepts written, (b) a structurally-wrong shape
(nested list, bare strings) slips past the list fallback and crashes
each per-concept task at `concept.get("title")`. Both paths previously
exited via `[OK]`, leaving users to discover an empty `wiki/concepts/`
on their own.
- Pass `response_format={"type": "json_object"}` on the four LLM calls
whose prompt requests a JSON object (summary, plan, concept create,
concept update). Constrains the decoder so providers that support
json mode — OpenAI, DeepSeek, Qwen, Kimi, GLM, MiniMax, Doubao —
can no longer return prose. The existing "Return ONLY valid JSON"
prompt language already satisfies the DeepSeek/Qwen "must mention
json" requirement.
- Add `_filter_concept_items` to drop non-dict entries from the plan
before they reach `_gen_create` / `_gen_update`. Logs the dropped
count and the offending types so the cause is diagnosable.
- Include the first 500 chars of `plan_raw` in the parse-failure
WARNING (was DEBUG-only). Print a stdout `[WARN]` line on both
"plan unparseable" and "planned N, wrote K" so a silent regression
no longer masquerades as `[OK]`.
0 commit comments