[codex] Use AgentAssertion downstream behind use_agent_identity#17980
Conversation
efrazer-oai
left a comment
There was a problem hiding this comment.
I had Codex go find all the places that are still hardcoded to use Bearer as discussed on Slack, here are the results:
As it stands, we have successfully migrated the shared Responses HTTP, Responses websocket, compact, and ChatGPT-backend realtime-call paths.
But there are still several other backend surfaces that build Authorization: Bearer ... directly or go through helpers that only understand bearer tokens. Those still need to migrate if we want this change to be exhaustive.
Shared backend client paths that still need the new auth shape:
codex-rs/backend-client/src/client.rs/wham/usage/wham/tasks/list/wham/tasks/{id}/wham/tasks/{id}/turns/{turn_id}/sibling_turns/wham/config/requirementsPOST /wham/tasks
Current callers of that shared client include:
codex-rs/cloud-requirements/src/lib.rscodex-rs/app-server/src/codex_message_processor.rscodex-rs/cloud-tasks-client/src/http.rs
Direct backend callers that still attach bearer auth themselves:
codex-rs/codex-api/src/files.rs/files/files/{id}/uploaded
codex-rs/core/src/mcp_openai_file.rscodex-rs/models-manager/src/manager.rs/codex/models
codex-rs/codex-mcp/src/mcp/mod.rs.../wham/apps
codex-rs/chatgpt/src/chatgpt_client.rs- shared GET helper used by:
codex-rs/chatgpt/src/get_task.rs- connector directory loading paths
- shared GET helper used by:
codex-rs/core/src/connectors.rs- connector directory requests
codex-rs/core/src/plugins/remote.rs/plugins/list/plugins/featured/plugins/{id}/enable/plugins/{id}/uninstall
codex-rs/core-skills/src/remote.rs/hazelnuts/hazelnuts/{skill_id}/export
codex-rs/analytics/src/client.rs/codex/analytics-events/events
codex-rs/core/src/arc_monitor.rs/codex/safety/arc
codex-rs/app-server/src/transport/remote_control/enroll.rs/wham/remote/control/server/enroll
codex-rs/app-server/src/transport/remote_control/websocket.rs- websocket handshake for
/wham/remote/control/server
- websocket handshake for
codex-rs/cloud-tasks/src/util.rscodex-rs/cloud-tasks/src/env_detect.rs/wham/environments/wham/environments/by-repo/...
One backend hit I found that does not look like part of this auth migration is:
codex-rs/core/src/plugins/startup_sync.rs- backup archive fetch at
/backend-api/plugins/export/curated
- backup archive fetch at
So the main point is: this PR fixes the shared model path, but it does not yet migrate all of the places where we talk to codex-backend.
ed316a9 to
d1373d4
Compare
d1373d4 to
dfd9aa0
Compare
dfd9aa0 to
688aad3
Compare
Summary
This is the AgentAssertion downstream slice for feature-gated agent identity support, replacing the oversized AgentAssertion slice from PR #17807.
It isolates downstream AgentAssertion wiring on top of PR3.1 (
dev/adrian/codex/agent-task-state-prewarm) without re-carrying the earlier agent registration, task registration, or task-state history.Stack
features.use_agent_identityAgentAssertiondownstream when enabledWhat Changed
codex-coreCoreAuthProviderso non-bearer authorization schemes can be passed through cleanlyWhy
The original PR had drifted ancestry and showed a much larger diff than the semantic change actually required. Restacking it onto PR3.1 keeps the reviewable surface down to the downstream assertion slice.
Validation
just fmtcargo test -p codex-api core_auth_providercargo test -p codex-core --lib authorization_header_for_taskcargo test -p codex-core --lib client::tests::responses_http_uses_agent_assertion_when_agent_task_is_presentcargo test -p codex-core websocket_agent_task_bypasses_cached_bearer_prewarm