feat: use run agent task auth for inference - #19051
Merged
Merged
Conversation
This was referenced Apr 22, 2026
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 23, 2026 01:02
42e2d28 to
3192e48
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 23, 2026 01:02
a9a1b54 to
684fd95
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 23, 2026 03:48
3192e48 to
a4a465a
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
2 times, most recently
from
April 23, 2026 03:55
d5d5302 to
733de44
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 23, 2026 03:55
a4a465a to
92cf11e
Compare
adrian-openai
marked this pull request as ready for review
April 23, 2026 04:27
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 733de4454c
ℹ️ 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".
adrian-openai
marked this pull request as draft
April 24, 2026 00:05
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 24, 2026 02:57
92cf11e to
cfa9996
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 24, 2026 02:58
733de44 to
a9fe062
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 24, 2026 03:12
a9fe062 to
a3097aa
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 24, 2026 04:19
cfa9996 to
c4397ce
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 24, 2026 04:33
a3097aa to
c546eb2
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 24, 2026 04:37
c4397ce to
9a439a1
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 24, 2026 04:38
c546eb2 to
c99bc2a
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 24, 2026 04:47
9a439a1 to
44791c8
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 24, 2026 04:51
c99bc2a to
a9b1a6a
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 24, 2026 04:59
44791c8 to
ae79fa8
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 24, 2026 05:00
a9b1a6a to
360838e
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
April 24, 2026 05:10
ae79fa8 to
492eec5
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
April 24, 2026 05:11
360838e to
6205dfe
Compare
adrian-openai
marked this pull request as ready for review
April 24, 2026 06:07
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
June 9, 2026 19:43
ef49f07 to
f272284
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
June 9, 2026 20:05
f272284 to
264cc9f
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
June 9, 2026 20:05
a07016b to
70afafb
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
June 9, 2026 20:35
264cc9f to
efa1c37
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
2 times, most recently
from
June 9, 2026 21:01
0e340c9 to
d8a54ed
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
2 times, most recently
from
June 9, 2026 23:37
838c8d8 to
9d1b23d
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
June 9, 2026 23:37
d8a54ed to
2cc6695
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
June 9, 2026 23:38
9d1b23d to
892e12c
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
June 9, 2026 23:38
2cc6695 to
76f7f2b
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-thread-inference-auth
branch
from
June 10, 2026 01:36
892e12c to
c024f87
Compare
adrian-openai
force-pushed
the
dev/adrian/codex/hai-session-task-state
branch
from
June 10, 2026 01:36
76f7f2b to
82ac2e2
Compare
adrian-openai
commented
Jun 10, 2026
adrian-openai
commented
Jun 10, 2026
adrian-openai
commented
Jun 10, 2026
adrian-openai
commented
Jun 10, 2026
Zemnmez
approved these changes
Jun 10, 2026
nicksteele-oai
approved these changes
Jun 18, 2026
celia-oai
reviewed
Jun 24, 2026
celia-oai
reviewed
Jun 25, 2026
celia-oai
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
This is PR 3 of the simplified HAI single-run-task stack:
#19054 collapsed out of the active stack because the simplified design no longer needs a separate background/control-plane task helper.
Summary
This PR moves Agent Identity usage into provider auth resolution. That keeps
AgentAssertionauth tied to first-party OpenAI provider requests instead of applying a late session-wide override that could affect local, custom, Bedrock, API-key, or external-bearer providers.What changed:
ProviderAuthScopestruct carrying the run auth policy and session source needed by provider-scoped auth resolutionSessionopt the existingModelClientintoChatGptAuthpolicy whenuse_agent_identityis enabled, without adding a second model-client constructorAgentIdentityAuthrecord to buildAgentAssertionauth for Responses requestsThis PR intentionally does not create thread-scoped, target-scoped, or background-scoped task identities. The run task is the only task Codex registers in this POC shape.
Testing
just test -p codex-model-providerjust test -p codex-core client::tests::provider_auth_scope_usesjust test -p codex-core remote_compact_uses_agent_identity_assertion