The script fails with a YAML parsing error when using Gemini 2.5 Flash Preview model. The error occurs during the chapter writing phase when the LLM returns malformed YAML containing unquoted colons in description fields.
Environment
- Model:
gemini-2.5-flash-preview-05-20
- Python: 3.12
- Command:
python main.py --dir /path/to/project --exclude "*node_modules/*" "*__pycache__/*" "*.env" --max-size 50000
Error Details
File "nodes.py", line 627, in exec
chapter_data = yaml.safe_load(yaml_str)
yaml.scanner.ScannerError: mapping values are not allowed here
in "<unicode string>", line 2, column 58:
... Lifecycle & Workflow Automation: manages report states, assignm ...
Root Cause
The issue occurs in the WriteChapters.exec() method when the LLM generates YAML descriptions containing unquoted colons. For example:
Problematic LLM output:
description: Lifecycle & Workflow Automation: manages report states, assignment workflows
Should be:
description: "Lifecycle & Workflow Automation: manages report states, assignment workflows"
The YAML parser interprets the colon in "Lifecycle & Workflow Automation: manages..." as a key-value separator, making the YAML invalid.
Steps to Reproduce
- Run the script on a codebase with workflow/automation-related abstractions
- Wait for the WriteChapters phase
- Script crashes when LLM generates descriptions with unquoted colons
Expected Behavior
The script should successfully parse all LLM-generated YAML responses and complete the chapter generation process.
The script fails with a YAML parsing error when using Gemini 2.5 Flash Preview model. The error occurs during the chapter writing phase when the LLM returns malformed YAML containing unquoted colons in description fields.
Environment
gemini-2.5-flash-preview-05-20Error Details
Root Cause
The issue occurs in the
WriteChapters.exec()method when the LLM generates YAML descriptions containing unquoted colons. For example:Problematic LLM output:
Should be:
The YAML parser interprets the colon in "Lifecycle & Workflow Automation: manages..." as a key-value separator, making the YAML invalid.
Steps to Reproduce
Expected Behavior
The script should successfully parse all LLM-generated YAML responses and complete the chapter generation process.