Skip to content

Fix --output-dir having no effect for single-skill runs#109

Merged
chlowell merged 3 commits into
microsoft:mainfrom
chlowell:output-dir
Mar 10, 2026
Merged

Fix --output-dir having no effect for single-skill runs#109
chlowell merged 3 commits into
microsoft:mainfrom
chlowell:output-dir

Conversation

@chlowell

Copy link
Copy Markdown
Member

waza run --output-dir <dir> silently produces no output files when running a single skill (the most common case). Multi-skill runs work correctly.

Root Cause

In cmd/waza/cmd_run.go, the single-skill code path returns early without ever checking the outputDir flag:

if len(specPaths) == 1 {
    results, err := runCommandForSpec(cmd, specPaths[0])
    autoUploadOutcomes(cmd, cfg, results)
    return err  // ← returns without writing to outputDir
}

The writeOutputDir() call only existed in the multi-skill path further down the function.

Fix

Added outputDir handling to the single-skill path, calling the same writeOutputDir() function used by the multi-skill path:

if outputDir != "" {
    if wErr := writeOutputDir(outputDir, []skillRunResult{
        {skillName: specPaths[0].skillName, outcomes: results},
    }); wErr != nil {
        return fmt.Errorf("failed to write output directory: %w", wErr)
    }
}

Copilot AI review requested due to automatic review settings March 10, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes waza run --output-dir <dir> being ignored for the common “single-skill” execution path by ensuring the same structured output writing logic runs regardless of number of skills.

Changes:

  • Add --output-dir handling to the single-skill branch in runCommandE() by calling writeOutputDir().
  • Add a regression test that runs a single spec with --output-dir and asserts a result JSON file is written.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cmd/waza/cmd_run.go Writes structured output for single-skill runs when --output-dir is set.
cmd/waza/cmd_run_test.go Adds coverage to ensure --output-dir produces files for single-skill runs.

Comment thread cmd/waza/cmd_run.go
@chlowell chlowell marked this pull request as ready for review March 10, 2026 22:56
@chlowell chlowell requested a review from spboyer as a code owner March 10, 2026 22:56
Copilot AI review requested due to automatic review settings March 10, 2026 22:56
@chlowell chlowell enabled auto-merge (squash) March 10, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread cmd/waza/cmd_run.go
@chlowell chlowell merged commit 51d6638 into microsoft:main Mar 10, 2026
6 checks passed
@chlowell chlowell deleted the output-dir branch March 10, 2026 23:30
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@445c89f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
cmd/waza/cmd_run.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #109   +/-   ##
=======================================
  Coverage        ?   72.97%           
=======================================
  Files           ?      131           
  Lines           ?    14825           
  Branches        ?        0           
=======================================
  Hits            ?    10818           
  Misses          ?     3205           
  Partials        ?      802           
Flag Coverage Δ
go-implementation 72.97% <75.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spboyer spboyer mentioned this pull request Mar 12, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants