Skip to content

feat: add external task refs and opt-in flag#19047

Open
adrian-openai wants to merge 1 commit intodev/efrazer/agent-identity-env-jwtfrom
dev/adrian/codex/hai-task-primitives
Open

feat: add external task refs and opt-in flag#19047
adrian-openai wants to merge 1 commit intodev/efrazer/agent-identity-env-jwtfrom
dev/adrian/codex/hai-task-primitives

Conversation

@adrian-openai
Copy link
Copy Markdown
Contributor

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

Stack

This is PR 1 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-local background task helper.

Summary

The new backend contract makes task_id backend-owned and opaque. Codex should send a stable logical reference for thread-scoped work and let HAI resolve or create the task. This PR adds the small crate-level primitives needed for that shape before core/model-provider code starts using them.

What changed:

  • adds AgentTaskExternalRef for the optional task registration external_task_ref field
  • keeps external_task_ref omitted by default so old registration requests remain valid
  • keeps RegisteredAgentTask / AgentTaskKind as typed helpers around backend-owned task ids
  • preserves the existing AgentAssertion wire shape: agent_runtime_id, task_id, timestamp, and signature
  • keeps the disabled-by-default use_agent_identity experimental flag available for the later ChatGPT opt-in path

Testing

  • cargo test -p codex-agent-identity

@efrazer-oai efrazer-oai force-pushed the dev/efrazer/agent-identity-env-jwt branch from c588673 to c74a2f3 Compare April 22, 2026 23:57
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-task-primitives branch from 3254ce5 to 0324e8a Compare April 23, 2026 01:02
@adrian-openai adrian-openai changed the title feat: add agent task identity primitives feat: add agent identity primitives and opt-in flag Apr 23, 2026
@adrian-openai adrian-openai force-pushed the dev/adrian/codex/hai-task-primitives branch from 0324e8a to 2685c9e 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 requested a review from a team as a code owner 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-task-primitives branch from 2685c9e to 55dced3 Compare April 24, 2026 02:57
@adrian-openai adrian-openai changed the title feat: add agent identity primitives and opt-in flag feat: add external task refs and opt-in flag Apr 24, 2026
@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, nicksteele-oai and pakrym-oai and removed request for efrazer-oai and pakrym-oai April 24, 2026 06:08
Copy link
Copy Markdown

@nicksteele-oai nicksteele-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me

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