Skip to content

Fix error handling in boss-mode report generation to surface I/O errors#28

Merged
WZ merged 4 commits intofix/uncertainty-button-action-idsfrom
copilot/sub-pr-26-again
Feb 17, 2026
Merged

Fix error handling in boss-mode report generation to surface I/O errors#28
WZ merged 4 commits intofix/uncertainty-button-action-idsfrom
copilot/sub-pr-26-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Boss-mode report generation silently fell back to the full LLM pipeline on any file read error, including permission/I/O failures. This masked real errors and wasted tokens.

Changes

  • Error handling: Explicitly check for os.IsNotExist vs other errors
    • File not found → log and continue to full pipeline (expected)
    • Permission/I/O errors → surface to user and abort (unexpected)
// Before: all errors treated as "file doesn't exist"
if content, readErr := os.ReadFile(teamReportPath); readErr == nil && len(content) > 0 {
    // use shortcut
}
log.Printf("no existing team report found, running full pipeline")

// After: distinguish expected from unexpected errors
content, readErr := os.ReadFile(teamReportPath)
if readErr != nil {
    if !os.IsNotExist(readErr) {
        log.Printf("Error reading team report file %s: %v", teamReportPath, readErr)
        postEphemeral(api, cmd, fmt.Sprintf("Error reading team report file: %v", readErr))
        return
    }
    log.Printf("no existing team report found, running full pipeline")
} else if len(content) > 0 {
    // use shortcut
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 16, 2026 10:58
…d from other errors

Co-authored-by: WZ <719869+WZ@users.noreply.github.com>
Co-authored-by: WZ <719869+WZ@users.noreply.github.com>
Co-authored-by: WZ <719869+WZ@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP to address feedback on uncertainty buttons Fix error handling in boss-mode report generation to surface I/O errors Feb 16, 2026
Copilot AI requested a review from WZ February 16, 2026 11:01
@WZ WZ marked this pull request as ready for review February 17, 2026 18:34
Copilot AI review requested due to automatic review settings February 17, 2026 18:34
@WZ WZ merged commit 9ecdcf3 into fix/uncertainty-button-action-ids Feb 17, 2026
@WZ WZ deleted the copilot/sub-pr-26-again branch February 17, 2026 18:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves error handling in boss-mode report generation to properly distinguish between expected file-not-found errors and unexpected I/O or permission errors. Previously, all file read errors were silently treated as "file doesn't exist", which masked real problems and wasted LLM tokens by falling back to the full pipeline unnecessarily.

Changes:

  • Refactored error handling for team report file reads to explicitly check os.IsNotExist and surface unexpected errors to users
  • Updated go.mod to move github.com/robfig/cron/v3 from indirect to direct dependency (already directly imported in auto_fetch.go)

Reviewed changes

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

File Description
slack.go Improved error handling in handleGenerateReport to distinguish file-not-found from I/O/permission errors, surfacing unexpected errors instead of silently falling back
go.mod Correctly moved robfig/cron/v3 from indirect to direct dependency status

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
// File doesn't exist - fall through to full pipeline below
log.Printf("generate-report boss: no existing team report found, running full pipeline")
} else if len(content) > 0 {
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Consider adding an else clause to log when the team report file exists but is empty. Currently, this case falls through to the full pipeline silently, while the file-not-found case logs "no existing team report found, running full pipeline". For consistency and debuggability, empty files should also be logged, e.g., "generate-report boss: team report file is empty, running full pipeline".

Suggested change
} else if len(content) > 0 {
} else if len(content) == 0 {
// File exists but is empty - fall through to full pipeline below
log.Printf("generate-report boss: team report file is empty, running full pipeline")
} else {

Copilot uses AI. Check for mistakes.
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.

2 participants