mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:30:42 +00:00
fix(codex): default app-server approvals to on-request
This commit is contained in:
committed by
Peter Steinberger
parent
8c05043eca
commit
d04f7e7ce7
@@ -263,7 +263,8 @@ By default, the plugin starts Codex locally with:
|
||||
codex app-server --listen stdio://
|
||||
```
|
||||
|
||||
You can keep that default and only tune Codex native policy:
|
||||
By default, OpenClaw asks Codex to request native approvals. You can tune that
|
||||
policy further:
|
||||
|
||||
```json5
|
||||
{
|
||||
@@ -317,7 +318,7 @@ Supported `appServer` fields:
|
||||
| `authToken` | unset | Bearer token for WebSocket transport. |
|
||||
| `headers` | `{}` | Extra WebSocket headers. |
|
||||
| `requestTimeoutMs` | `60000` | Timeout for app-server control-plane calls. |
|
||||
| `approvalPolicy` | `"never"` | Native Codex approval policy sent to thread start/resume/turn. |
|
||||
| `approvalPolicy` | `"on-request"` | Native Codex approval policy sent to thread start/resume/turn. |
|
||||
| `sandbox` | `"workspace-write"` | Native Codex sandbox mode sent to thread start/resume. |
|
||||
| `approvalsReviewer` | `"user"` | Use `"guardian_subagent"` to let Codex guardian review native approvals. |
|
||||
| `serviceTier` | unset | Optional Codex service tier, for example `"priority"`. |
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
"approvalPolicy": {
|
||||
"type": "string",
|
||||
"enum": ["never", "on-request", "on-failure", "untrusted"],
|
||||
"default": "never"
|
||||
"default": "on-request"
|
||||
},
|
||||
"sandbox": {
|
||||
"type": "string",
|
||||
|
||||
@@ -60,6 +60,21 @@ describe("Codex app-server config", () => {
|
||||
).toThrow("appServer.url is required");
|
||||
});
|
||||
|
||||
it("defaults native Codex approvals to on-request", () => {
|
||||
const runtime = resolveCodexAppServerRuntimeOptions({
|
||||
pluginConfig: {},
|
||||
env: {},
|
||||
});
|
||||
|
||||
expect(runtime).toEqual(
|
||||
expect.objectContaining({
|
||||
approvalPolicy: "on-request",
|
||||
sandbox: "workspace-write",
|
||||
approvalsReviewer: "user",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps runtime config keys aligned with manifest schema and UI hints", async () => {
|
||||
const manifest = JSON.parse(
|
||||
await fs.readFile(new URL("../../openclaw.plugin.json", import.meta.url), "utf8"),
|
||||
|
||||
@@ -136,7 +136,7 @@ export function resolveCodexAppServerRuntimeOptions(
|
||||
approvalPolicy:
|
||||
resolveApprovalPolicy(config.approvalPolicy) ??
|
||||
resolveApprovalPolicy(env.OPENCLAW_CODEX_APP_SERVER_APPROVAL_POLICY) ??
|
||||
"never",
|
||||
"on-request",
|
||||
sandbox:
|
||||
resolveSandbox(config.sandbox) ??
|
||||
resolveSandbox(env.OPENCLAW_CODEX_APP_SERVER_SANDBOX) ??
|
||||
|
||||
@@ -435,7 +435,7 @@ describe("runCodexAppServerAttempt", () => {
|
||||
threadId: "thread-existing",
|
||||
model: "gpt-5.4-codex",
|
||||
modelProvider: "openai",
|
||||
approvalPolicy: "never",
|
||||
approvalPolicy: "on-request",
|
||||
approvalsReviewer: "user",
|
||||
sandbox: "workspace-write",
|
||||
persistExtendedHistory: true,
|
||||
|
||||
Reference in New Issue
Block a user