Skip to content

fix(cli): avoid debug logging by default in CLI#7569

Merged
jamadeo merged 1 commit intoblock:mainfrom
WhiskerSage:fix/7557-cli-default-log-level
Feb 28, 2026
Merged

fix(cli): avoid debug logging by default in CLI#7569
jamadeo merged 1 commit intoblock:mainfrom
WhiskerSage:fix/7557-cli-default-log-level

Conversation

@WhiskerSage
Copy link
Copy Markdown
Contributor

PR Title

fix(cli): avoid debug logging in default CLI filter

PR Body

Summary

Fixes a CLI privacy footgun where default logging included debug-level directives when RUST_LOG was not set.

Problem

In crates/goose-cli/src/logging.rs, the fallback EnvFilter used:

  • mcp_client=debug
  • goose=debug

This made CLI logs much more verbose by default and increased risk of sensitive content ending up in log files.

Changes

  • Added default_env_filter() helper to centralize fallback directives.
  • Updated fallback logging levels from debug to info:
    • mcp_client=info
    • goose=info
    • goose_cli=info
    • keep global fallback WARN for other modules
  • Kept behavior unchanged when RUST_LOG is explicitly provided.
  • Added regression test:
    • test_default_filter_avoids_debug_by_default
    • verifies default filter does not include goose=debug or mcp_client=debug

Validation

Ran:

cargo test -p goose-cli --lib logging::tests::test_default_filter_avoids_debug_by_default -- --exact

Result:

  • 1 passed, 0 failed

Risk

Low:

  • Scope is limited to CLI fallback logging configuration.
  • No behavior change for users who already set RUST_LOG.
  • Added unit test to prevent regressions.

Fixes #7557

@jamadeo jamadeo added this pull request to the merge queue Feb 28, 2026
Merged via the queue into block:main with commit 6e4d6fe Feb 28, 2026
19 checks passed
lifeizhou-ap added a commit that referenced this pull request Mar 2, 2026
* main: (46 commits)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
  chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
  chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
  chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
  chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
  chore(deps): bump minimatch in /ui/desktop (#7572)
  fix: validate configure probe for streaming providers (#7564)
  Dockerfile: add missing build/runtime dependencies (#7546)
  fix(claude-code): Permission routing for smart-approve (#7501)
  Add base_path field to custom provider config (#7558)
  fix(cli): avoid debug logging by default in CLI (#7569)
  fix: panic on corrupted permission.yaml instead of silently allowing all (#7432) (#7458)
  fix(openai): handle null reasoning effort in Responses API (#7469)
  Allow GOOSE_NODE_DIR override in batch file (#7422)
  feat: add analyze platform extension with tree-sitter AST parsing (#7542)
  ...
craigwalkeruk pushed a commit to craigwalkeruk/custom-goose that referenced this pull request Mar 5, 2026
@tltsaia
Copy link
Copy Markdown

tltsaia commented Mar 6, 2026

Not sure why, but using the goose-x86_64-pc-windows-msvc (v11.27.1) agent still repeatedly writes out debug info during operation?

goose info
goose Version:
Version: 1.27.1

• starting 7 extensions: apps, tom, summon, todo, Extension Manager, developer, analyze __( O)> ● new session · dvcbot_gemini-3-flash gemini-3-pro → gemini-3-flash \____) 20260306_8 · E:\#####\Goose\scripts L L goose is ready ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ 0% 0/128k 🪿 r uok? • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) • Optimizing thought processes... (Ctrl+C to interrupt) I am functioning within normal parameters. How can I help you today? ⏱ 10.76s ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ 2% 2k/128k

jeffa-block added a commit to jeffa-block/goose that referenced this pull request Mar 8, 2026
…t to info

The dispatch_tool_call #[instrument] macro was not skipping the session
parameter, causing the entire Session struct (including full message
history and base64 image data) to be serialised into every DEBUG log
line. This produced log lines up to 8 MB each, with server logs growing
1-4 GB/day for heavy users.

Changes:
- Add session to the skip list in dispatch_tool_call's #[instrument],
  log just session.id instead
- Change server default log level from goose=debug to goose=info,
  matching the CLI fix in block#7569

Users can still enable debug logging via RUST_LOG=goose=debug.

Fixes block#4965 (complements the rotation fix in block#5561)
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.

CLI default log filter includes goose=debug (sensitive content may end up in logs)

3 participants