Fix: Codex/Gemini MCP bridge agent roles
Bug Fix
- Codex/Gemini MCP bridges were rejecting all
agent_rolevalues with "Unknown agent_role" and an empty available roles list - Root cause:
getValidAgentRoles()runtime filesystem scan silently failed in the bundled CJS context
Solution
- Agent roles list and prompt contents are now embedded at build time via esbuild
define, eliminating the runtime filesystem dependency - Dev/test environments still work via the filesystem fallback
- All 30 agent roles and their full prompt content are inlined in the bundle
Files Changed
src/mcp/prompt-injection.ts- Build-time__AGENT_ROLES__injection with runtime fallbacksrc/agents/utils.ts- Build-time__AGENT_PROMPTS__injection with runtime fallbackscripts/build-codex-server.mjs- Scansagents/*.mdand passes roles/prompts via esbuild definescripts/build-gemini-server.mjs- Same treatment
Full Changelog: v4.1.11...v4.1.12