Skip to content

fix(desktop): stop overriding an operator's global RUST_LOG level - #7287

Open
artemtrofymenko wants to merge 2 commits into
block:mainfrom
artemtrofymenko:fix/rust-log-global-level
Open

fix(desktop): stop overriding an operator's global RUST_LOG level#7287
artemtrofymenko wants to merge 2 commits into
block:mainfrom
artemtrofymenko:fix/rust-log-global-level

Conversation

@artemtrofymenko

Copy link
Copy Markdown

What

child_rust_log_filter appends buzz_acp=info to any RUST_LOG that does not already mention buzz_acp. A bare level is such a filter, and in EnvFilter a target directive outranks the global one, so the append reverses the operator's intent in both directions:

operator sets child receives effect
off off,buzz_acp=info asked for silence, still gets this crate at info
trace trace,buzz_acp=info asked for trace, gets the one crate they were debugging narrowed to info

A filter that sets a global level is now forwarded unchanged. Named and numeric spellings both count — EnvFilter accepts 0..5, and 0 is the case that matters most, since widening "log nothing" is the opposite of the request.

Everything else is untouched: a target-only filter still gains the harness default, an explicit buzz_acp filter is still passed through verbatim, and unset still defaults to buzz_acp=info.

Why separately

This was found by @cristiansotogarciaxatech while reviewing the log-target defect on #6035 — the credit is theirs. It is worth its own PR because it lives in the desktop's child-env construction rather than in the crate's targets, so it survives #3309 landing and is not fixed by it. I have stood down #6035 in favour of #3309 and this carries over the one part of it that #3309 does not address.

Testing

Four tests in the existing mod tests cover the global-level cases (named, numeric, whitespace, mixed with targets) and the three behaviours that must not change.

Ran this repository's CI on a fork, since first-time-contributor workflows sit at action_required: 29 jobs green, including Rust Lint, Desktop Core, Security, Windows Rust (msvc) and the macOS build. One job fails — Unit Tests, on buzz-agent::fake_llm cancelled_turn_with_usage_emits_notification_before_response. That same test, by name, fails on upstream main today (run 33740073893) in a crate this change does not touch.

child_rust_log_filter appends `buzz_acp=info` to any filter that does
not already mention `buzz_acp`. A bare level is such a filter, and a
target directive outranks the global one, so the append reverses the
operator's intent in both directions: `RUST_LOG=off` still logs this
crate at info, and `RUST_LOG=trace` is narrowed back to info for the
one crate they were trying to debug.

Forward a filter that sets a global level unchanged. Named and numeric
spellings both count — `EnvFilter` accepts `0`..`5` as levels, and `0`
is the case that matters most, since widening "log nothing" is the
opposite of the request.

Target-only filters still gain the harness default, an explicit
`buzz_acp` filter is still passed through, and unset still defaults, so
the change is confined to the case that was wrong.

Reported independently by @cristiansotogarciaxatech on block#6035 while
reviewing the log-target defect; this is the part of that discussion
which survives block#3309 landing, since it lives in the desktop rather than
in the crate's targets.

Signed-off-by: Artem Trofymenko <99894081+artemtrofymenko@users.noreply.github.com>
Signed-off-by: Artem Trofymenko <readycsvapp@gmail.com>
Signed-off-by: Artem Trofymenko <99894081+artemtrofymenko@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 752cbfc0375efc8bac3d5cc2a5716250bc0be234...80dfff46383cd45bfd68d9efb6ac98ba1395e2da.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 80dfff46383cd45bfd68d9efb6ac98ba1395e2da to authorize a new review.
Any previous review applies only to its recorded range.

@Chessing234 Chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preserving a bare global level (and not appending buzz_acp=info over it) is the right operator-facing behavior. tests cover off/trace/mixed.

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.

2 participants