fix(agent): add shutdown signal to response cache cleanup loop and annotate TUI forwarder handle#4581
Merged
Merged
Conversation
This was
linked to
issues
May 28, 2026
…notate early TUI forwarder Closes #4572: apply_response_cache now accepts a CancellationToken parameter; the hourly cleanup loop exits cleanly via tokio::select! when the token is cancelled. The call site in runner.rs passes mem_cancel.child_token(), reusing the existing session-scoped token already bridged from shutdown_rx. Closes #4571: document that _early_status_forwarder is an intentional drop at block end (self-terminating when the channel closes) via EXEMPT comment, replacing the bare let _ that triggered clippy::let_underscore_future.
1e71f3c to
d5d1e2e
Compare
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
apply_response_cachebackground cleanup loop now accepts aCancellationTokenand exits cleanly on session shutdown viatokio::select!. The call site passesmem_cancel.child_token(), reusing the existing session-scoped token already wired toshutdown_rx._early_status_forwarderin the TUI init path is annotated with an// EXEMPT:comment clarifying it is intentionally dropped at block end (the task self-terminates when the channel closes). Replaces the misleading barelet _that triggeredclippy::let_underscore_future.Test plan
cargo +nightly fmt --check— cleanRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked— cleancargo clippy -p zeph --features full -- -D warnings— cleancargo build --features full— succeedsapply_response_cache_disabled_returns_agent_unchangedandapply_response_cache_enabled_attaches_cacheupdated and compile correctlyrunner.rstest block (AnyProvider::Mocknot found) exist onmainbefore these changes and are unrelated to this PR