Skip to content

Codex CLI 0.34.0 ignores global preamble_path/instructions in interactive sessions; only repo-local AGENTS.md is honored #3540

Closed as not planned

Description

@kstueve1

Summary

  • Interactive Codex sessions do not load a global preamble from config or env. Only repo-local AGENTS.md is injected, which makes it impractical to enforce a single global policy across many repos.

Environment

  • Codex CLI: 0.34.0 (Homebrew), /opt/homebrew/bin/codex
  • macOS
  • Config: ~/.codex/config.toml with profile defaulted; preamble_path="/Users/Kevin.Stueve/gitrepositories/AGENTS.md"
  • Env: AGENTS_POLICY_HINT=/Users/Kevin.Stueve/gitrepositories/AGENTS.md
  • AGENTS.md sha256: c878c07901fcdd177dd9620edd737b49738024d63a72835b862b49128f87e7ed

Repro

  1. Ensure no repo-local AGENTS.md.
  2. Run codex in any repo.
  3. Send proof:42.

Expected

  • Preamble applied (optionally bannered); reply “AGENTS OK”.

Actual

  • No preamble is applied; reply is not “AGENTS OK”.
  • Adding a repo-local AGENTS.md does enforce the rules, confirming global injection is ignored.

What doesn’t work

  • preamble_path in ~/.codex/config.toml
  • ~/.codex/instructions.md
  • AGENTS_POLICY_HINT environment variable

Workaround that does work (partial)

  • Inject at launch: -c initial_messages=[{\"role\":\"system\",\"content\":\"<AGENTS.md content>\"}]
  • This allows textual routines like “proof:42” to work but does not trigger AGENTS on_start/rules/tool gating.

Request

  • Honor preamble_path (and/or ~/.codex/instructions.md) for all interactive session types (codex, exec, proto).
  • Respect AGENTS_POLICY_HINT as a fallback.
  • Add --preamble-path <file> flag to override per-run.
  • Avoid double-injection on resume.

Acceptance criteria

  • With only preamble_path set (no repo-local AGENTS.md), new interactive session injects the global preamble and “proof:42” yields exactly “AGENTS OK”.
  • Resume/continue doesn’t inject twice.
  • Parity across codex, codex exec, and codex proto.

Happy to test a pre-release that implements this and confirm with the “AGENTS OK” check.

Activity

  1. pakrym-oai commented on Sep 13, 2025

    @pakrym-oai
    Contributor

    Neither preamble_path nor AGENTS_POLICY_HINT are supported by codex.

  2. kstueve1 commented on Sep 15, 2025

    @kstueve1
    Author

    and that is the problem. With 70 + java repositories, a common global Agents.md that defines mvn, git, and java markdown is essential. No copying a file into 70 repos or symlinking a file into 70 repos is not a viable answer

  3. etraut-openai commented on Nov 9, 2025

    @etraut-openai
    Contributor

    Closing this because it's not a bug. I think the feature request is already covered by #3853.

  4. added
    contextIssues related to context management (including compaction)
    on Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontextIssues related to context management (including compaction)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions