Skip to content

Commit 8e784bb

Browse files
Register agent identities behind use_agent_identity (#17386)
## 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 - PR1: #17385 - add `features.use_agent_identity` - PR2: #17386 - this PR - PR3: #17387 - register agent tasks when enabled - PR4: #17388 - use `AgentAssertion` downstream when enabled ## 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.
1 parent 1dead46 commit 8e784bb

File tree

23 files changed

+1340
-26
lines changed

23 files changed

+1340
-26
lines changed

MODULE.bazel.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/Cargo.lock

Lines changed: 30 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ diffy = "0.4.2"
227227
dirs = "6"
228228
dotenvy = "0.15.7"
229229
dunce = "1.0.4"
230+
ed25519-dalek = { version = "2.2.0", features = ["pkcs8"] }
230231
encoding_rs = "0.8.35"
231232
env-flags = "0.1.1"
232233
env_logger = "0.11.9"

codex-rs/app-server/src/transport/remote_control/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ fn remote_control_auth_dot_json(account_id: Option<&str>) -> AuthDotJson {
9696
account_id: account_id.map(str::to_string),
9797
}),
9898
last_refresh: Some(chrono::Utc::now()),
99+
agent_identity: None,
99100
}
100101
}
101102

codex-rs/app-server/src/transport/remote_control/websocket.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,7 @@ mod tests {
971971
account_id: Some("account_id".to_string()),
972972
}),
973973
last_refresh: Some(Utc::now()),
974+
agent_identity: None,
974975
}
975976
}
976977

codex-rs/app-server/tests/common/auth_fixtures.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ pub fn write_chatgpt_auth(
163163
openai_api_key: None,
164164
tokens: Some(tokens),
165165
last_refresh,
166+
agent_identity: None,
166167
};
167168

168169
save_auth(codex_home, &auth, cli_auth_credentials_store_mode).context("write auth.json")

codex-rs/app-server/tests/suite/v2/app_list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ async fn list_apps_returns_empty_with_api_key_auth() -> Result<()> {
117117
openai_api_key: Some("test-api-key".to_string()),
118118
tokens: None,
119119
last_refresh: None,
120+
agent_identity: None,
120121
},
121122
AuthCredentialsStoreMode::File,
122123
)?;

codex-rs/core/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ codex_rust_crate(
5353
"//codex-rs/linux-sandbox:codex-linux-sandbox",
5454
"//codex-rs/rmcp-client:test_stdio_server",
5555
"//codex-rs/rmcp-client:test_streamable_http_server",
56+
"//codex-rs/responses-api-proxy:codex-responses-api-proxy",
5657
"//codex-rs/cli:codex",
5758
],
5859
)

codex-rs/core/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ codex-login = { workspace = true }
4141
codex-mcp = { workspace = true }
4242
codex-model-provider-info = { workspace = true }
4343
codex-models-manager = { workspace = true }
44+
ed25519-dalek = { workspace = true }
4445
codex-shell-command = { workspace = true }
4546
codex-execpolicy = { workspace = true }
4647
codex-git-utils = { workspace = true }
@@ -143,6 +144,7 @@ codex-shell-escalation = { workspace = true }
143144
[dev-dependencies]
144145
assert_cmd = { workspace = true }
145146
assert_matches = { workspace = true }
147+
codex-arg0 = { workspace = true }
146148
codex-otel = { workspace = true }
147149
codex-test-binary-support = { workspace = true }
148150
codex-utils-cargo-bin = { workspace = true }

0 commit comments

Comments
 (0)