Skip to content

Conversation

@igalshilman
Copy link
Contributor

No description provided.

@igalshilman igalshilman requested a review from Copilot January 6, 2026 15:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the ADK plugin to eliminate global state by moving plugin state management from class-level dictionaries to per-invocation context extension data. This improves thread safety and prevents state leakage between concurrent invocations.

Key changes:

  • Introduced extension data storage in ServerInvocationContext with lifecycle management
  • Replaced global _models and _turnstiles dictionaries with context-bound PluginState
  • Added automatic cleanup of extension data via auto_close_extension_data context manager

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
python/restate/server_context.py Adds extension data API (get/set/clear) and auto-cleanup context manager to ServerInvocationContext
python/restate/ext/adk/plugin.py Refactors RestatePlugin to use context extension data instead of instance-level dictionaries for state management

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Test Results

  7 files  ±0    7 suites  ±0   4m 25s ⏱️ +3s
 49 tests ±0   49 ✅ ±0  0 💤 ±0  0 ❌ ±0 
210 runs  ±0  210 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 021fd74. ± Comparison against base commit 903d148.

@igalshilman igalshilman requested a review from Copilot January 6, 2026 15:53
@igalshilman igalshilman merged commit d9109e3 into main Jan 6, 2026
6 checks passed
@igalshilman igalshilman deleted the add_ctx_ext branch January 6, 2026 16:04
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants