Skip to content

refactor: make auth loading async#19762

Merged
efrazer-oai merged 1 commit intomainfrom
dev/efrazer/agent-identity-auth-async
Apr 27, 2026
Merged

refactor: make auth loading async#19762
efrazer-oai merged 1 commit intomainfrom
dev/efrazer/agent-identity-auth-async

Conversation

@efrazer-oai
Copy link
Copy Markdown
Contributor

@efrazer-oai efrazer-oai commented Apr 27, 2026

Summary

Auth loading used to expose synchronous construction helpers in several places even though some auth sources now need async work. This PR makes the auth-loading surface async and updates the callers to await it.

This is intentionally only plumbing. It does not change how AgentIdentity tokens are decoded, how task runtime ids are allocated, or how JWT signatures are verified.

Stack

  1. This PR: refactor: make auth loading async
  2. refactor: load AgentIdentity runtime eagerly
  3. feat: verify AgentIdentity JWTs with JWKS

Important call sites

Area Change
codex-login auth loading CodexAuth and AuthManager construction paths now await auth loading.
app-server startup Auth manager construction is awaited during initialization.
CLI/TUI/exec/MCP/chatgpt callers Existing auth-loading calls now await the same behavior.
cloud requirements storage loader The loader becomes async so it can share the same auth construction path.
auth tests Tests that load auth now run in async contexts.

Testing

Tests: targeted Rust auth test compilation, formatter, scoped Clippy fix, and Bazel lock check.

@efrazer-oai efrazer-oai marked this pull request as ready for review April 27, 2026 04:28
@efrazer-oai efrazer-oai requested a review from a team as a code owner April 27, 2026 04:28
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e251d8b7d7

ℹ️ 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".

let outgoing = Arc::new(OutgoingMessageSender::new(outgoing_tx));
let auth_manager =
AuthManager::shared_from_config(config.as_ref(), /*enable_codex_api_key_env*/ false);
AuthManager::shared_from_config(config.as_ref(), /*enable_codex_api_key_env*/ false).await;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make build_test_processor async before awaiting auth load

build_test_processor is still a synchronous fn, but it now calls AuthManager::shared_from_config(...).await. This triggers Rust error E0728 (await is only allowed in async functions/blocks), so the app-server test target fails to compile when tests are built.

Useful? React with 👍 / 👎.

@efrazer-oai
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

@efrazer-oai efrazer-oai force-pushed the dev/efrazer/agent-identity-auth-async branch from e251d8b to a20884a Compare April 27, 2026 04:52
@efrazer-oai efrazer-oai merged commit 2009f6e into main Apr 27, 2026
35 of 36 checks passed
@efrazer-oai efrazer-oai deleted the dev/efrazer/agent-identity-auth-async branch April 27, 2026 18:00
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants