Repository navigation
Route Codex file-change and sandbox-permission asks to the approval card - #1640
Conversation
Solenta-Message-Id: 373616a6-d746-424f-a642-fac2611d2b55
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a14ae04cba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const changes = method === METHOD_FILE_CHANGE | ||
| ? store.getMessages(threadId).find((m) => m.tool && m.tool.id === msg.params?.itemId)?.tool.input |
There was a problem hiding this comment.
Preserve the full file-change diff for approval
For any file-change payload whose serialized changes exceeds INPUT_TRUNCATE (2,000 characters), this reads tool.input, which was already truncated by ingestCodexTool in runner-provider-codex.js, and presents only that prefix in the approval card; accepting still authorizes the entire server-side patch, including every unseen hunk. Keep an untruncated ephemeral copy of the streamed changes for approval correlation rather than sourcing the security decision from the display-truncated message.
Useful? React with 👍 / 👎.
Codex app-server
item/fileChange/requestApprovalanditem/permissions/requestApprovalServerRequests used to get a JSON-RPC error straight away. Now they go through the same pending-permission queue and PermissionPrompt card that command approvals already use (#1190). MCP elicitation and user-input requests are still recognized but unsupported, so they keep returning an error.What changed
electron/codexApprovals.jsclassifyServerRequesthas a new"approval"action. It covers file-change requests, and permission requests whosepermissionsis an object.pendingFromApprovalbuilds the pending card:fileChangeitem that streamed in just before it, plusreasonandgrantRootwhen present. If that streamed item can't be found, the function throws. The request then gets an error reply instead of a blind approval.cwd,reasonand the requested profile. That profile is stored asgrant, so Accept grants exactly what was asked for and nothing broader.approvalResponsenow handles permission requests:network/fileSystementries withscope: "turn".scope: "session".electron/runner-permissions.jsapprovalare accepted.itemIdand passes its input in as the diff.pending.grantis passed as the reply content. The exception is input requests, which still use the validated input values.Tests
ask-permissionsandask-file-changescenarios infakeCodexCli:🤖 Generated with Claude Code