feat: configure code-mode agent file policy - #557
Open
upu (upu) wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: e02a5b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
upu (upu)
marked this pull request as ready for review
July 31, 2026 22:59
upu (upu)
force-pushed
the
codex/issue-556-no-agent-files
branch
from
July 31, 2026 23:09
1818ac1 to
54e9a5c
Compare
upu (upu)
marked this pull request as draft
August 3, 2026 00:13
upu (upu)
force-pushed
the
codex/issue-556-no-agent-files
branch
from
August 3, 2026 00:19
54e9a5c to
10d644d
Compare
upu (upu)
marked this pull request as ready for review
August 3, 2026 01:37
upu (upu)
force-pushed
the
codex/issue-556-no-agent-files
branch
from
August 4, 2026 23:24
10d644d to
e02a5b5
Compare
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
openwiki.config.yamlsetting atcodeMode.agentFiles.policywithmanageandpreservevaluesmanageas the backward-compatible default and resolve policy in the order CLI > config > default--agent-files-policy <manage|preserve>as a one-run code-mode overridepreserveleave existing rootAGENTS.mdandCLAUDE.mdbyte-for-byte unchanged and keep missing files absentadd-pathswhen the committed policy ispreserveConfiguration
The
agentFilesmapping keeps policy separate from possible future path configuration. A CLI override applies only to the current run and never rewrites or creates the config file.Why
Some repositories already have an intentional agent-instruction layout. For example, a repository may keep shared guidance in
/AGENTS.mdand use/.claude/CLAUDE.mdonly as a pointer to it, with no root/CLAUDE.mdby design.Code mode currently creates or updates both root files on every run. The
preservepolicy lets these repositories updateopenwiki/**without mutating their existing instruction layout, while retaining the current behavior by default.Fixes #556.
Validation
pnpm run formatpnpm run lintpnpm run lint:checkpnpm run typecheckpnpm run format:checkpwdcommandchangeset status