fix(codexcli): fold non-root rules into root AGENTS.md instead of inert .codex/memories - #1979
Merged
dyoshikawa merged 1 commit intoJun 22, 2026
Conversation
…rt .codex/memories Codex CLI loads instructions only from the AGENTS.md family (root + hierarchical directory walk). It does NOT scan .codex/memories/ for instruction files — that directory is Codex's separate SQLite-backed auto-memory system. Non-root rules written there were silently ignored. Fix: add foldsNonRootIntoRoot: true to the codexcli rule factory entry and remove the nonRoot path from CodexcliRule.getSettablePaths(), so non-root rule bodies are concatenated into the single root AGENTS.md by the RulesProcessor — same pattern as grokcli, warp, and deepagents. - Rewrite codexcli-rule.ts following the grokcli/warp pattern (root-only settable paths, both root and non-root rules target ./AGENTS.md) - Change ruleDiscoveryMode from 'toon' to 'auto' (no inert TOON refs) - Update codexcli-rule.test.ts: 41 tests updated for folding behavior - Update gitignore tests: .codex/memories/ no longer generated - Regenerate .gitignore (drops **/.codex/memories/) Closes #1765
Owner
|
@dyoshikawa-claw Thank you! |
dyoshikawa
deleted the
resolve-issue-1765-codexcli-fold-nonroot-into-root
branch
June 22, 2026 05:40
This was referenced Jun 22, 2026
dyoshikawa
added a commit
that referenced
this pull request
Jun 23, 2026
…try (#2009) Follow-up to #1979 (#1980 #1): after codexcli stopped emitting inert .codex/memories/ files (non-root rules now fold into root AGENTS.md), a **/.codex/memories/ line was left orphaned in the user-maintained zone of .gitignore, above the '# Generated by Rulesync' header. rulesync no longer references that directory, so the entry is dead cruft and pnpm dev gitignore neither emits nor strips it. Remove it. Closes #1980 Co-authored-by: dyoshikawa <yoshikawa.daio@classmethod.jp> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rudironsoni
pushed a commit
to rudironsoni/rulesync
that referenced
this pull request
Jun 23, 2026
PR dyoshikawa#1979 changed codexcli to fold non-root rules into the root AGENTS.md and stopped writing the inert .codex/memories/ tree, but the e2e-rules case added in dyoshikawa#1978 ('should pass check for a non-owning target when another target owns AGENTS.md') still asserted .codex/memories/detail.md existed. The mismatch left main's E2E suite red. Update the assertions to the current behavior: the non-root 'Detail Rule' body is emitted by the owning target (antigravity-ide) under .agents/rules/, and codexcli no longer creates .codex/memories/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codex CLI loads instructions only from the
AGENTS.mdfamily (root + hierarchical directory walk per the official docs). It does NOT scan.codex/memories/for instruction files — that directory is Codex's separate SQLite-backed auto-memory system. Non-root rules written there were silently ignored.Fix
Add
foldsNonRootIntoRoot: trueto the codexcli rule factory entry and remove thenonRootpath fromCodexcliRule.getSettablePaths(), so non-root rule bodies are concatenated into the single rootAGENTS.mdby the RulesProcessor — same pattern as grokcli, warp, and deepagents.Changes
codexcli-rule.tsfollowing the grokcli/warp pattern (root-only settable paths, both root and non-root rules target./AGENTS.md)ruleDiscoveryModefrom'toon'to'auto'(no inert TOON references)codexcli-rule.test.ts: 41 tests updated for folding behavior.codex/memories/no longer generated.gitignore(drops**/.codex/memories/)Precedent
This mirrors commit
3a57ea7a" which fixed the identical bug for warp (.warp/memories/` was inert).Closes #1765