Skip to content

fix(agent): stop --verbose log spam from HTTP/2 frame tracing - #559

Merged
huichen merged 1 commit into
mainfrom
claude/log-verbose-noise
Sep 12, 2026
Merged

huichen merged 1 commit into
mainfrom
claude/log-verbose-noise

Conversation

@huichen

@huichen huichen commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Problem

future agent --verbose floods the console with HTTP/2 frame tracing:

DEBUG Connection{peer=Server}: send frame=Headers { stream_id: StreamId(427), flags: (0x4: END_HEADERS) }
DEBUG [grpc] get_session_events_since session=... msg=-

default_log_filter() set the root level to debug, so --verbose also turned on h2's per-frame DEBUG logs and buried the Agent's own [grpc] / [stream] lines. The Agent's own debug logs are already gated by state.verbose; they never needed the global level.

Change

--verbose still sets the root level to debug, but the transport crates that log per-frame detail are pinned to warn:

const NOISY_TRANSPORT_TARGETS: &[&str] = &["h2", "tonic", "tower"];

fn default_log_filter(verbose: bool) -> tracing_subscriber::EnvFilter {
    if !verbose {
        return tracing_subscriber::EnvFilter::new("info");
    }
    let mut directives = vec!["debug".to_owned()];
    directives
        .extend(NOISY_TRANSPORT_TARGETS.iter().map(|target| format!("{target}=warn")));
    tracing_subscriber::EnvFilter::new(directives.join(","))
}
  • Targets are the ones actually linked into future-agent's tracing tree (cargo tree -i tracing: h2, hyper-util, tonic, tower); hyper-util/hyper have no debug! call sites, so they are omitted. h2 is the flood (8 debug! sites, per frame), tower/tonic only add a handful.
  • An explicit RUST_LOG still wins entirely (try_from_default_env() is unchanged), so full h2=debug dumps remain available on demand.
  • Transport failures at warn/error still surface.
  • Non-verbose (info) behaviour is unchanged.
  • Also moved a misplaced abort_all_sessions doc comment back onto its function.

Tests

cargo test -p future-agent verbose_default_filter — extends the existing test to assert h2/tonic/tower DEBUG is disabled while future_agent DEBUG is still enabled in verbose mode.

  • cargo fmt -p future-agent --check ✅
  • cargo clippy -p future-agent --all-targets -- -D warnings ✅
  • cargo test -p future-agent — 1705 passed; the 31 failures are pre-existing on clean main under Windows (Unix-path assumptions in sandbox::paths, rpc::prompt_helpers, sandbox::linux, …). Re-ran the same tests in the main worktree at 3109ca37 and they fail identically there.

--verbose raised the root tracing level to debug, which also enabled h2's
per-frame DEBUG logging (Connection{peer=Server}: send frame=...) and
buried the Agent's own [grpc]/[stream] debug lines. Pin the transport
crates (h2, tonic, tower) to WARN so only their failures surface; an
explicit RUST_LOG still overrides the whole filter.

Also move the misplaced abort_all_sessions doc comment back onto its
function.
@huichen
huichen enabled auto-merge (squash) September 12, 2026 02:02
@huichen
huichen merged commit d12d4c2 into main Sep 12, 2026
12 checks passed
@huichen
huichen deleted the claude/log-verbose-noise branch September 12, 2026 02:06
huichen added a commit that referenced this pull request Sep 12, 2026
#561)

#559/#560 silenced h2 frame tracing and the three cursor/probe polls, but
--verbose still fills up with the per-refresh request bursts of the desktop
context panel (it polls every 1.5 s while a run is live): get_commands,
list_providers, get_state, refresh_skills, get_session_entries and a dozen
list_tool_calls in a row, plus list_models every 10 s.

Widen the TRACE promotion from is_poller_command to is_background_command
over a BACKGROUND_COMMANDS table covering those panel/catalog reloads; the
test asserting every name is a real command keeps a typo from silently
dead-coding a log line.

rustls also joins the WARN-pinned transport targets: its 'Sending warning
alert CloseNotify' DEBUG line comes from the log-compat debug! macro that
tracing-subscriber bridges into tracing, so a plain target filter catches
it. Envoy/other TLS handshake chatter is silenced the same way, while
RUST_LOG still overrides the whole filter.
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.

1 participant