Skip to content

Distiller agent writes idea.md to file instead of stdout #522

@colehurwitz

Description

@colehurwitz

Problem

The Distiller agent writes the spec to a file (idea.md) instead of printing it to stdout. This breaks the CEO's ideation flow because the agent runner captures stdout to .factory/reviews/distiller-latest.md, and the CEO reads that file to present the spec to the user.

What happens:

  1. CEO spawns factory agent distiller --task "..."
  2. Distiller writes the full spec to an idea.md file on disk
  3. Distiller prints only a summary (e.g. "I've written the spec to idea.md") to stdout
  4. Agent runner captures the summary to .factory/reviews/distiller-latest.md
  5. CEO reads distiller-latest.md and presents only the summary — the full spec is in an idea.md file nobody in the flow looks at

What should happen:

  1. Distiller prints the full spec to stdout
  2. Agent runner captures the full spec to .factory/reviews/distiller-latest.md
  3. CEO reads and presents the full spec

Root Cause

The Distiller prompt (factory/agents/prompts/distiller.md, line 62) says:

Write the idea.md content to stdout using this exact structure

The model interprets "idea.md" as a filename and writes to disk. The Distiller is the only agent that's supposed to output to stdout — every other agent (Strategist, Researcher, Builder) writes to explicit file paths. The model has a strong prior toward file-writing.

The exit condition on line 158 also says "printed to stdout" but the dual reference to "idea.md" as both a format name and an output target creates ambiguity.

Suggested Fix

Strengthen the stdout instruction in distiller.md to make it unambiguous — e.g. add an explicit anti-instruction ("Do NOT write to a file") and/or rename the format reference so "idea.md" doesn't read as a filename target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions