fix(acp): defer authentication until required - #924
Conversation
Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da1702e487
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| AuthMethod::EnvVar(method) => method.vars.iter().all(|var| { | ||
| var.optional || std::env::var_os(&var.name).is_some_and(|value| !value.is_empty()) | ||
| }), |
There was a problem hiding this comment.
Check credentials in the agent process environment
When an ACP agent requires an EnvVar method and its credential exists only in the captured working-directory shell environment, this checks the Staged process's std::env instead of the environment actually supplied to the agent via env_snapshot. This is common for GUI launches where API keys are loaded by shell initialization, and causes select_auth_method to reject a valid method after AuthRequired, preventing session creation even though the running agent received the credential. Pass the effective child environment into selection or let the agent validate the method.
Useful? React with 👍 / 👎.
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Summary
AuthRequiredTests