Skip to content

YAML parsing error when LLM generates descriptions with unquoted colons #2

Description

@yunusberfuozcan

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

  1. Run the script on a codebase with workflow/automation-related abstractions
  2. Wait for the WriteChapters phase
  3. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions