fix: tighten env var surface#560
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55364b90d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } { | ||
| if (proxyBaseUrl && !proxyBearerToken) { | ||
| const resolvedProxyBearerToken = proxyBaseUrl | ||
| ? proxyBearerToken || normalizeOptionalString(env.AGENT_DEVICE_DAEMON_AUTH_TOKEN) || '' |
There was a problem hiding this comment.
Respect the Metro bearer-token env fallback
When prepareMetroRuntime/prepareRemoteMetro are used directly with proxyBaseUrl and an env containing AGENT_DEVICE_METRO_BEARER_TOKEN, this still treats proxy auth as missing because the new fallback only reads AGENT_DEVICE_DAEMON_AUTH_TOKEN. CLI flag resolution masks this for normal CLI invocations, but the exported runtime API accepts an env map and the error/docs now tell users to set AGENT_DEVICE_METRO_BEARER_TOKEN, so direct API callers following that guidance will get the incomplete-proxy-config error instead of using the token.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in efa649b40: direct prepareMetroRuntime / prepareRemoteMetro proxy auth now resolves in this order: explicit proxyBearerToken, env.AGENT_DEVICE_METRO_BEARER_TOKEN, then env.AGENT_DEVICE_DAEMON_AUTH_TOKEN. Added a focused regression test for the Metro bearer env path.
Validation: focused Metro tests passed with loopback permissions, and pnpm check:quick passed.
c1616c7 to
267403b
Compare
267403b to
0cdf338
Compare
Summary
Tightens the public env-var surface for agent-device and closes the env visibility/security cleanup from #559.
Closes #559
AGENT_DEVICE_PROXY_TOKEN.AGENT_DEVICE_DAEMON_AUTH_TOKENwhen proxy mode is enabled and no explicit Metro bearer token is provided.apkInstallCallsfrombundleInstallCalls, matching the fixeduniversalAAB install path explicitly.Touched-file count: 47. Scope expanded beyond docs into CLI/runtime cleanup because the audit found removed envs wired through source and tests.
Validation
Ran formatting, lint/typecheck, dead-code/complexity audit, focused unit tests for Metro/proxy/runtime cleanup, install-source/source safety, Android devices/install, iOS runner config, retry helpers, args/docs coverage, plus
pnpm build:xcuitestfor the Swift runner env cleanup. Final focused Vitest pass covered 12 files / 330 tests. CI fix validation:pnpm exec vitest run --project provider-integration test/integration/provider-scenarios/android-lifecycle.test.ts,pnpm format, andpnpm check:quick. The focused Vitest suite requires loopback server binding, so it was run outside the sandbox after earlier sandboxed runs hitlisten EPERM.