Skip to content

fix: preserve existing AGENTS.md during Codex sync#11

Open
catwithtudou wants to merge 1 commit into
MagicCube:mainfrom
catwithtudou:fix/preserve-existing-agents-md
Open

fix: preserve existing AGENTS.md during Codex sync#11
catwithtudou wants to merge 1 commit into
MagicCube:mainfrom
catwithtudou:fix/preserve-existing-agents-md

Conversation

@catwithtudou

@catwithtudou catwithtudou commented Jun 7, 2026

Copy link
Copy Markdown

Summary

  • Preserve an existing project AGENTS.md when Codex syncs instructions from CLAUDE.md
  • Continue skipping writes when generated AGENTS.md content is unchanged
  • Add a regression test covering existing AGENTS.md preservation

Why

When a project already has AGENTS.md, it is usually the project-native instruction file for Codex or other agents. Overwriting it with generated CLAUDE.md content can silently discard project-specific guidance.

This change keeps the existing AGENTS.md as the source of truth and logs a warning instead of overwriting it. That means Codex may not automatically receive extra CLAUDE.md-only guidance in this case, but it avoids the more destructive behavior of replacing user- or project-owned instructions.

Test Plan

  • FEISHU_APP_ID=test FEISHU_APP_SECRET=test bun test tests/community/openai/codex-agent-runner.test.ts
  • FEISHU_APP_ID=test FEISHU_APP_SECRET=test bun test
  • FEISHU_APP_ID=test FEISHU_APP_SECRET=test bun run check
  • bun run build:js
  • bun run build:bin

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