Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ go 1.23.0
require (
github.com/anthropics/anthropic-sdk-go v1.22.0
github.com/mattn/go-sqlite3 v1.14.33
github.com/robfig/cron/v3 v3.0.1
github.com/slack-go/slack v0.17.3
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/gorilla/websocket v1.5.3 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
Expand Down
13 changes: 11 additions & 2 deletions slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,17 @@ func handleGenerateReport(api *slack.Client, db *sql.DB, cfg Config, cmd slack.S
if mode == "boss" {
teamReportFile := fmt.Sprintf("%s_%s.md", cfg.TeamName, friday.Format("20060102"))
teamReportPath := filepath.Join(cfg.ReportOutputDir, teamReportFile)
if content, readErr := os.ReadFile(teamReportPath); readErr == nil && len(content) > 0 {
content, readErr := os.ReadFile(teamReportPath)
if readErr != nil {
if !os.IsNotExist(readErr) {
// Unexpected error (permission, I/O, etc.) - surface it and abort
log.Printf("Error reading team report file %s: %v", teamReportPath, readErr)
postEphemeral(api, cmd, fmt.Sprintf("Error reading team report file: %v", readErr))
return
}
// 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.
log.Printf("generate-report boss: deriving from existing team report %s", teamReportPath)
template := parseTemplate(string(content))
stripCurrentTeamTitleFromPrefix(template, cfg.TeamName)
Expand Down Expand Up @@ -414,7 +424,6 @@ func handleGenerateReport(api *slack.Client, db *sql.DB, cfg Config, cmd slack.S
log.Printf("generate-report done mode=boss derived-from-team")
return
}
log.Printf("generate-report boss: no existing team report found, running full pipeline")
}

items, err := GetItemsByDateRange(db, monday, nextMonday)
Expand Down