Skip to content

[codex] Add global instructions contributor API - #26831

Closed
anp-oai wants to merge 1 commit into
codex/global-instructions-testsfrom
codex/global-instructions-extension-api
Closed

[codex] Add global instructions contributor API#26831
anp-oai wants to merge 1 commit into
codex/global-instructions-testsfrom
codex/global-instructions-extension-api

Conversation

@anp-oai

@anp-oai anp-oai commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Why

Global instructions are currently embedded in Config, which makes them difficult for hosts to supply through the extension system and couples the source of the instructions to core configuration loading. Embedders need a small explicit extension point before the loading and lifecycle behavior can move.

What changed

  • Adds the object-safe GlobalInstructionsContributor trait.
  • Adds structured GlobalInstructions and GlobalInstruction output types, including warnings and optional absolute source paths.
  • Adds one optional contributor slot and builder method to ExtensionRegistryBuilder.
  • Reexports the new API from codex-core-api.
  • Keeps empty_extension_registry() genuinely empty; hosts must explicitly install a contributor.

This PR only introduces primitives. Core does not resolve the contributor yet.

Stack

  1. [codex] Characterize global instruction lifecycle #26830: lifecycle characterization tests
  2. [codex] Add global instructions contributor API #26831: extension API primitives
  3. [codex] Add CODEX_HOME instructions contributor #26832: CODEX_HOME contributor crate
  4. [codex] Persist structured instruction snapshots #26833: structured snapshot and history machinery
  5. [codex] Adopt global instructions contributors #26834: contributor adoption and compatibility removal

Test plan

  • just test -p codex-extension-api
  • Registry coverage verifies the contributor is optional and singular.

@anp-oai
anp-oai force-pushed the codex/global-instructions-tests branch from ea101e8 to 30038b0 Compare June 6, 2026 22:37
@anp-oai
anp-oai force-pushed the codex/global-instructions-extension-api branch 8 times, most recently from a8b37f8 to 6298c6f Compare June 7, 2026 00:37
@anp-oai
anp-oai force-pushed the codex/global-instructions-tests branch 3 times, most recently from 5f913ce to 31d0cff Compare June 8, 2026 00:36
@anp-oai
anp-oai force-pushed the codex/global-instructions-tests branch from 31d0cff to 6d65ba6 Compare June 8, 2026 03:14
@anp-oai
anp-oai force-pushed the codex/global-instructions-tests branch from 6d65ba6 to 1307637 Compare June 8, 2026 14:55
@anp-oai
anp-oai force-pushed the codex/global-instructions-extension-api branch from 6298c6f to 177060c Compare June 8, 2026 15:12
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct GlobalInstructions {
pub instructions: Vec<GlobalInstruction>,
pub warnings: Vec<String>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

need to look at whether this is a pattern elsewhere in the contributor api, maybe we should have a typed error or similar here

@anp-oai
anp-oai force-pushed the codex/global-instructions-extension-api branch from 177060c to 7809eac Compare June 8, 2026 18:26
@anp-oai anp-oai closed this Jun 8, 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.

1 participant