Repository navigation
fix(agent): keep --verbose free of poller RPC heartbeats - #560
Merged
Merged
Conversation
Clients poll the Agent continuously: the desktop/mobile observers replay get_session_events_since / get_events_since per session and the GUI/TUI probe list_streaming_sessions for connectivity. Under --verbose that filled the request log with hundreds of '[grpc] get_session_events_since session=... msg=-' lines between the entries a user actually cares about. Log those three poller commands at TRACE instead of DEBUG; user-driven commands keep logging at DEBUG. RUST_LOG=trace (or future_agent::grpc=trace) still surfaces every poll.
huichen
enabled auto-merge (squash)
September 12, 2026 02:30
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #559 silenced h2's HTTP/2 frame tracing,
future agent --verbosestill floods with the Agent's own request log:These are not user actions. Clients poll them on a timer:
get_session_events_since— desktop/mobile observer cursor replay, once per session per reconnect/backoff tick (desktop/src-tauri/src/agent_bridge/observer.rs,mobile/src/remote/replay.ts)get_events_since— run-level cursor replay (desktop/src-tauri/src/agent_bridge/mod.rs,mobile/src/remote/replay.ts)list_streaming_sessions— connectivity/bulk streaming-status probe (desktop/src-tauri/src/agent_bridge/client.rs,remote_host/availability.rs,tui/src/agent_supervisor.rs)With several sessions attached, a few seconds of log is hundreds of identical heartbeats.
Change
agent/src/grpc/mod.rslogs those three poller commands at TRACE instead of DEBUG; every user-driven command (prompt,abort, settings, session management, …) keeps logging at DEBUG.RUST_LOG=trace(orfuture_agent::grpc=trace) shows every poll, and an explicitRUST_LOGstill overrides the--verbosedefault entirely.state.verbose).Tests
New
grpc::tests::verbose_logs_poller_commands_at_trace_onlydrivesexecute_commandthrough a capturing subscriber with the--verbosefilter and asserts[grpc] get_agent_infois present while[grpc] get_session_events_sinceis not. Driving the current-thread runtime insidetracing::subscriber::with_defaultkeeps the thread-local subscriber in effect for the whole call (the reason this is a plain#[test], not#[tokio::test]).cargo fmt -p future-agent --check✅cargo clippy -p future-agent --all-targets -- -D warnings✅cargo test -p future-agent— 1706 passed; same 31 pre-existing Windows-only failures as on unmodifiedmain(sandbox::paths,rpc::prompt_helpers,sandbox::linux, …), which fail identically at3109ca37.