Repository navigation
fix(gui): rate-limit remote drop logs and skip event mirroring while NATS is offline - #101
Merged
Merged
Conversation
…NATS is offline The remote bridge's per-event "event publish queue full" eprintln flooded the terminal the moment the queue saturated (e.g. NATS server down/restarted): the drain task blocks on publish().await so every subsequent tool_delta dropped and printed a line. Drop reporting is now a rate-limited episode state machine (first line, then one per 10s, then a single recovery line), and publish_event checks the NATS connection state before serializing/enqueueing so events can't pile into a queue that has no live link to send them. Clients still heal any gap via get_events_since backfill. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
Summary
The remote bridge's per-event drop log flooded the terminal the moment the NATS publish queue saturated (e.g. the NATS server was restarted/down): the single drain task blocks on
publish().await, so every subsequenttool_deltadropped and printedremote: event publish queue full— one line per event, forever.Two fixes in
gui/src-tauri/src/remote/mod.rs:DropCountersepisode state machine: one line when an episode starts, one cumulative line per 10s while it persists, one line on recovery. Event-driven (runs on the hot path every event passes through) because the drain task can't reach its own timer while blocked on publish.publish_eventnow checksclient.connection_state()before serializing/enqueueing, so a dead link no longer piles up to 4096 events that can't be sent. This is the root-cause fix for the server-restart scenario.Clients still heal any gap via
get_events_sincebackfill on reattach — a dropped event is never data loss.Test plan
cargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --check(workspace + gui/src-tauri) — cleancargo test(agent) — 856 passedcargo test --lib(gui/src-tauri) — 184 passed, incl. 2 newDropCountersunit tests (rate-limit episodes; recovery + reset)🤖 Generated with Claude Code