fix(agentserver): partition in-memory response state by user - #49025
Open
Shanmukha Pasumarthy (shanmukha1200) wants to merge 2 commits into
Open
Shanmukha Pasumarthy (shanmukha1200) wants to merge 2 commits into
Shanmukha Pasumarthy (shanmukha1200) wants to merge 2 commits into
Conversation
Scope response, item, history, and legacy execution state by the trusted platform user key. Preserve unkeyed local use in a separate anonymous partition and cover caller isolation, collisions, and cleanup. Authored-by: GitHub Copilot CLI 1.0.81-0 Model: GPT-6 Astra (gpt-6-astra) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e8471c6-fef7-46a5-9b42-d9e87f236721
Shanmukha Pasumarthy (shanmukha1200)
force-pushed
the
users/spasumarthy/memory-response-partitions
branch
from
September 16, 2026 13:18
ae76901 to
1aa8578
Compare
Shanmukha Pasumarthy (shanmukha1200)
marked this pull request as ready for review
September 16, 2026 16:18
|
Azure Pipelines: Successfully started running 1 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Shanmukha Pasumarthy (shanmukha1200)
September 16, 2026 16:19
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The modified API snapshot’s committed metadata hash is stale and must be regenerated.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Partitions in-memory response state by platform user identity to prevent cross-user access.
Changes:
- Adds user-scoped storage keys across responses, items, history, and legacy state.
- Adds isolation tests for CRUD, eviction, replay, expiration, and anonymous users.
- Updates public API documentation and release notes.
File summaries
| File | Description |
|---|---|
store/_memory.py |
Implements user-partitioned storage. |
store/_base.py |
Clarifies provider isolation requirements. |
test_in_memory_provider_crud.py |
Tests partitioned provider behavior. |
test_user_isolation_enforcement.py |
Tests host isolation around eviction. |
README.md |
Documents identity partitioning. |
CHANGELOG.md |
Records the security fix. |
api.md |
Adds context parameters to the API snapshot. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+278
to
+279
| ttl_seconds: int | None = ..., | ||
| context: PlatformContext | None = ... |
Shiva S (Shivakishore14)
approved these changes
Sep 16, 2026
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
InMemoryResponseProviderresponse envelopes, items, history, conversation indexes, and legacy execution/replay state by the exactPlatformContext.user_id_key.PlatformContext.The provider relies on trusted platform context; it does not authenticate callers or interpret
call_id. Runtime authorization and the process-wide SSE stream registry are unchanged.Security impact
Previously,
InMemoryResponseProvideraccepted platform context but indexed response, item, and conversation state only by resource ID. When a provider instance served multiple users, its storage layer did not enforce per-user isolation: a caller able to reach a provider-backed operation with another user's identifier could read or modify that user's stored state, subject to any upstream authorization checks.This change keys provider-owned state by both the trusted platform user key and the resource ID, including lookups, mutations, history resolution, and legacy execution/replay helpers. Missing identity selects a separate anonymous partition rather than bypassing isolation.
This is a storage-layer fix, not authentication or a claim of a demonstrated production exploit. Hosts must establish trustworthy platform context. Runtime authorization and the separate process-wide SSE stream registry are not changed by this PR.
Validation
main.git diff --checkis clean.Authored-by: GitHub Copilot CLI 1.0.81-0
Model: GPT-6 Astra (gpt-6-astra)