Repository navigation
feat(server): bound the finished tasks InMemoryTaskStore keeps - #441
Merged
muscariello merged 1 commit intoNov 2, 2026
Merged
Conversation
muscariello
force-pushed
the
stack/03-inmemory-task-store-limit
branch
from
November 1, 2026 21:28
1997ab7 to
f9c9296
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
InMemoryTaskStore never removed a task, and TaskStore has no delete, so a long-running agent kept every task it ever served: 20,000 tasks with a 4 KiB artifact each held 192 MiB. InMemoryTaskStore::with_terminal_task_limit(n) keeps at most n tasks in a terminal state and purges the one that reached its terminal state earliest. Tasks that are not terminal are never purged, and a purged task reads as TaskNotFoundError, which A2A 3.3.2 allows for a task that was completed and purged. new() keeps every task, as before. With a limit of 1,000 the same run stays at about 20 MiB. Fixes: #401 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: gulldan <[email protected]>
muscariello
force-pushed
the
stack/03-inmemory-task-store-limit
branch
from
November 2, 2026 12:02
f9c9296 to
161e4b1
Compare
msardara
approved these changes
Nov 2, 2026
Merged
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.
Fixes #401. Replaces #407. Stacked on #440: review only the last commit.
Cause:
InMemoryTaskStorenever removes a task andTaskStorehas no delete, so a long-running agent keeps every task it has served. #401 measured 192 MiB RSS at 20,000 tasks with one 4 KiB artifact each.Change:
InMemoryTaskStore::new().with_terminal_task_limit(n)is opt-in and keeps at mostntasks in a terminal state. Past that, the task that reached a terminal state earliest is purged. Tasks that are not terminal are never purged, a purged task reads asTaskNotFoundError, andnew()keeps everything as before.Needs a decision: unlike #439 and #440, this is a feature with new public API, so it needs a design review, not only a bug-fix review.
Unproven: the memory figures in #407 and the new tests were not run locally. CI is the check.