Context
Post-harness-restart MCP verification on 2026-06-23 found all four live Neo MCP servers healthy, but the focused MCP client health spec still fails for the Knowledge Base bootstrap path.
Observed evidence:
- Native
mcp__neo_mjs_knowledge_base.healthcheck returned healthy/current.
- Native
query_documents and ask_knowledge_base both responded.
- Shell env has
NEO_KB_ASK_API_KEY set and GEMINI_API_KEY unset.
npm run test-unit -- test/playwright/unit/ai/mcp/client/McpServersHealth.spec.mjs passed 4/5 and failed only for Knowledge Base with MCP Client: Missing required environment variables for 'knowledge-base': GEMINI_API_KEY.
Live latest-open sweep: checked latest 20 open issues at 2026-06-23T15:49Z; no equivalent open ticket found.
A2A in-flight sweep: checked latest 30 all-state messages at 2026-06-23T15:49Z; no active claim on this stale KB ask-key/client-config path found.
KB ticket sweep: queried GEMINI_API_KEY NEO_KB_ASK_API_KEY MCP client knowledge-base requiredEnv; top hits were archived unrelated historical issues, not this current config drift.
Release classification: boardless local-harness/test hardening; live MCP service health is already green.
The Problem
The runtime architecture has moved the Knowledge Base ask-synthesis secret to the dedicated NEO_KB_ASK_API_KEY leaf, while the generic MCP client config still declares knowledge-base.requiredEnv = ["GEMINI_API_KEY"]. That makes the client health test report a false Knowledge Base failure in the intended local Codex environment.
Separately, the Codex config template forwards the local model/provider env vars but does not include NEO_KB_ASK_API_KEY, even though the Knowledge Base ask path is explicitly allowed to use that dedicated key.
The Architectural Reality
.codex/config.template.toml is the tracked Codex Desktop MCP template and should forward only intended local MCP env vars.
ai/mcp/server/knowledge-base/config.template.mjs defines askSynthesis.apiKey as leaf(null, 'NEO_KB_ASK_API_KEY', 'string').
ai/mcp/client/config.mjs defines the default MCP client server requirements consumed by test/playwright/unit/ai/mcp/client/McpServersHealth.spec.mjs.
GEMINI_API_KEY is no longer the intended Knowledge Base ask credential in this lane.
The Fix
- Add
NEO_KB_ASK_API_KEY to the Knowledge Base env forwarding list in .codex/config.template.toml.
- Remove the stale
GEMINI_API_KEY requirement from knowledge-base.requiredEnv in ai/mcp/client/config.mjs, or replace it with the actual required semantics if the client layer needs a provider-aware check.
- Keep
GEMINI_API_KEY opt-in only for explicit remote-Gemini local tests.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
| Codex KB MCP env forwarding |
.codex/config.template.toml + ai/mcp/server/knowledge-base/config.template.mjs |
Forward NEO_KB_ASK_API_KEY to the KB MCP child when present; do not forward GEMINI_API_KEY by default |
KB retrieval/query remains healthy; ask synthesis may degrade if no dedicated key/local ask provider is configured |
Existing template comments around remote Gemini opt-in |
Focused MCP health and native KB ask/query checks |
| MCP client Knowledge Base env gate |
ai/mcp/client/config.mjs |
Do not require retired shared GEMINI_API_KEY to boot Knowledge Base |
Server healthcheck may return degraded only if real provider config is unavailable |
Client health spec |
McpServersHealth.spec.mjs should pass without GEMINI_API_KEY |
Decision Record impact
Aligned with ADR 0019: read resolved config leaves at the use site and avoid stale pass-through aliases or duplicated provider assumptions.
Acceptance Criteria
Out of Scope
- Rotating or provisioning any secret.
- Changing the Knowledge Base ask model/provider policy.
- Reintroducing shared
GEMINI_API_KEY forwarding for local Codex MCP servers.
Related
- ADR 0019:
learn/agentos/decisions/0019-aiconfig-reactive-provider-ssot.md
.codex/HARNESS_RESTART.md
Origin Session ID: 02b1972b-2925-4458-89c7-287df50c726e
Handoff Retrieval Hint: NEO_KB_ASK_API_KEY GEMINI_API_KEY McpServersHealth knowledge-base requiredEnv Codex config template
Context
Post-harness-restart MCP verification on 2026-06-23 found all four live Neo MCP servers healthy, but the focused MCP client health spec still fails for the Knowledge Base bootstrap path.
Observed evidence:
mcp__neo_mjs_knowledge_base.healthcheckreturned healthy/current.query_documentsandask_knowledge_baseboth responded.NEO_KB_ASK_API_KEYset andGEMINI_API_KEYunset.npm run test-unit -- test/playwright/unit/ai/mcp/client/McpServersHealth.spec.mjspassed 4/5 and failed only for Knowledge Base withMCP Client: Missing required environment variables for 'knowledge-base': GEMINI_API_KEY.Live latest-open sweep: checked latest 20 open issues at 2026-06-23T15:49Z; no equivalent open ticket found. A2A in-flight sweep: checked latest 30 all-state messages at 2026-06-23T15:49Z; no active claim on this stale KB ask-key/client-config path found. KB ticket sweep: queried
GEMINI_API_KEY NEO_KB_ASK_API_KEY MCP client knowledge-base requiredEnv; top hits were archived unrelated historical issues, not this current config drift.Release classification: boardless local-harness/test hardening; live MCP service health is already green.
The Problem
The runtime architecture has moved the Knowledge Base ask-synthesis secret to the dedicated
NEO_KB_ASK_API_KEYleaf, while the generic MCP client config still declaresknowledge-base.requiredEnv = ["GEMINI_API_KEY"]. That makes the client health test report a false Knowledge Base failure in the intended local Codex environment.Separately, the Codex config template forwards the local model/provider env vars but does not include
NEO_KB_ASK_API_KEY, even though the Knowledge Base ask path is explicitly allowed to use that dedicated key.The Architectural Reality
.codex/config.template.tomlis the tracked Codex Desktop MCP template and should forward only intended local MCP env vars.ai/mcp/server/knowledge-base/config.template.mjsdefinesaskSynthesis.apiKeyasleaf(null, 'NEO_KB_ASK_API_KEY', 'string').ai/mcp/client/config.mjsdefines the default MCP client server requirements consumed bytest/playwright/unit/ai/mcp/client/McpServersHealth.spec.mjs.GEMINI_API_KEYis no longer the intended Knowledge Base ask credential in this lane.The Fix
NEO_KB_ASK_API_KEYto the Knowledge Base env forwarding list in.codex/config.template.toml.GEMINI_API_KEYrequirement fromknowledge-base.requiredEnvinai/mcp/client/config.mjs, or replace it with the actual required semantics if the client layer needs a provider-aware check.GEMINI_API_KEYopt-in only for explicit remote-Gemini local tests.Contract Ledger Matrix
.codex/config.template.toml+ai/mcp/server/knowledge-base/config.template.mjsNEO_KB_ASK_API_KEYto the KB MCP child when present; do not forwardGEMINI_API_KEYby defaultai/mcp/client/config.mjsGEMINI_API_KEYto boot Knowledge BaseMcpServersHealth.spec.mjsshould pass withoutGEMINI_API_KEYDecision Record impact
Aligned with ADR 0019: read resolved config leaves at the use site and avoid stale pass-through aliases or duplicated provider assumptions.
Acceptance Criteria
.codex/config.template.tomlforwardsNEO_KB_ASK_API_KEYtoneo-mjs-knowledge-base.GEMINI_API_KEYforknowledge-basestartup.npm run test-unit -- test/playwright/unit/ai/mcp/client/McpServersHealth.spec.mjspasses withNEO_KB_ASK_API_KEYset andGEMINI_API_KEYunset.healthcheck,query_documents, andask_knowledge_baseremain healthy/usable.Out of Scope
GEMINI_API_KEYforwarding for local Codex MCP servers.Related
learn/agentos/decisions/0019-aiconfig-reactive-provider-ssot.md.codex/HARNESS_RESTART.mdOrigin Session ID: 02b1972b-2925-4458-89c7-287df50c726e
Handoff Retrieval Hint:
NEO_KB_ASK_API_KEY GEMINI_API_KEY McpServersHealth knowledge-base requiredEnv Codex config template