Extend /health diagnostics#68
Merged
adambalogh merged 6 commits intomainfrom May 5, 2026
Merged
Conversation
Returning only "Request processing failed" makes debugging in the TEE nearly impossible since stack traces never leave the enclave. Including the exception class name (e.g. ValueError, APIStatusError) is safe — class names don't carry secrets — and is enough to distinguish missing-key errors from upstream provider rejections without further deploy cycles. https://claude.ai/code/session_01GGxcgU3UpPto6cq2AgEjkL
Adds providers (initialized API key list), keys_initialized, facilitator_url, tee_id/wallet_address, heartbeat status, uptime_seconds, and reads version from package metadata instead of a hardcoded string. Lets operators verify key injection and core wiring with a single curl, without redeploying. None of the new fields contain secrets — provider names and on-chain identifiers are all already publicly observable. https://claude.ai/code/session_01GGxcgU3UpPto6cq2AgEjkL
The inline dict-comprehension in health() paired each name with its key value and then filtered/yielded only the name — correct, but easy to misread as something that could leak the key. Replace with ProviderConfig.initialized_providers(), which derives the list from dataclass fields by stripping the documented '_api_key' suffix. Adding a new provider field now auto-appears in /health without anyone having to remember to update a parallel list.
e50b00c to
b18632f
Compare
providers list already conveys initialization state (empty = not initialized), and tee_id/wallet_address are already exposed via /signing-key.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the TEE gateway’s /health diagnostics so operators can inspect more runtime state without redeploying, mainly around initialized providers, facilitator/heartbeat status, uptime, and reported version.
Changes:
- Added a
ProviderConfig.initialized_providers()helper to derive which provider keys are configured. - Extended
/healthto include provider list, facilitator URL, heartbeat details, uptime, and a dynamically resolved version. - Tracked process start time and the active facilitator URL in the main server module to support the new health payload.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
tee_gateway/config.py |
Adds a helper to enumerate configured providers from injected API keys. |
tee_gateway/__main__.py |
Extends /health output and introduces version/uptime/facilitator tracking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+124
to
+128
| def _gateway_version() -> str: | ||
| try: | ||
| return pkg_version("tee-gateway") | ||
| except PackageNotFoundError: | ||
| return "unknown" |
Already exposed via /heartbeat/status.
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
Small change to make TEE-side debugging tractable without redeploying.
/healthwithproviders(initialized API-key list),keys_initialized,facilitator_url,tee_id/wallet_address, heartbeat status,uptime_seconds, and a real version pulled from package metadata instead of the hardcoded"1.0.0". None of these are secret — provider names and on-chain identifiers are already publicly observable from request behavior.