fix(claude): avoid creating agents directory when disabled - #2619
Conversation
An empty roster has nothing to write, and an absent agents directory has nothing to prune. Return without creating ~/.claude while preserving cleanup for existing OpenCodex-owned definitions.
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesClaude agent synchronization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked. |
리뷰 · 우선순위 64 / 80설명: 이 풀은 클로드 통합이 꺼져 있거나 쓸 정의가 없을 때 HEAD 에서 구멍은 그대로다. src/claude/agents-inject.ts 218줄 syncClaudeAgentDefs 는 221줄에서 정의가 없어도 mkdirSync 를 recursive 로 부른다. 249줄 injectClaudeAgentDefs 는 claudeCode.enabled 가 false 이거나 injectAgents 가 false 이면 253줄에서 빈 배열로 sync 를 부른다. 그래서 통합을 꺼도 agents 폴더가 생긴다. src/cli/claude-agent-startup-sync.ts 와 src/server/system-env.ts 416줄, src/cli/claude.ts 330줄이 그 길을 탄다. tests/claude-agents-inject.test.ts 322줄은 꺼진 뒤에 폴더 안 파일이 비었는지만 본다. 폴더 자체가 없었는지는 안 본다. 이 풀은 빈 정의일 때만 먼저 lstatSync 로 폴더를 본다. 없으면 ENOENT 에서 빈 배열을 바로 돌린다. 폴더가 이미 있으면 예전처럼 읽어 소유 파일을 지운다. 정의가 있으면 mkdirSync 를 그대로 둔다. tests/claude-agents-inject.test.ts 에 없는 폴더를 안 만든다는 시험을 더한다. 범위가 작고 2200 이어서와 맞다. package.json 을 안 올린다. 위생 차단 대상이 아니다. 큰 포크 덤프도 아니다. types.ts/config.ts 가르기를 깨지 않는다. 다만 드래프트다. 본문 체크리스트 네 칸이 비어 있다. 자동 댓글도 칸을 다 채울 때까지 드래프트로 두라고 한다. 본문이 적은 bun run test 는 다른 파일에서 실패가 났고 재시도는 통과했다고 한다. 이 풀의 두 파일 밖이다. 그 칸을 작성자가 채우기 전에는 합치지 말 것. 이번 시간 착지 2610 부터 2621 은 agents-inject.ts 를 안 건드린다. 리베이스가 필수는 아니다. 2200 을 이 풀로 닫지 말 것. 내가 확인하지 않은 이슈를 닫지 않는다. src/runtime 은 없다. default-aliases.ts 는 이제 있다. 이 풀의 주제가 아니다. 라인 221 - src/claude/agents-inject.ts HEAD 는 정의가 없어도 mkdirSync 를 부른다 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
…2619) An empty roster has nothing to write, and an absent agents directory has nothing to prune. Return without creating ~/.claude while preserving cleanup for existing OpenCodex-owned definitions.
…2619) An empty roster has nothing to write, and an absent agents directory has nothing to prune. Return without creating ~/.claude while preserving cleanup for existing OpenCodex-owned definitions.
Summary
~/.claude/agentswhen the Claude integration has no definitions to write and the directory does not already exist.Verification
bun test tests/claude-agents-inject.test.ts— 18 passed.bun test tests/claude-agent-startup-sync.test.ts— 5 passed.bun run typecheck— passed.claudeCode.enabled=false— returned no definitions and left.claudeabsent.bun run test— the 4x parallel phase reported 14,814 passed, 12 skipped, 15 failed, and 3 errors; every listed retry file passed in the subsequent 1x serial reruns, but the command exited 1. The reported failures are outside this PR's two-file diff.bun run privacy:scan— blocked by pre-existing email examples indocs-site/src/content/docs/reference/cli/providers-accounts.md:167-168, which this PR does not modify.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
Bug Fixes
Tests