Skip to content

Refresh TEE configs periodically#206

Merged
adambalogh merged 11 commits intomainfrom
aba/refresh
Mar 27, 2026
Merged

Refresh TEE configs periodically#206
adambalogh merged 11 commits intomainfrom
aba/refresh

Conversation

@adambalogh
Copy link
Copy Markdown
Collaborator

@adambalogh adambalogh commented Mar 26, 2026

  • create TEEConnection class to encapsulate connection refresh
  • refresh TEE configs in background and switch to new one in case current one has been disabled

@adambalogh adambalogh marked this pull request as ready for review March 26, 2026 01:57
Copy link
Copy Markdown
Contributor

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 introduces a dedicated TEE connection abstraction that can periodically re-resolve TEE configuration from the on-chain registry, and updates the LLM client and tests to use that abstraction.

Changes:

  • Added tee_connection.py with RegistryTEEConnection (background refresh + reconnect) and StaticTEEConnection (fixed URL).
  • Refactored LLM to use the new connection layer (including a new LLM.from_url(...) constructor).
  • Added/updated tests to cover connection lifecycle, refresh behavior, and updated LLM internals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/opengradient/client/tee_connection.py New connection abstraction with reconnect + background refresh loop.
src/opengradient/client/llm.py Refactor to delegate TEE endpoint + client lifecycle to TEEConnectionInterface; adds from_url.
src/opengradient/client/tee_registry.py Makes TEEEndpoint frozen/immutable.
tests/tee_connection_test.py New test suite for connection lifecycle, reconnect, refresh loop, and close semantics.
tests/llm_test.py Updates patching and expectations to align with the new connection layer.
tests/client_test.py Updates initialization assertions to reference the new connection state.

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

balogh.adam@icloud.com added 3 commits March 26, 2026 22:02
@adambalogh adambalogh merged commit 5ad661e into main Mar 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants