Conversation
SummaryThe following content is AI-generated and provides a summary of the pull request: Reduce redundant persistence calls during agent message handlingCategory: Chore SummaryThis PR reduces excessive database round trips during A2A agent message handling by adding lightweight in-memory caching and avoiding duplicate persistence writes when state has not meaningfully changed. Changes
ImpactFor a simple single-message interaction, the observed database trace is significantly reduced: repeated task reads/updates, notification config reads, and checkpoint upserts are avoided during streaming. This improves request latency and reduces unnecessary database load without changing the external behavior. Have you...
PR Bot InformationVersion:
|
This branch has not been deployed
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.
The problem
Currently on
mainwhen a user send a single simple message and the agent responds with a single simple response.The following database round trips are made:
This undiscovered behavior is mostly caused by our dependencies and their expectations. While all the information to make a much more optimized persistency solution are available. These points are not clear as they are not the advertised APIs from the libraries. Additionally these points are drowned in ~700 line long functions.
The current flow is as follows:
Changes
This PR does not try to solve the root cause. It did some simply checks to prevent duplicate database requests from being made. A proper solution would be to move the persistency calls to more appropriate locations in the chain. Where we have more detailed stream and state information.
full traces comparison
main
PR
Have you...