Codex voice mcp fix#2351
Conversation
91f226f to
953f7c3
Compare
|
| Filename | Overview |
|---|---|
| packages/server/src/server/session/voice/voice-session.ts | Adds voice-policy injection and restoration, but identifies Codex-derived custom providers through a non-authoritative substring check. |
| packages/server/src/server/agent/providers/codex-app-server-agent.ts | Maps provider-specific MCP policies into each native Codex MCP server configuration and removes the transport-only metadata afterward. |
| packages/server/src/server/agent/agent-sdk-types.ts | Defines the Codex-native MCP approval policy types carried in provider-specific session metadata. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
V[Enable voice mode] --> P{Provider identified as Codex}
P -->|yes| O[Add paseo speak approval policy]
O --> R[Reload agent session]
R --> C[Codex native mcp_servers.paseo config]
P -->|custom Codex ID lacks codex substring| M[Policy omitted]
Reviews (2): Last reviewed commit: "Address review comments for Codex voice ..." | Re-trigger Greptile
| private buildCodexVoiceModeOverrides( | ||
| existingConfig: AgentSessionConfig, | ||
| ): Partial<AgentSessionConfig> | null { | ||
| if (!existingConfig.provider.toLowerCase().includes("codex")) { |
There was a problem hiding this comment.
Codex-derived providers skip policy
When a custom provider extends Codex but has a valid user-chosen ID without the codex substring, this check returns early and omits extra.codex.mcpServerPolicies.paseo, causing Codex to prompt for or reject the voice-mode speak call.
Knowledge Base Used: Agent Orchestration
Linked issue
Closes #119
Type of change
What does this PR do
Problem
Codex voice-mode sessions use the runtime-injected
paseoMCP server, but Paseo was not forwarding Codex-native MCP approval settings for that server into the Codex app-server configuration.As a result, the
speaktool could fall back to Codex's default MCP approval behavior and be rejected before Paseo's voice permission handling could allow it.Fix
For Codex voice mode, Paseo now adds provider-specific MCP policy metadata under:
The policy uses Codex's native MCP configuration shape directly:
enabled_toolsdefault_tools_approval_modetools.<tool>.approval_modeThe voice-mode policy configures the runtime-injected
paseoMCP server with:This keeps
speakexplicitly approved for Codex voice mode while leaving other Paseo tools subject to the normal prompt behavior.The provider-specific metadata is consumed by the Codex adapter and omitted from the final native Codex config after being applied to
mcp_servers.paseo.How did you verify it
Manual testing in the app (with screenshots)
speakMCP tool and audio plays without a manual approval prompt.Automatic tests
npm run test:unit --workspace=@getpaseo/server -- src/server/session/voice/voice-session.test.tsnpm run test:unit --workspace=@getpaseo/server -- src/server/agent/agent-manager.test.ts -t "Codex voice MCP sessions"npm run test:unit --workspace=@getpaseo/server -- src/server/agent/providers/codex-app-server-agent.test.ts -t "includes native MCP approval settings"npm run typechecknpm run lintnpm run formatChecklist
npm run typecheckpassesnpm run lintpassesnpm run formatran