Skip to content

feat: configure code-mode agent file policy - #557

Open
upu (upu) wants to merge 1 commit into
langchain-ai:mainfrom
upu:codex/issue-556-no-agent-files
Open

feat: configure code-mode agent file policy#557
upu (upu) wants to merge 1 commit into
langchain-ai:mainfrom
upu:codex/issue-556-no-agent-files

Conversation

@upu

@upu upu (upu) commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • add a committed openwiki.config.yaml setting at codeMode.agentFiles.policy with manage and preserve values
  • keep manage as the backward-compatible default and resolve policy in the order CLI > config > default
  • add --agent-files-policy <manage|preserve> as a one-run code-mode override
  • make preserve leave existing root AGENTS.md and CLAUDE.md byte-for-byte unchanged and keep missing files absent
  • make newly generated scheduled workflows read the committed config, omitting agent files from add-paths when the committed policy is preserve
  • cover precedence, init/update/chat paths, workflow behavior, invalid config, CLI parsing, and help output
  • document the configuration and include a minor changeset

Configuration

codeMode:
  agentFiles:
    policy: preserve

The agentFiles mapping 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.md and use /.claude/CLAUDE.md only as a pointer to it, with no root /CLAUDE.md by design.

Code mode currently creates or updates both root files on every run. The preserve policy lets these repositories update openwiki/** without mutating their existing instruction layout, while retaining the current behavior by default.

Fixes #556.

Validation

  • pnpm run format
  • pnpm run lint
  • pnpm run lint:check
  • pnpm run typecheck
  • pnpm run format:check
  • targeted policy/command tests: 3 files, 99 tests passed
  • full test run: 901 of 906 tests passed locally on Windows
    • the 3 Mermaid timeout failures passed when rerun in isolation (43 tests)
    • the remaining 2 failures are Windows environment limitations: symlink creation requires additional privileges, and the shell-backend test invokes the POSIX pwd command
  • changeset status

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e02a5b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openwiki Minor

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 (upu) marked this pull request as ready for review July 31, 2026 22:59
@upu
upu (upu) force-pushed the codex/issue-556-no-agent-files branch from 1818ac1 to 54e9a5c Compare July 31, 2026 23:09
@upu
upu (upu) marked this pull request as draft August 3, 2026 00:13
@upu
upu (upu) force-pushed the codex/issue-556-no-agent-files branch from 54e9a5c to 10d644d Compare August 3, 2026 00:19
@upu upu (upu) changed the title feat: allow code mode to skip root agent files feat: configure code-mode agent file policy Aug 3, 2026
@upu
upu (upu) marked this pull request as ready for review August 3, 2026 01:37
@upu
upu (upu) force-pushed the codex/issue-556-no-agent-files branch from 10d644d to e02a5b5 Compare August 4, 2026 23:24
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.

[Feature]: Allow code mode to skip managing root AGENTS.md and CLAUDE.md files

1 participant