Skip to content

[codex] Adopt global instructions contributors - #26834

Closed
anp-oai wants to merge 4 commits into
codex/global-instructions-snapshotsfrom
codex/global-instructions-adoption
Closed

[codex] Adopt global instructions contributors#26834
anp-oai wants to merge 4 commits into
codex/global-instructions-snapshotsfrom
codex/global-instructions-adoption

Conversation

@anp-oai

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

Copy link
Copy Markdown
Contributor

Why

With the extension API, CODEX_HOME contributor, and durable snapshot semantics in place, core can stop owning global instruction loading through Config. Completing the migration makes freshness points explicit, lets hosts choose their contributor, and prevents history-sharing thread creation from unexpectedly re-resolving instructions.

What changed

  • Resolves GlobalInstructionsContributor for fresh-history creation and full-context rebuilding.
  • Does not resolve during ordinary turns, cold or running resume, user or extension forks, or history-sharing subagents.
  • Retains the previous snapshot and emits EventMsg::Warning when a compaction refresh fails.
  • Surfaces successful contributor warnings through startup and runtime warning reporting.
  • Registers CodexHomeInstructionsContributor in app-server, MCP server, prompt-debug, and the thread-manager sample.
  • Loads global instructions even when no execution environment is selected.
  • Updates stateful integration tests for freshness, failure, compaction, resume, fork, and source reporting semantics.
  • Removes guardian reuse-key handling tied to configured user instructions.

Breaking changes

  • Removes Config.user_instructions.
  • Removes the public LoadedAgentsMd configuration and testing escape hatch.
  • Embedders that want CODEX_HOME instructions must install CodexHomeInstructionsContributor in their extension registry.

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
  • just test -p codex-home
  • Core global instruction lifecycle, composition, reconstruction, fork, and compaction tests
  • Local, legacy remote, and remote-v2 compaction parity
  • App-server start and fork instructionSources tests
  • MCP and prompt-debug integration tests
  • just test -p codex-protocol -p codex-state -p codex-rollout
  • just bazel-lock-check

@anp-oai
anp-oai force-pushed the codex/global-instructions-adoption branch from 88f4111 to 137a907 Compare June 6, 2026 22:40
@anp-oai
anp-oai force-pushed the codex/global-instructions-snapshots branch from 6dae8e0 to 33ae45b Compare June 6, 2026 22:42
@anp-oai
anp-oai force-pushed the codex/global-instructions-adoption branch from 137a907 to dd786f1 Compare June 6, 2026 22:44
@anp-oai
anp-oai force-pushed the codex/global-instructions-snapshots branch 7 times, most recently from c7d7742 to 1b4f2bf Compare June 7, 2026 00:41
@anp-oai
anp-oai force-pushed the codex/global-instructions-snapshots branch from 1b4f2bf to c3a04a9 Compare June 8, 2026 15:46
@anp-oai
anp-oai force-pushed the codex/global-instructions-adoption branch from dd786f1 to 801d563 Compare June 8, 2026 16:25
anp-oai added a commit that referenced this pull request Jun 8, 2026
@anp-oai
anp-oai force-pushed the codex/global-instructions-adoption branch from 801d563 to 77bd16f Compare June 8, 2026 17:02
@anp-oai
anp-oai force-pushed the codex/global-instructions-snapshots branch from 5df5f8b to 4c16e36 Compare June 8, 2026 19:06
@anp-oai
anp-oai force-pushed the codex/global-instructions-adoption branch from 77bd16f to a64a858 Compare June 8, 2026 19:25
@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