Skip to content

Register agent identities behind use_agent_identity#17386

Merged
adrian-openai merged 14 commits intomainfrom
dev/adrian/codex/agent-identity-register-agent
Apr 15, 2026
Merged

Register agent identities behind use_agent_identity#17386
adrian-openai merged 14 commits intomainfrom
dev/adrian/codex/agent-identity-register-agent

Conversation

@adrian-openai
Copy link
Copy Markdown
Contributor

@adrian-openai adrian-openai commented Apr 10, 2026

Summary

Stack PR 2 of 4 for feature-gated agent identity support.

This PR adds agent identity registration behind features.use_agent_identity. It keeps the app-server protocol unchanged and starts registration after ChatGPT auth exists rather than requiring a client restart.

Stack

Validation

Covered as part of the local stack validation pass:

  • just fmt
  • cargo test -p codex-core --lib agent_identity
  • cargo test -p codex-core --lib agent_assertion
  • cargo test -p codex-core --lib websocket_agent_task
  • cargo test -p codex-api api_bridge
  • cargo build -p codex-cli --bin codex

Notes

The full local app-server E2E path is still being debugged after PR creation. The current branch stack is directionally ready for review while that follow-up continues.

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: cd2ed352e6

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

Comment thread codex-rs/core/src/config/mod.rs Outdated
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-register-agent branch from cd2ed35 to 7587c88 Compare April 10, 2026 23:49
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-flag branch from d58ac15 to 9bbc1e8 Compare April 11, 2026 00:10
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-register-agent branch 2 times, most recently from 6687bb9 to fb82a31 Compare April 11, 2026 01:02
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-flag branch from 6a1a18b to 636678c Compare April 11, 2026 01:16
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-register-agent branch from fb82a31 to bbeb95e Compare April 11, 2026 01:17
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-flag branch from 636678c to 87397ee Compare April 11, 2026 06:43
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-register-agent branch from bbeb95e to 5735241 Compare April 11, 2026 06:43
Base automatically changed from dev/adrian/codex/agent-identity-flag to main April 11, 2026 16:52
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-register-agent branch from 5735241 to 458a631 Compare April 11, 2026 16:53
Comment thread codex-rs/config/src/config_toml.rs Outdated
Comment thread codex-rs/core/src/agent_identity.rs
Copy link
Copy Markdown
Contributor

@efrazer-oai efrazer-oai left a comment

Choose a reason for hiding this comment

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

I've been looking through the stack and I'm increasingly wondering about the following:

I wonder if this would be better organized by moving this core logic into

enum CodexAuth {
ApiKey(ApiKeyAuth),
Chatgpt(ChatgptAuth),
ChatgptAuthTokens(ChatgptAuthTokens),
}

It seems like it is a kinda 'different' method of auth and is intended to fully migrate away from Chatgpt auth as it exists right now when enabled (insomuch as it replaces every authorization header).

It's a bit weird to reason about a 'ChatGPT' user also being an agent identity (or using agent identity), then having these kinda 'subtle' overrides and all of this being managed in a separate auth struct.

We'll also need to add this variant later when we allow starting from a preregistered agent identity, so might be good to do now.

Comment thread codex-rs/core/Cargo.toml Outdated
@efrazer-oai
Copy link
Copy Markdown
Contributor

@codex review

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: 5589186a8e

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

Comment thread codex-rs/core/src/agent_identity.rs Outdated
Comment thread codex-rs/core/src/agent_identity.rs
Copy link
Copy Markdown
Contributor

@efrazer-oai efrazer-oai left a comment

Choose a reason for hiding this comment

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

Approved to unblock, tests & one nit if you have time!

@shijie-oai shijie-oai requested a review from jif-oai April 14, 2026 01:09
Comment thread codex-rs/login/src/auth/manager.rs
Copy link
Copy Markdown
Collaborator

@shijie-oai shijie-oai left a comment

Choose a reason for hiding this comment

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

LGTM - I am building this locally to make sure it does function as expected.

@shijie-oai
Copy link
Copy Markdown
Collaborator

Built and existing flow works as expected.

@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-register-agent branch from 616d25c to 2fb2fc2 Compare April 15, 2026 02:15
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/agent-identity-register-agent branch from 5c0a4ec to 9b2c16f Compare April 15, 2026 14:55
@adrian-openai adrian-openai merged commit 8e784bb into main Apr 15, 2026
38 of 39 checks passed
@adrian-openai adrian-openai deleted the dev/adrian/codex/agent-identity-register-agent branch April 15, 2026 17:08
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 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.

3 participants