Skip to content

fix: suppress auto-push/backup warnings in quiet and JSON modes#2822

Merged
maphew merged 1 commit intosteveyegge:mainfrom
harry-miller-trimble:fix/auto-push-quiet
Mar 26, 2026
Merged

fix: suppress auto-push/backup warnings in quiet and JSON modes#2822
maphew merged 1 commit intosteveyegge:mainfrom
harry-miller-trimble:fix/auto-push-quiet

Conversation

@harry-miller-trimble
Copy link
Contributor

Problem

Auto-push and auto-backup warning messages (e.g., Warning: dolt auto-push failed) were always printed to stderr, even when using --quiet or --json. In agent workflows with frequent writes, these warnings create noise that agents may misinterpret as errors.

Fix

Suppress warning messages from maybeAutoPush and maybeAutoBackup when --quiet or --json mode is active. Errors are still logged via debug.Logf for troubleshooting with BD_DEBUG=1.

Affected messages:

  • Warning: dolt auto-push failed: <err>
  • Warning: auto-backup failed: <err>
  • Warning: backup git push failed: <err>

Note: The throttle messages (dolt auto-push: throttled..., backup: throttled...) were already debug-only — they only appear with BD_DEBUG=1 or --verbose.

Changes

  • cmd/bd/dolt_autopush.go: Guard push failure warning with !isQuiet() && !jsonOutput
  • cmd/bd/backup_auto.go: Guard backup failure + git push warnings similarly

Backward Compatibility

  • Normal mode (no flags): warnings still print to stderr as before
  • --quiet / --json: warnings suppressed (new behavior)
  • BD_DEBUG=1: all messages still visible via debug.Logf

Closes harry-miller-trimble#9

Auto-push and auto-backup warning messages (e.g., 'Warning: dolt
auto-push failed') were always printed to stderr regardless of output
mode. This creates noise in agent workflows using --quiet or --json,
where agents may misinterpret warnings as errors.

Now these warnings are:
- Suppressed in --quiet mode (errors-only output)
- Suppressed in --json mode (clean machine-readable output)
- Always logged via debug.Logf for troubleshooting with BD_DEBUG=1

Closes #9

Co-authored-by: Copilot <[email protected]>
@maphew
Copy link
Collaborator

maphew commented Mar 26, 2026

Hygiene: Exemplary. Conventional commit title, thorough problem/fix/backward-compat description, references upstream issue. Value: Real UX bug for agent workflows. Minimal, surgical change. Thanks @harry-miller-trimble!

@maphew maphew merged commit 9d866c7 into steveyegge:main Mar 26, 2026
19 checks passed
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.

Auto-push warning noise on every bd write operation

2 participants