[CL-AUDIT] fix(codex-local): merge managed MCP в config.toml вместо overwrite #122

Merged
andrei merged 1 commit from fix/claude-codex-mcp-merge into master 2026-06-27 17:30:29 +00:00
Owner

Что сделано

Codex-агенты не получали MCP: ensureManagedMcpConfig писал renderCodexMcpConfig (только [mcp_servers]) как ВЕСЬ config.toml → пропускал запись при любом существующем конфиге (чтобы не затереть прочие настройки) → managed-marker отсутствовал во всех codex-home.

Фикс — append/merge: managed-блок делимитирован START..END маркерами; mergeManagedMcpConfig вырезает прежний managed-блок (идемпотентный refresh), сохраняет не-MCP настройки, аппендит наш блок; null/skip если есть операторский [mcp_servers] (не клоберим). Удалён мёртвый hasWindowsOnlyCodexConfig.

План тестирования

TDD RED→GREEN, 4 кейса (null→rendered; preserve+append; идемпотентный refresh; operator-MCP→skip). codex-home.test 9/9; codex-local tsc EXIT=0.

Где могу ошибиться

Win-only stale-config replacement (старый hasWindowsOnlyCodexConfig) убран; на linux-проде адаптер на win32 и так выходит рано — для прод-кейса (MCP не писался при нормальном конфиге) фикс корректен.

## Что сделано Codex-агенты не получали MCP: `ensureManagedMcpConfig` писал `renderCodexMcpConfig` (только `[mcp_servers]`) как ВЕСЬ `config.toml` → пропускал запись при любом существующем конфиге (чтобы не затереть прочие настройки) → managed-marker отсутствовал во всех codex-home. **Фикс — append/merge:** managed-блок делимитирован START..END маркерами; `mergeManagedMcpConfig` вырезает прежний managed-блок (идемпотентный refresh), сохраняет не-MCP настройки, аппендит наш блок; `null`/skip если есть операторский `[mcp_servers]` (не клоберим). Удалён мёртвый `hasWindowsOnlyCodexConfig`. ## План тестирования TDD RED→GREEN, 4 кейса (null→rendered; preserve+append; идемпотентный refresh; operator-MCP→skip). codex-home.test **9/9**; codex-local `tsc` EXIT=0. ## Где могу ошибиться Win-only stale-config replacement (старый `hasWindowsOnlyCodexConfig`) убран; на linux-проде адаптер на win32 и так выходит рано — для прод-кейса (MCP не писался при нормальном конфиге) фикс корректен.
[CL-AUDIT] fix(codex-local): merge managed MCP в config.toml (не перезаписывать)
Some checks failed
security/pr-scan 2 security flag(s) — see Actions log (critical)
PR Quality Gates / PR Quality Gates (pull_request_target) Failing after 5s
Agents CI / Typecheck and Build (pull_request) Successful in 4m12s
722de83293
Аудит: codex-агенты не получали MCP — ensureManagedMcpConfig писал
renderCodexMcpConfig (ТОЛЬКО [mcp_servers]-блок) как ВЕСЬ config.toml, поэтому
пропускал запись при любом существующем конфиге (чтобы не затереть прочие
настройки). Итог: managed-marker отсутствовал во всех codex-home, MCP не
инжектился.

Фикс — append/merge вместо overwrite:
- managed-блок теперь делимитирован START..END маркерами;
- mergeManagedMcpConfig(existing, rendered): вырезает прежний managed-блок
  (идемпотентный refresh), сохраняет все НЕ-MCP настройки, аппендит наш блок;
  возвращает null (skip) если есть ОПЕРАТОРСКИЙ [mcp_servers] — не клоберим;
- ensureManagedMcpConfig пишет merged (не голый rendered), no-op если без
  изменений; удалён мёртвый hasWindowsOnlyCodexConfig.

Тесты (TDD RED→GREEN): null-existing→rendered; preserve non-MCP+append;
идемпотентный refresh (strip old, keep settings, single marker); operator MCP→skip.
codex-home.test 9/9, codex-local tsc EXIT=0.
andrei merged commit 94ef23c0ae into master 2026-06-27 17:30:29 +00:00
andrei deleted branch fix/claude-codex-mcp-merge 2026-06-27 17:30:29 +00:00

Hey @andrei! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • Missing section: ## Thinking Path
  • Missing section: ## What Changed
  • Missing section: ## Verification
  • Missing section: ## Risks
  • Missing section: ## Model Used
  • No linked issue or inline issue description found — either tag an existing issue with Fixes #NNN / Closes #NNN / Refs #NNN, or describe the underlying issue inline in the PR body following one of our issue templates (https://git.adami.kr/europa-tech-srl/europa-tech-agents/src/branch/master/.github/ISSUE_TEMPLATE). See CONTRIBUTING.md → "Link Issues or Describe Them In-PR".
  • Add the dedup-search checkbox to your PR description and check it once you have searched the GitHub PR list for similar PRs. See the PR template at .github/PULL_REQUEST_TEMPLATE.md and CONTRIBUTING.md → "Before You Start: Search First".

Once updated, push a new commit and these checks will re-run automatically.

— paperclip-gates

Hey @andrei! Before this PR can be reviewed, a few things need attention: **Missing or incomplete:** - [ ] Missing section: **## Thinking Path** - [ ] Missing section: **## What Changed** - [ ] Missing section: **## Verification** - [ ] Missing section: **## Risks** - [ ] Missing section: **## Model Used** - [ ] No linked issue or inline issue description found — either tag an existing issue with `Fixes #NNN` / `Closes #NNN` / `Refs #NNN`, or describe the underlying issue inline in the PR body following one of our issue templates (https://git.adami.kr/europa-tech-srl/europa-tech-agents/src/branch/master/.github/ISSUE_TEMPLATE). See CONTRIBUTING.md → "Link Issues or Describe Them In-PR". - [ ] Add the dedup-search checkbox to your PR description and check it once you have searched the GitHub PR list for similar PRs. See the PR template at .github/PULL_REQUEST_TEMPLATE.md and CONTRIBUTING.md → "Before You Start: Search First". Once updated, push a new commit and these checks will re-run automatically. — paperclip-gates
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
europa-tech-srl/europa-tech-agents!122
No description provided.