Fix error handling in boss-mode report generation to surface I/O errors#28
Conversation
…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>
There was a problem hiding this comment.
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.IsNotExistand surface unexpected errors to users - Updated
go.modto movegithub.com/robfig/cron/v3from indirect to direct dependency (already directly imported inauto_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 { |
There was a problem hiding this comment.
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".
| } 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 { |
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
os.IsNotExistvs other errors✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.