fix(cli): suppress library warning noise in tracker audit / run listing / tracker diagnose#121
Closed
fix(cli): suppress library warning noise in tracker audit / run listing / tracker diagnose#121
tracker audit / run listing / tracker diagnose#121Conversation
Agent-Logs-Url: https://github.com/2389-research/tracker/sessions/6741f0c2-d6d3-45e2-9315-25bf0d825c17 Co-authored-by: clintecker <26985+clintecker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CLI to suppress library stderr warnings in tracker audit/list/diagnose
fix(cli): suppress library warning noise in Apr 20, 2026
tracker audit / run listing / tracker diagnose
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores prior CLI UX by suppressing non-fatal library-originated warning output on stderr for user-facing commands (tracker audit run listing and tracker diagnose), while keeping the library’s default warning behavior and making the warning sink configurable for non-CLI consumers.
Changes:
- Added
ListRunsWithConfig/ListRunsConfig{LogWriter}andDiagnoseWithConfig/DiagnoseMostRecentWithConfig/DiagnoseConfig{LogWriter}to route non-fatal warnings to a configurableio.Writer(defaulting toos.Stderr). - Updated CLI commands to pass
io.Discardso library warnings don’t leak into CLI stderr. - Added regression tests covering library warning routing and CLI stderr suppression; updated changelog.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tracker_audit.go |
Introduces ListRunsWithConfig + ListRunsConfig.LogWriter and routes listing warnings through the configured writer. |
tracker_diagnose.go |
Introduces DiagnoseWithConfig/DiagnoseMostRecentWithConfig + DiagnoseConfig.LogWriter and routes malformed status.json warnings through the configured writer. |
tracker_audit_test.go |
Adds a focused unit test verifying warnings are emitted via a custom writer when activity log is unreadable. |
tracker_diagnose_test.go |
Adds a focused unit test verifying warnings are emitted via a custom writer when status.json is malformed. |
cmd/tracker/audit.go |
Switches run listing to ListRunsWithConfig(..., LogWriter: io.Discard) to suppress stderr noise. |
cmd/tracker/diagnose.go |
Switches diagnose paths to DiagnoseWithConfig / DiagnoseMostRecentWithConfig with io.Discard. |
cmd/tracker/audit_test.go |
Adds an integration-style test ensuring listing still works and library warnings are suppressed on stderr. |
cmd/tracker/diagnose_test.go |
Adds an integration-style test ensuring diagnose still prints output and suppresses library warnings on stderr. |
CHANGELOG.md |
Documents the CLI warning suppression and new configurable log-writer behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 library extraction introduced new non-fatal stderr warnings from library internals that now leak into user-facing CLI commands (
tracker audit/listing andtracker diagnose) on stale or corrupted run artifacts. This restores prior CLI UX while keeping library-level warning surfacing configurable for non-CLI consumers.Library API: configurable warning sink
ListRunsWithConfig(workdir, ListRunsConfig)withListRunsConfig.LogWriter.DiagnoseWithConfig(runDir, DiagnoseConfig)andDiagnoseMostRecentWithConfig(workdir, DiagnoseConfig)withDiagnoseConfig.LogWriter.ListRuns,Diagnose,DiagnoseMostRecent) remain, defaultingnilwriter toos.Stderrto preserve library behavior.CLI: explicit suppression for user-facing commands
cmd/tracker/audit.gonow callsListRunsWithConfig(..., LogWriter: io.Discard).cmd/tracker/diagnose.gonow callsDiagnoseWithConfig/DiagnoseMostRecentWithConfigwithLogWriter: io.Discard.Regression coverage
Docs
CHANGELOG.md(Unreleased / Fixed) to reflect CLI warning suppression and new configurable log-writer behavior.