Skip to content

feat: add hidden background agent auth provider#19054

Open
adrian-openai wants to merge 1 commit intodev/adrian/codex/hai-thread-inference-authfrom
dev/adrian/codex/hai-background-task-auth
Open

feat: add hidden background agent auth provider#19054
adrian-openai wants to merge 1 commit intodev/adrian/codex/hai-thread-inference-authfrom
dev/adrian/codex/hai-background-task-auth

Conversation

@adrian-openai
Copy link
Copy Markdown
Contributor

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

Stack

This is PR 4 of the HAI external-task-ref stack:

  • #19047 Task registration primitives: add typed task/runtime ids, task kinds, optional external_task_ref, and the use_agent_identity experimental flag.
  • #19049 ChatGPT runtime opt-in: let flagged ChatGPT auth provision/reuse Agent Identity runtime auth while JWT mode stays unchanged.
  • #19051 Provider-scoped thread auth: resolve first-party inference auth with ThreadId as external_task_ref and use task AgentAssertions.
  • #19054 Background auth bridge: keep sessionless control-plane Agent Identity auth hidden behind a process-task-backed provider helper.

Summary

This PR keeps the temporary background/control-plane auth bridge, but hides it inside auth-provider resolution. Sessionless control-plane callers can ask for Agent Identity auth without seeing task ids, while Codex still avoids adding any background task ids to rollout state, auth-file state, or caller-visible plumbing.

What changed:

  • exposes background/control-plane auth through provider helpers rather than raw task ids
  • reuses the existing process task for Agent Identity background auth instead of registering a separate Background task
  • keeps background auth sessionless by not sending external_task_ref
  • preserves account and FedRAMP routing headers on task-scoped AgentAssertion providers
  • preserves existing bearer/API-key behavior for non-AgentIdentity auth

This intentionally does not migrate broad backend/control-plane callsites yet; that should be a separate semantic slice once this helper shape lands.

Testing

  • cargo test -p codex-login
  • cargo test -p codex-model-provider
  • just fix -p codex-login
  • just fix -p codex-model-provider

@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from a9a1b54 to 684fd95 Compare April 23, 2026 01:02
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from abd88cf to 58ac2b5 Compare April 23, 2026 01:02
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from 684fd95 to d5d5302 Compare April 23, 2026 03:48
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from 58ac2b5 to 1902e47 Compare April 23, 2026 03:48
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from d5d5302 to 733de44 Compare April 23, 2026 03:55
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from 1902e47 to 7d2f1cc Compare April 23, 2026 03:55
@adrian-openai adrian-openai marked this pull request as ready for review April 23, 2026 04:27
@adrian-openai adrian-openai marked this pull request as draft April 24, 2026 00:05
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from 733de44 to a9fe062 Compare April 24, 2026 02:58
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from 7d2f1cc to 8deff2e Compare April 24, 2026 02:58
@adrian-openai adrian-openai changed the title feat: add background agent task auth feat: add hidden background agent auth Apr 24, 2026
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from a9fe062 to a3097aa Compare April 24, 2026 03:12
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from 8deff2e to 6a19639 Compare April 24, 2026 03:12
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch 2 times, most recently from c546eb2 to c99bc2a Compare April 24, 2026 04:38
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from 6a19639 to ac45ce5 Compare April 24, 2026 04:44
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from c99bc2a to a9b1a6a Compare April 24, 2026 04:51
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from ac45ce5 to 10a4b1f Compare April 24, 2026 04:55
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from a9b1a6a to 360838e Compare April 24, 2026 05:00
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from 10a4b1f to ee7ff88 Compare April 24, 2026 05:01
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-thread-inference-auth branch from 360838e to 6205dfe Compare April 24, 2026 05:11
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from ee7ff88 to 5a71f9b Compare April 24, 2026 05:11
@adrian-openai adrian-openai marked this pull request as ready for review April 24, 2026 06:07
@adrian-openai adrian-openai requested review from efrazer-oai and pakrym-oai and removed request for efrazer-oai and pakrym-oai April 24, 2026 06:08
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.

Any reason to add 'Background' when we already have 'Process'? They seem to do ~the same thing, might be able to cut out a few additions.

@adrian-openai
Copy link
Copy Markdown
Contributor Author

Any reason to add 'Background' when we already have 'Process'? They seem to do ~the same thing, might be able to cut out a few additions.

Good catch @efrazer-oai - let me update this!

@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-background-task-auth branch from 5a71f9b to 2fefd43 Compare April 24, 2026 17:12
@adrian-openai adrian-openai changed the title feat: add hidden background agent auth feat: add hidden background agent auth provider Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants