Skip to content

Secrets#272

Merged
hmahmood24 merged 5 commits into
stagingfrom
secrets
May 11, 2026
Merged

Secrets#272
hmahmood24 merged 5 commits into
stagingfrom
secrets

Conversation

@hmahmood24
Copy link
Copy Markdown
Member

No description provided.

Introduce a runtime-owned OAuth helper for refresh-token backed providers instead of putting provider-specific token semantics on SecretManager. The helper owns provider metadata, aliases, expiry checks, env overlay construction, and the actor-facing get_oauth_access_token(...) documentation surface.

This gives generated Python a clear way to request an explicit provider-scoped access token when an SDK or HTTP client requires one, while preserving the normal environment-based credential path for SDKs that can read credentials directly.
Keep SecretManager focused on mirroring allowlisted runtime OAuth secrets from Orchestra into local Secrets, .env, and os.environ, while keeping OAuth provider semantics in the runtime helper. The sync path now has a single debounced gate so frequent runtime callers can ask for freshness without forcing a network round trip on every operation.

Assistant update events and secret inspection still force sync because those paths represent explicit freshness boundaries. Normal runtime execution can use the same gate with a TTL, which keeps credentials reasonably current without making every actor step pay the full Orchestra sync cost.
Route in-process Python, venv-backed Python, persistent shell sessions, and runtime RPC through the OAuth runtime helper. The execute_code boundary now asks the debounced secret sync gate for freshness, and long-lived subprocesses receive OAuth env overlays so SDK/default-env credential paths do not keep stale inherited values.

Explicit get_oauth_access_token(...) calls in venv and shell route back to the parent runtime, which keeps token freshness checks centralized instead of trusting child process environment snapshots. The actor integration test covers Microsoft and Google in the same sandbox to prevent accidental global-token behavior.
Expose the runtime OAuth helper in the CodeAct prompt using the same signature-and-docstring pattern as reason(...). The guidance distinguishes SDK/default environment behavior from cases that require an explicit access token, and warns against printing, logging, storing, or baking concrete token values into reusable functions or guidance.

The prompt test locks in the exact helper signature, multi-provider examples, and anti-pattern guidance so future prompt edits do not accidentally regress the actor's understanding of refreshed OAuth credentials.
@hmahmood24 hmahmood24 merged commit b42b9a2 into staging May 11, 2026
13 checks passed
@hmahmood24 hmahmood24 deleted the secrets branch May 11, 2026 09:04
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.

1 participant