





















@@ -38,6 +38,9 @@ export async function handleCodexAppServerApprovalRequest(params: {
3838if (!matchesCurrentTurn(requestParams, params.threadId, params.turnId)) {
3939return undefined;
4040}
41+if (!isSupportedAppServerApprovalMethod(params.method)) {
42+return unsupportedApprovalResponse();
43+}
41444245const context = buildApprovalContext({
4346method: params.method,
@@ -161,9 +164,7 @@ export function buildApprovalResponse(
161164}
162165return { permissions: {}, scope: "turn" };
163166}
164-return {
165-decision: outcome === "approved-once" || outcome === "approved-session" ? "accept" : "decline",
166-};
167+return unsupportedApprovalResponse();
167168}
168169169170function matchesCurrentTurn(
@@ -299,6 +300,13 @@ function requestedPermissions(requestParams: JsonObject | undefined): JsonObject
299300return granted;
300301}
301302303+function unsupportedApprovalResponse(): JsonValue {
304+return {
305+decision: "decline",
306+reason: "OpenClaw codex app-server bridge does not grant native approvals yet.",
307+};
308+}
309+302310function hasAvailableDecision(requestParams: JsonObject | undefined, decision: string): boolean {
303311const available = requestParams?.availableDecisions;
304312if (!Array.isArray(available)) {
@@ -348,6 +356,14 @@ function approvalKindForMethod(method: string): AgentApprovalEventData["kind"] {
348356return "unknown";
349357}
350358359+function isSupportedAppServerApprovalMethod(method: string): boolean {
360+return (
361+method === "item/commandExecution/requestApproval" ||
362+method === "item/fileChange/requestApproval" ||
363+method === "item/permissions/requestApproval"
364+);
365+}
366+351367function emitApprovalEvent(params: EmbeddedRunAttemptParams, data: AgentApprovalEventData): void {
352368params.onAgentEvent?.({ stream: "approval", data: data as unknown as Record<string, unknown> });
353369}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。