feat: use run agent task auth for inference#19051
Conversation
42e2d28 to
3192e48
Compare
a9a1b54 to
684fd95
Compare
3192e48 to
a4a465a
Compare
d5d5302 to
733de44
Compare
a4a465a to
92cf11e
Compare
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".
| self.current_client_setup_with_agent_task(/*agent_task_auth*/ None) | ||
| .await |
There was a problem hiding this comment.
Pass thread task auth to compact Responses calls
ModelClient::current_client_setup always forwards agent_task_auth as None. compact_conversation_history (and other unary Responses paths) use this helper, so they never attach the thread-scoped AgentAssertion introduced for inference turns. In Agent Identity mode, compaction can run under bearer/process auth instead of the active thread task, which breaks the stated migration intent.
Useful? React with 👍 / 👎.
92cf11e to
cfa9996
Compare
733de44 to
a9fe062
Compare
a9fe062 to
a3097aa
Compare
cfa9996 to
c4397ce
Compare
a3097aa to
c546eb2
Compare
c4397ce to
9a439a1
Compare
c546eb2 to
c99bc2a
Compare
9a439a1 to
44791c8
Compare
c99bc2a to
a9b1a6a
Compare
44791c8 to
ae79fa8
Compare
a9b1a6a to
360838e
Compare
ae79fa8 to
492eec5
Compare
360838e to
6205dfe
Compare
1c87e10 to
aad6646
Compare
e8f2da8 to
9809fae
Compare
aad6646 to
d4cbe77
Compare
9809fae to
ede0da1
Compare
d4cbe77 to
6ffcd6e
Compare
ede0da1 to
1a9875e
Compare
6ffcd6e to
228cb99
Compare
228cb99 to
994dfd3
Compare
1a9875e to
ef49f07
Compare
994dfd3 to
a07016b
Compare
ef49f07 to
f272284
Compare
f272284 to
264cc9f
Compare
a07016b to
70afafb
Compare
264cc9f to
efa1c37
Compare
0e340c9 to
d8a54ed
Compare
838c8d8 to
9d1b23d
Compare
d8a54ed to
2cc6695
Compare
9d1b23d to
892e12c
Compare
2cc6695 to
76f7f2b
Compare
892e12c to
c024f87
Compare
76f7f2b to
82ac2e2
Compare
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