Skip to content

Extend /health diagnostics#68

Merged
adambalogh merged 6 commits intomainfrom
claude/fix-tee-payment-error-gMSHh
May 5, 2026
Merged

Extend /health diagnostics#68
adambalogh merged 6 commits intomainfrom
claude/fix-tee-payment-error-gMSHh

Conversation

@adambalogh
Copy link
Copy Markdown
Contributor

@adambalogh adambalogh commented May 5, 2026

Summary

Small change to make TEE-side debugging tractable without redeploying.

  • Extend /health with providers (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.

claude and others added 4 commits May 5, 2026 19:44
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.
@adambalogh adambalogh force-pushed the claude/fix-tee-payment-error-gMSHh branch from e50b00c to b18632f Compare May 5, 2026 19:55
providers list already conveys initialization state (empty = not initialized),
and tee_id/wallet_address are already exposed via /signing-key.
@adambalogh adambalogh requested a review from Copilot May 5, 2026 19:58
@adambalogh adambalogh changed the title Surface exception type in errors and extend /health diagnostics Extend /health diagnostics May 5, 2026
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 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 /health to 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 thread tee_gateway/__main__.py
Comment on lines +124 to +128
def _gateway_version() -> str:
try:
return pkg_version("tee-gateway")
except PackageNotFoundError:
return "unknown"
Comment thread tee_gateway/__main__.py
Comment thread tee_gateway/__main__.py
Comment thread tee_gateway/config.py
Comment thread tee_gateway/__main__.py
Comment thread tee_gateway/__main__.py Outdated
Already exposed via /heartbeat/status.
@adambalogh adambalogh merged commit ecf90da into main May 5, 2026
8 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.

3 participants