Repository navigation
fix: keep Codex delegation when image generation is denied - #124598
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
99f6b8c to
aed6775
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 11:50 AM ET / 15:50 UTC. ClawSweeper reviewWhat this changesThe PR forwards exact safe tool denies into the Codex harness so denying image generation disables its native equivalent while preserving native delegation. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open for manual security-boundary review. The code and supplied real behavior proof support the intended fix, but it adds an experimental Plugin SDK enforcement handoff and relies on the pinned Codex feature contract, which could not be directly inspected under the required sibling-source gate. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw resolves conversation tool policy before calling an agent harness. The Codex extension translates the prepared policy facts into app-server thread configuration, which determines available native tools for fresh and resumed sessions. flowchart LR
A[Conversation tool policy] --> B[Harness policy resolution]
B --> C[Safe deny handoff]
C --> D[Codex thread configuration]
D --> E[Native Codex tool surface]
E --> F[Delegation and image behavior]
Decision needed
Why: This is a compatibility-sensitive Plugin SDK contract and a native deny boundary; the required direct dependency-source check could not be completed locally. Before merge
Findings
Agent review detailsSecurityNeeds attention: The code has no source-proven patch defect, but this is a native tool-deny boundary whose pinned dependency contract still requires direct owner verification. PR surfaceSource +53, Tests +138, Docs +2. Total +193 across 13 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Record plugin/security-owner acceptance of the public handoff after directly verifying the pinned Codex feature behavior, then merge the focused owner-boundary repair if that contract holds. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main omits Is this the best way to solve the issue? Unclear: forwarding an audited prepared fact is the clean owner-boundary shape, but direct verification of the pinned Codex feature contract and approval of the public Plugin SDK obligation remain necessary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f561999a9d8. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…claw#124598) Forward exact audited tool denies into agent harnesses so Codex can disable native image generation without dropping delegation. Fail closed when managed policy forces image generation and rotate retained threads when effective native config changes. Co-authored-by: Marvinthebored <[email protected]>
Closes #124541
AI-assisted: yes (Codex implementation and review; Claude Opus 5 independent red-team). I reviewed the final diff and understand the behavior and security boundary.
What Problem This Solves
Fixes an issue where users denying
image_generatewould lose unrelated Codex native tools, including multi-agent delegation.Why This Change Was Made
Core now passes audited exact deny names to native harnesses, and the Codex harness maps
image_generateto the pinned nativefeatures.image_generation=falseoverride on both thread start and resume. Unknown, wildcard, allowlist, and undeclared denies remain fail-closed; managed Codex requirements that force image generation on are rejected before a thread is created.User Impact
Users can deny image generation without disabling Codex delegation or other unrelated native capabilities. The denied OpenClaw tool and its Codex-native equivalent both remain unavailable.
Evidence
thread/start(unexpected method: thread/start), provingimage_generation=truecould bypass the targeted deny. It now passes and rejects the conflict before thread creation.pluginHarnessToolPolicySafeDeniedTools=["image_generate"]handoff. The lifecycle reads managed requirements, rejects warm reuse because the final-config fingerprint changed, unsubscribes the loaded thread, and cold-resumes it withfeatures.image_generation=false.node --import tsx scripts/check.mts --timed: all preflight, production/script/test typecheck, lint, format, and policy lanes passed.node --import tsx scripts/build-all.mts: complete production and Control UI build passed.Pinned Codex contract
Directly inspected
openai/codexat the dependency's exactrust-v0.147.0commitbe6e8eac029b:Feature::ImageGenerationis the stableimage_generationkey, default enabled.image_generation_availablerequires that feature to be enabled, and the tool planner omits theimage_gennamespace when it is false.features.image_generation=falseremovesimage_gen.Real app-server behavior
Ran a redacted, isolated
codex app-server0.147.0 session against the installed pinned package, without changing or restarting the production gateway. The thread usedfeatures.image_generation=falsewhile leaving native multi-agent enabled. The live app-server event stream showed a real child spawn and wait completion:{ "serverVersion": "0.147.0", "model": "gpt-5.4", "appliedConfig": { "features.image_generation": false, "features.multi_agent": true, "features.multi_agent_v2": false }, "events": [ { "event": "item/started", "tool": "spawnAgent", "status": "inProgress" }, { "event": "item/completed", "tool": "spawnAgent", "status": "completed", "receiverCount": 1 }, { "event": "item/started", "tool": "wait", "status": "inProgress", "receiverCount": 1 }, { "event": "item/completed", "tool": "wait", "status": "completed", "childStatus": "completed", "childMessage": "PROBE_CHILD_OK" } ], "final": "DELEGATION_OK=true\nIMAGE_GEN_AVAILABLE=false" }The exact pinned source and its regression establish the image namespace removal; the real app-server trace establishes that delegation remains operational under the same feature override.
Warm retained-thread transition
ClawSweeper's second review raised a possible warm-session bypass. The retained-thread contract already fails closed on this transition:
buildThreadResumeParamsincludes the current OpenClaw deny handoff in the would-be resume config.fingerprintCodexThreadConfighashes that complete config.consumeCodexAppServerLiveThreadrequires exact equality with the retained fingerprint.Commit
ddff5f64808adds a regression through the actual safe-deny input—not a synthetic config patch—and asserts the observable request sequence:Focused verification after adding this coverage: lifecycle bindings 112/112, thread lifecycle 143/143, harness selection 115/115, and Codex harness 32/32. Claude Opus 5 independently audited the fingerprint/ownership flow and found no warm-reuse bypass; it also required the regression to exercise the real safe-deny input, which the final test does.
Maintainer validation (2026-08-16)
Maintainer decision: approved the narrow optional Plugin SDK handoff. A harness that declares an audited exact safe deny must receive that prepared fact and enforce any native equivalent; all undeclared, unknown, wildcard, finite-allowlist, and mixed unsafe policies remain fail-closed.
Independent exact-head proof:
Per the maintainer fast-lane order, final Telegram user proof ran after the passing local ClawSweeper gate and is attached below.
Fresh and retained OpenClaw proof
Ran the pushed exact head 2c61c18 through the real local OpenClaw agent entrypoint with tools.deny: ["image_generate"], openai/gpt-5.6-sol, and the Codex harness. No mock provider or direct app-server override was used.
This exercises the actual OpenClaw policy-to-plugin-to-Codex path for both a fresh and retained session.
Final Telegram real-user proof
Ran the canonical Telegram userbot runner last, with a fresh isolated Gateway and no mock provider (
mockRequests=0).eb174bcaffd: withtools.deny: ["image_generate"], Telegram returnedMAIN_DELEGATION_UNAVAILABLE(Bot API message 48849, 13.151s).2c61c18f4d72540b6d23406e4f62c6c024a279e4: OpenClaw selectedopenai/gpt-5.6-solthrough the Codex harness; the parent rollout invoked nativespawn_agentandwait_agent, the child returnedCHILD_PR_OK, and Telegram returnedPR_DELEGATION_OK IMAGE_GEN_AVAILABLE=false(Bot API message 48853, 9.188s).scripts/e2e/telegram-desktop-recorder.tsis absent on both current main and this PR; no PR code was changed for that infrastructure gap.