You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2ab65d1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cursor): route denied native tools through advertised Codex exec
Cursor-native read/shell/fetch stay denied by default, but the refusal used to name a top-level exec_command/shell_command bridge even on Desktop code-mode turns that only advertise exec. Teach the denial path and tool guidance to retry through nested await tools.exec_command(...) when that is the catalog this turn actually exposed.
Copy file name to clipboardExpand all lines: docs-site/src/content/docs/guides/providers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -519,7 +519,7 @@ and `fast=true` `requested_model` parameters; flattened `cursor-grok-{version}-{
519
519
are discovery and picker identities only. Cursor serves Kimi K3 only as effort-suffixed wire ids, so
520
520
`cursor/kimi-k3` exposes a `low` / `high` / `max` ladder and defaults to `max`, matching the
521
521
model's documented API default. Cursor server-driven native read/write/delete/ls/grep/shell/fetch execution
522
-
is disabled by default because it bypasses Codex's approval and sandbox path; set
522
+
is disabled by default because it bypasses Codex's approval and sandbox path. Denied native calls are rerouted to the Codex tools advertised on that turn — a flat `exec_command` / `shell_command` bridge, or nested `await tools.exec_command(...)` helpers inside Desktop code-mode `exec`. Set
523
523
`unsafeAllowNativeLocalExec: true` on the `providers.cursor` object in `~/.opencodex/config.json`
524
524
only for trusted local experiments (or via **Providers → Cursor → Edit JSON** in the dashboard).
525
525
See the [Configuration reference](/reference/configuration/#cursor-provider-adapter-cursor)
`the Codex code-mode tool \`${CODEX_UNIFIED_EXEC_TOOL}\` and call a nested helper INSIDE its JavaScript body, for example \`await tools.${CODEX_EXEC_COMMAND_TOOL}({cmd: "pwd"})\`. Do not invent a top-level \`${CODEX_SHELL_COMMAND_TOOL}\` / \`${CODEX_EXEC_COMMAND_TOOL}\` call`;
16
+
17
+
constFLAT_SHELL_HINT=
18
+
`the Codex bridge shell tool from the current catalog (\`${CODEX_SHELL_COMMAND_TOOL}\` or \`${CODEX_EXEC_COMMAND_TOOL}\`, including the long \`mcp_${OCX_RESPONSES_TOOL_PROVIDER}_*\` display name if listed)`;
// Do not insist on "the same command" — that steers models into replaying bash/CMD
61
+
// idioms through the Codex bridge on Windows PowerShell 5.1 and looping (#604).
62
+
// Keep this host-shell-neutral: OpenCodex may run on a different OS than the Codex
63
+
// client that executes the bridge (LAN/SSH remote-proxy).
64
+
return(
65
+
`Route this through ${bridgeTarget(catalog)}. `
66
+
+`${silenceClause("shell")} `
67
+
+"Adapt the command for the Codex client host shell before calling the bridge "
68
+
+"(Windows PowerShell 5.1: no CMD `cd /d`, no bash heredocs; `&&`/`||` are unsupported parser errors — prefer the bridge working-directory argument for directory changes, and use `if ($?) { ... }` for success-gated follow-up steps; do not treat `;` as a substitute for `&&`). "
69
+
+"Make at most one corrected bridge attempt after a failure, then report the error and stop — do not repeat equivalent failing commands."
`Route this through ${CODE_MODE_SHELL_HINT} with a nested \`await tools.${CODEX_EXEC_COMMAND_TOOL}({cmd: "curl ..."})\` helper. `
87
+
+silenceClause("network")
88
+
);
89
+
}
90
+
return(
91
+
"Route this through the Codex shell bridge tool `shell_command` (aliases: `exec_command`, `mcp_opencodex-responses_shell_command`, `mcp_opencodex-responses_exec_command`) with curl or wget. "
@@ -46,14 +47,15 @@ function codexNativeMutationRefusal(operation: "write" | "delete", structuredEdi
46
47
return`Cursor-native ${operation} is disabled for this Codex request because apply_patch is available.${structuredHint} No file was changed.`;
47
48
}
48
49
49
-
constNATIVE_LOCAL_EXEC_DISABLED=
50
-
"Route filesystem work through the Codex Responses bridge shell tool (`shell_command` / `exec_command`, or the listed `mcp_opencodex-responses_*` display alias) with equivalent shell commands (cat, head, ls, rg, grep), or `apply_patch` for file edits. Do not tell the user shell or read access is blocked, disabled, or denied — silently call that bridge tool.";
"Route this through the Codex shell bridge tool `shell_command` (aliases: `exec_command`, `mcp_opencodex-responses_shell_command`, `mcp_opencodex-responses_exec_command`) with curl or wget. Do not tell the user network or shell access is blocked, disabled, or denied — silently call that bridge tool.";
// Do not insist on "the same command" — that steers models into replaying bash/CMD
87
-
// idioms through the Codex bridge on Windows PowerShell 5.1 and looping (#604).
88
-
// Keep this host-shell-neutral: OpenCodex may run on a different OS than the Codex
89
-
// client that executes the bridge (LAN/SSH remote-proxy).
90
-
return(
91
-
"Route this through the Codex bridge shell tool from the current catalog (`shell_command` or `exec_command`, including the long `mcp_opencodex-responses_*` display name if listed). "
92
-
+"Do not tell the user shell access is blocked, disabled, or denied — silently call that bridge tool. "
93
-
+"Adapt the command for the Codex client host shell before calling the bridge "
94
-
+"(Windows PowerShell 5.1: no CMD `cd /d`, no bash heredocs; `&&`/`||` are unsupported parser errors — prefer the bridge working-directory argument for directory changes, and use `if ($?) { ... }` for success-gated follow-up steps; do not treat `;` as a substitute for `&&`). "
95
-
+"Make at most one corrected bridge attempt after a failure, then report the error and stop — do not repeat equivalent failing commands."
0 commit comments