mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Fix Codex MCP permission elicitation parity
This commit is contained in:
@@ -362,13 +362,18 @@ class CodexMcpAgentSession implements AgentSession {
|
||||
}
|
||||
|
||||
const response = await new Promise<ElicitResponse>((resolve, reject) => {
|
||||
const hasPending =
|
||||
this.pendingPermissions.has(permission.id) ||
|
||||
this.pendingPermissionHandlers.has(permission.id);
|
||||
this.pendingPermissions.set(permission.id, permission);
|
||||
this.pendingPermissionHandlers.set(permission.id, {
|
||||
request: permission,
|
||||
resolve,
|
||||
reject,
|
||||
});
|
||||
this.emitPermissionRequested(permission);
|
||||
if (!hasPending) {
|
||||
this.emitPermissionRequested(permission);
|
||||
}
|
||||
});
|
||||
|
||||
return response;
|
||||
@@ -1351,7 +1356,7 @@ class CodexMcpAgentSession implements AgentSession {
|
||||
return {
|
||||
id: requestId,
|
||||
provider: "codex-mcp" as AgentPermissionRequest["provider"],
|
||||
name: "exec_command",
|
||||
name: "CodexBash",
|
||||
kind: "tool",
|
||||
title: commandText ? `Run command: ${commandText}` : "Run shell command",
|
||||
description: message,
|
||||
|
||||
3
plan.md
3
plan.md
@@ -52,11 +52,12 @@ Build a new Codex MCP provider side‑by‑side with the existing Codex SDK prov
|
||||
- [x] **Fix**: Investigate Codex MCP permission elicitation behavior for `approval-policy=on-request` and `untrusted` (no permission_requested events).
|
||||
- **Done (2025-12-24 19:16)**: Added permission gating fallback for exec approval events, queued command events until approval, and flush/dropped queued events on resolution.
|
||||
|
||||
- [ ] **Fix**: Compare permission elicitation with happy-cli reference implementation.
|
||||
- [x] **Fix**: Compare permission elicitation with happy-cli reference implementation.
|
||||
|
||||
- Read `/Users/moboudra/dev/voice-dev/.tmp/happy-cli/src/codex/` to understand how elicitation works there.
|
||||
- Identify what's different in `codex-mcp-agent.ts` vs the reference.
|
||||
- The reference supports permissions - copy the working approach.
|
||||
- **Done (2025-12-24 18:53)**: Matched happy-cli elicitation flow by avoiding duplicate permission requests when exec events pre-seed pending entries and aligned permission tool naming with CodexBash.
|
||||
|
||||
- [ ] **Fix**: Use valid model instead of gpt-4.1.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user