Throttle ambient agent task fetch based on RTC invalidation message.#11236
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a leading/trailing throttle around RTC-triggered ambient agent task refreshes in AgentConversationsModel, aborts any pending throttle timer on reset, and adds helper-level unit coverage for earliest timestamp coalescing.
Concerns
- No blocking correctness, security, or spec-alignment concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
13d64d8 to
e948712
Compare
e948712 to
85564e4
Compare
…arpdotdev#11236) ## Description Throttles task re-fetching triggered by RTC invalidation messages to maximum of 1 fetch every 5 seconds. Prevents spammy task list fetching in common scenarios where members of a team have access to all other teammate's agent runs, an update to each of which triggers an RTC invalidation message <!-- ## Changelog Entries for Stable The entries below will be used when constructing a soft-copy of the stable release changelog. Leave blank or remove the lines if no entry in the stable changelog is needed. Entries should be on the same line, without the `{{` `}}` brackets. You can use multiple lines, even of the same type. The valid suffixes are: - NEW-FEATURE: for new, relatively sizable features. Features listed here will likely have docs / social media posts / marketing launches associated with them, so use sparingly. - IMPROVEMENT: for new functionality of existing features. - BUG-FIX: for fixes related to known bugs or regressions. - IMAGE: the image specified by the URL (hosted on GCP) will be added to Dev & Preview releases. For Stable releases, see the pinned doc in the #release Slack channel. - OZ: Oz-related updates. Use `CHANGELOG-OZ`. At most 4 Oz updates are shown in-app per release. - NONE: Explicitly opt out of changelog inclusion. Use `CHANGELOG-NONE` for PRs that should never appear in the changelog (e.g. refactors, internal tooling, CI changes). This prevents the changelog agent from inferring an entry. CHANGELOG-NEW-FEATURE: {{text goes here...}} CHANGELOG-IMPROVEMENT: {{text goes here...}} CHANGELOG-BUG-FIX: {{text goes here...}} CHANGELOG-BUG-FIX: {{more text goes here...}} CHANGELOG-IMAGE: {{GCP-hosted URL goes here...}} CHANGELOG-OZ: {{text goes here...}} CHANGELOG-NONE -->
## Description <!-- Please remember to add your design buddy onto the PR for review, if it contains any UI changes! --> This PR updates the client-side RTC logic to only refetch data for a task on an RTC invalidation if: - The task is actively being viewed in a given task (using the `task_id` from the RTC notification) - We have the agent management view or conversation sidebar open Right now, whenever we get _any_ RTC invalidation, we discard the task ID and do a refetch. The throttling introduced in #11236 limits this fetch to once per every 5s, but we really shouldn't be refetching on _every_ RTC invalidation if we don't need to. ## Testing <!-- How did you test this change? What automated tests did you add? If you didn't add any new tests, what's your justification for not adding any? Manual testing is required for changes that can be manually tested, and almost all changes can be manually tested. If your change can be manually tested, please include screenshots or a screen recording that show it working end to end. You can run the app locally using `./script/run` - see WARP.md for more details on how to get set up. --> - [x] I have manually tested my changes locally with `./script/run` Tested locally, loom: https://www.loom.com/share/c4b23aaab2c4447c8839631941bbcce2 ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Description
Throttles task re-fetching triggered by RTC invalidation messages to maximum of 1 fetch every 5 seconds. Prevents spammy task list fetching in common scenarios where members of a team have access to all other teammate's agent runs, an update to each of which triggers an RTC invalidation message