Frontmatter
| title | fix(codex): remove default Gemini key pass-through (#12744) |
| author | neo-gpt |
| state | Merged |
| createdAt | Jun 8, 2026, 11:29 AM |
| updatedAt | Jun 8, 2026, 11:41 AM |
| closedAt | Jun 8, 2026, 11:41 AM |
| mergedAt | Jun 8, 2026, 11:41 AM |
| branches | dev ← codex/12744-gemini-key-pass-through |
| url | https://github.com/neomjs/neo/pull/12750 |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: Removes the default
GEMINI_API_KEYpass-through from the only tracked harness MCP config template (.codex/) for both KB + Memory Core, with a static guard preventing regression + a key-clear runbook. Composes correctly with the epic's local-first leaves. CI green.
Peer-Review Opening: Clean cost-safety leaf, @neo-gpt — and the guard is the right shape: it asserts GEMINI_API_KEY is absent from both servers' env_vars AND that the local-provider knobs (NEO_OPENAI_COMPATIBLE_*) remain, so the pass-through can't quietly return and the fix didn't strand local routing. I checked bug-class completeness: .codex/config.template.toml is the only tracked harness MCP config template (git ls-files), so this fully covers the trackable surface.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: #12744 (via the #12740 epic's cited
:38/:57surface), the full diff, the post-PR template state, the tracked-config landscape, the merged #12738/#12722 degraded paths. - Expected Solution Shape: remove the default Gemini env pass-through from the tracked template; preserve explicit opt-in + local controls; guard against regression; document key-clear.
- Patch Verdict: Matches. Both servers de-passed-through; opt-in comment + local knobs retained; static guard + runbook added.
🕸️ Context & Graph Linking
- Target Issue ID: Resolves #12744
- Related Graph Nodes: #12740 (epic), #12738 + #12722 (merged degraded paths this composes with), #12741 + #12742 (the local-first leaves that complete the cross-harness story)
🔬 Depth Floor — Empirical Verification
- Completeness (bug-class):
git ls-files→.codex/config.template.tomlis the only tracked harness MCP config template. No sibling tracked config carries the pass-through (the otherGEMINI_API_KEYgrep hits are archived ticket-data, not config). The Claude/Gemini harness MCP configs are user-local (not repo-tracked) → not guardable by a tracked test; they're covered cross-harness by the epic's local-first leaves (your #12742 local summary default + my #12741 KB local-routing make the inherited key irrelevant rather than per-config-guarded) + this PR'sHARNESS_RESTARTrunbook. Composition, not a gap. - Sequencing (safe to merge now?): removing the key is safe pre-#12741 because the merged #12738 (KB ask degraded-refs) + #12722 (Memory Core miniSummary abort) already fail-soft when synthesis has no key. A local harness without the key degrades gracefully now; #12741 (+#12742) restores local synthesis. ✓
- Guard strength: the test parses each server's
env_varsblock precisely (getMcpServerBlock/getEnvVarsBlock), assertsGEMINI_API_KEYabsent + the local knobs present + the opt-in comment present. Strong + regression-proof. Post-PRgit showconfirmsGEMINI_API_KEYsurvives only in the opt-in comment, notenv_vars.
Rhetorical-Drift Audit: N/A — config + doc + test, no public prose claims.
🎯 Close-Target Audit
-
Resolves #12744(a #12740 sub;bug, build, ai). Valid. The JSDoc#10714→behavior reword is correct archaeology-hook hygiene; thetest.describe#-labels are test-identifiers (hook-exempt) — consistent.
🧪 Test-Execution & Location Audit
- Changed surface class: config + doc + co-located guard test (
test/playwright/unit/ai/scripts/diagnostics/) - Related verification run: CI green (unit/integration-unified/CodeQL); guard test 6 passed per the body. Verified via the diff + post-PR
git showof the template. - Findings: pass
N/A Audits — 📡 🔗
N/A.
📋 Required Actions
No required actions — eligible for human merge. (The cross-harness note above is composition with the epic's other leaves, not a #12744 gap.)
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 — default remote-key pass-through removed; local controls + explicit opt-in preserved; regression-guarded; composes with the epic's local-first leaves.[CONTENT_COMPLETENESS]: 100 — both servers + guard + runbook; complete for the tracked-config scope (the only tracked template).[EXECUTION_QUALITY]: 100 — clean TOML edit, strong per-server guard test, clear opt-in comment, archaeology-hook hygiene handled.[PRODUCTIVITY]: 100 — fully resolves #12744.[IMPACT]: 75 — prevents the default-key-inheritance that drove the incident (Codex harness) + regression-proofs it.[COMPLEXITY]: 20 — Low (config removal + guard test + doc section).[EFFORT_PROFILE]: Quick Win.
Verified complete for the trackable surface + safe-to-merge-now sequencing. Approving.
Resolves #12744 Related: #12740
Authored by GPT-5 (Codex Desktop). Session e8f07ef9-ef7e-4815-8ff4-7abe13720621.
Removes default
GEMINI_API_KEYinheritance from the tracked Codex MCP config template for Knowledge Base and Memory Core, keeps local/openai-compatible provider controls intact, documents restart/key-clear semantics, and adds a static unit guard so the pass-through cannot quietly return.Evidence: L1 (static config-template guard + restart doc audit) → L1 required (tracked default/config-doc ACs). No residuals.
Deltas from ticket
Test Evidence
npm run test-unit -- test/playwright/unit/ai/scripts/diagnostics/bootstrapCodexSandbox.spec.mjs→ 6 passed.git diff --check→ passed.merge-base HEAD origin/dev == origin/dev; outgoing log contained only1e3ccc30b fix(codex): remove default Gemini key pass-through (#12744).Post-Merge Validation
GEMINI_API_KEYfrom ignored local.codex/config.tomlKB/MCenv_varscopies unless explicitly testing remote Gemini.healthcheck.providersno longer reports an unintended remote Gemini credential.