feat(codex): route bound-conversation approvals through OpenClaw gateway#4
Draft
SYU8384 wants to merge 1 commit into
Draft
feat(codex): route bound-conversation approvals through OpenClaw gateway#4SYU8384 wants to merge 1 commit into
SYU8384 wants to merge 1 commit into
Conversation
This was referenced Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the auto-decline behavior in the native Codex conversation binding with real OpenClaw plugin approval routing for:
item/commandExecution/requestApprovalitem/fileChange/requestApprovalitem/permissions/requestApprovalPreviously, bound Codex conversations would decline any interactive approval and tell the user to fall back to the Codex harness or
/acp spawn codex. Now these requests are routed through the existingplugin.approval.request/plugin.approval.waitDecisiongateway tools, so users can approve/deny from their configured OpenClaw channel.Companion PR: #3 — native app-server plan and chat controls (foundation, plan mode, think defaults, live progress, chat plan approval controls, user-input chat controls, sequential question rendering, freeform answer dispatch, progress reply delivery).
Changes
extensions/codex/src/app-server/plugin-approval-roundtrip.tsPluginApprovalRunContext, a minimal subset ofEmbeddedRunAttemptParamsneeded for approval routing.requestPluginApprovalto acceptPluginApprovalRunContextso callers with only bound-conversation context can reuse it.routeCodexBoundApprovalhelper that maps Codex approval request methods to gateway approval requests and maps the resultingallow-once/allow-always/deny/ unavailable decisions back to the Codex wire shapes.extensions/codex/src/conversation-binding.tsPluginApprovalRunContextfrom the inbound claim event and session config.routeCodexBoundApproval.requestApprovalfallback as a conservative decline for unknown approval methods.extensions/codex/src/app-server/plugin-approval-roundtrip.test.tsrequestPluginApproval,waitForPluginApprovalDecision,approvalRequestExplicitlyUnavailable, androuteCodexBoundApprovalfor command, file-change, and permissions approvals.Verification
pnpm tsgo:extensionspasses.pnpm test extensions/codex/src/conversation-binding.test.tspasses (20/20).pnpm test extensions/codex/src/app-server/plugin-approval-roundtrip.test.tspasses (15/15).pnpm buildpasses.Not tested
No live Crabbox/Telegram roundtrip was run for this draft; focused unit tests and typecheck/build prove the routing and mapping surface.