Skip to content

fix(agent): quiet routine refresh traffic and rustls in --verbose logs - #561

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

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

Conversation

@huichen

@huichen huichen commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Problem

After #559 (h2 frame tracing) and #560 (cursor/probe polls), future agent --verbose still fills up with the desktop context-panel refresh burst. The panel polls every 1.5 s while a run is live (useContextData.ts), and one refresh sends:

DEBUG [grpc] list_models session=- msg=-
DEBUG [grpc] list_providers session=- msg=-
DEBUG [grpc] get_commands session=- msg=-
DEBUG [grpc] get_state session=... msg=-
DEBUG [grpc] refresh_skills session=- msg=-
DEBUG [grpc] get_session_entries session=... msg=-
DEBUG [grpc] list_tool_calls session=... msg=-   ← a dozen in a row, one per run

list_tool_calls in particular arrives in bursts (one per run of the active thread), plus a list_models sweep every 10 s. None of it is a user action.

Separately, one TLS line slipped past #559's target list:

DEBUG Sending warning alert CloseNotify

rustls logs through the log crate (debug! from rustls::log), which tracing-subscriber bridges into tracing via LogTracer — so it carries rustls's own target and is caught by a plain target filter.

Change

agent/src/grpc/mod.rs — widen the TRACE promotion from is_poller_command to is_background_command, backed by a BACKGROUND_COMMANDS table:

  • cursor replays / probes: get_events_since, get_session_events_since, list_streaming_sessions
  • panel / catalog reloads: get_commands, get_session_entries, get_state, get_tool_output, list_models, list_providers, list_tool_calls, refresh_skills

User-intent commands (prompt, abort, settings mutations, session management, …) keep logging at DEBUG. RUST_LOG=trace (or future_agent::grpc=trace) still surfaces every request.

agent/src/cli.rs — add rustls to NOISY_TRANSPORT_TARGETS (h2, rustls, tonic, tower), pinned to WARN. Its DEBUG output is per-record TLS detail; failures still surface at WARN/ERROR.

Tests

  • verbose_logs_background_commands_at_trace_only (renamed from the fix(agent): keep --verbose free of poller RPC heartbeats #560 test) — list_tool_calls is absent from a debug-filtered capture while get_agent_info is present.
  • background_commands_are_all_known_commands (new) — every name in the table resolves through future_rpc::command_policy::command_policy, so a typo cannot silently dead-code a log line; prompt/abort stay outside the set.
  • verbose_default_filter_enables_grpc_debug_events — extended to assert rustls DEBUG is off (and h2 WARN still on) under --verbose.

Verification

  • cargo fmt -p future-agent --check ✅
  • cargo clippy -p future-agent --all-targets -- -D warnings ✅
  • cargo test -p future-agent — 1707 passed; the 31 failures are the pre-existing Windows-only ones (sandbox::paths, rpc::prompt_helpers, sandbox::linux, …) that fail identically on unmodified main.

#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.
@huichen
huichen enabled auto-merge (squash) September 12, 2026 02:51
@huichen
huichen merged commit 9452a3e into main Sep 12, 2026
12 checks passed
@huichen
huichen deleted the claude/log-refresh-noise branch September 12, 2026 02:56
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