Skip to content

refactor(auth): resolve OAuth auth mode at config-load time#5

Open
HungKNguyen wants to merge 1 commit into
mainfrom
austin/oauth-refactoring
Open

refactor(auth): resolve OAuth auth mode at config-load time#5
HungKNguyen wants to merge 1 commit into
mainfrom
austin/oauth-refactoring

Conversation

@HungKNguyen
Copy link
Copy Markdown
Collaborator

Summary

  • Move secret value prefix detection (sk-ant-oatCLAUDE_CODE_OAUTH_TOKEN) from applyAgentAuth (sandbox-create time) into validateConfig (config-load time), so auth mode is decided once and stored on secret.envVar
  • Extract shared resolveSecretValue helper from microsandbox.ts into core/env.ts to eliminate duplication
  • Add oauthEnvVar / oauthValuePrefix fields to AgentAdapter interface so prefix detection is adapter-driven (currently Claude-only) rather than hardcoded
  • Simplify applyAgentAuth to a straight passthrough of secret.envVar — no more re-sniffing the credential prefix at runtime
  • Remove duplicate createAdapter call in execute.ts

…f sandbox-create time

Move secret.value prefix detection (sk-ant-oat → CLAUDE_CODE_OAUTH_TOKEN) from applyAgentAuth into validateConfig so auth mode is decided once during config loading. Extract shared resolveSecretValue helper into core/env.ts, simplify applyAgentAuth to a straight passthrough of secret.envVar, and add adapter-level oauthEnvVar/oauthValuePrefix fields so the detection logic is adapter-driven rather than hardcoded.
@HungKNguyen HungKNguyen requested a review from nickwinder May 18, 2026 06:37
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