Skip to content

distill --plan silently ignored with text-based config #504

@noahgift

Description

@noahgift

Bug

apr distill --config text-distill.yaml --plan silently ignores the --plan flag for text-based distillation configs, erroring with "—stage generate required" instead of showing a plan.

Root Cause

In crates/apr-cli/src/commands/distill.rs, the run_text_config_mode() function (line 585) accepts _plan_only but never uses it (underscore prefix intentionally suppresses warning):

fn run_text_config_mode(
    config: &TextDistillConfig,
    config_path: &Path,
    stage: Option<&str>,
    _plan_only: bool,  // line 589: SILENTLY IGNORED
    json_output: bool,
) -> Result<()> {
    match stage {
        Some("generate") => run_text_generate(config, config_path, json_output),
        // ...
        None => Err(CliError::ValidationFailed(
            "--stage generate required with text-based distillation config.".into()
        )),
    }
}

Compare with the logit KD config path (line 567) which correctly handles plan_only.

Expected Behavior

apr distill --config text-distill.yaml --plan --json should show a plan (config summary, estimated token count, stage descriptions) instead of erroring.

Fix

Add plan_only handling before the stage match, similar to how run_config_mode() handles it for logit KD configs at line 567.

Metadata

Metadata

Assignees

No one assigned

    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