Repository navigation
fix(codex): scope app approvals to native threads - #137383
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Ready to land at bf48c73. Required CI run 33774038922 passed. Local proof passed all 273 tests across lifecycle inventory, plugin config, side questions, startup, and scheduled authority; the six-path changed gate passed typechecks, lint, policy guards, dead-export scans, and import cycles. Exact commands are in the PR body. Independent Codex autoreview is clean through P2. Pre-fix lifecycle proof had four failures and 27 passes. The real Codex 0.153.0 app-server confirmed that durable-only cleanup left one synthetic write executable without approval in the same loaded thread; native reload caused an approval request, and declining prevented execution. A separate apps-disabled native thread completed without app tools or its app MCP server. Services were synthetic and local; external connector authentication was not exercised. The fix stays in the native policy owner, removes the redundant ordinary-turn timeout predicate, and reduces production code by seven lines. All three rank-up moves from the final #137167 review are addressed. No configuration, schema, or stored-format changes are introduced. The latest ClawSweeper comment currently reports review started; no new findings are published. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 1:06 PM ET / 17:06 UTC. ClawSweeper reviewWhat this changesMoves Codex connected-app approval policy into each native thread’s session configuration and preserves literal dynamic-tool keys in policy projection and fingerprints. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 1 item remains Keep open. No blocking defect was found: the branch replaces durable native-config writes and best-effort reload with a higher-precedence native thread-session overlay, preserving approval enforcement across reload, fork, and scheduled paths. Priority: P1 Review scores
Verification
How this fits togetherThe Codex plugin translates OpenClaw app policy into native Codex thread configuration before connected-app tools run. That configuration determines whether a tool is exposed and whether its action must request approval. flowchart TD
A[OpenClaw app policy] --> B[Approval projection]
B --> C[Native thread session overlay]
D[User config reload] --> C
E[Scheduled policy ceiling] --> B
C --> F[Codex approval decision]
F --> G[Connected app tool execution]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -87, Tests -89, Docs +7, Other 0. Total -169 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Land the owner-boundary repair after normal exact-head CI, retaining native session projection and tracking administrative-requirements handling separately upstream. Do we have a high-confidence way to reproduce the issue? Yes. The supplied real Codex 0.153 app-server probes exercise ordinary, reloaded, forked, and scheduled-policy paths; direct source inspection identifies the same owner and approval decision path. Is this the best way to solve the issue? Yes. Codex’s native session-layer precedence and reload behavior make a thread-local overlay the correct owner-boundary fix; the removed durable-write/reload approach was explicitly best-effort. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 61c67cc8a686. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Replace durable approval writes and best-effort reload with session overlays shared by normal, forked, and scheduled threads. Preserve native settings and literal configuration keys, invalidate old bindings, and keep ordinary apps-disabled timeout recovery. Native runtime probes and 282 focused tests cover the repaired policy boundary.
Keep native schema, app-policy, and MCP configuration keys as own JSON properties through stabilization and authorization redaction. Share identical plugin policy serialization with scheduled authority, preserve ordinary fingerprint bytes, and reduce the assertion baseline after removing a cast. Four regressions failed before the fix; all 327 focused tests and independent review pass.
|
@clawsweeper re-review The current head is The completed repair also preserves literal JSON keys in approval projection, merged configuration, and binding fingerprints. A native Validation: 327 focused tests pass across eight files; the full changed-file checks pass, including production/test type checks, full extension lint, dead exports, and runtime import cycles. Whole-branch and follow-up independent Codex reviews are clean through P2. Real Codex 0.153.0 app-server tests used the production helper with synthetic localhost provider/MCP services; no real credentials or external connector authentication were used. An apps-disabled native turn exposed no app tools despite saved enablement. The PR body contains the native source evidence, minimum-version proof, and the separate pre-existing administrative-requirements follow-up. Final production delta is -87 lines; tests -89; no new user option, schema, storage format, or protocol version. Exact-head hosted CI is running. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Follow-through for the latest data-model compatibility checklist: verified against the PR base that authority capture, parsing, auth types, and payload construction are byte-identical. The removed local serializer and the shared serializer produce identical authority fingerprints. A direct old-module/new-module probe reopened 64 serialized version-1 authority payloads spanning both auth variants, all four app approval modes, all four tool modes, and ordinary/literal tool names. Every old/new fingerprint matched, and the readers left each payload unchanged. The no-authority case also matched. {"payloadsReopened":64,"identicalFingerprints":true,"payloadMutation":false,"captureParserAuthAndPayloadSourceUnchanged":true,"schemaVersion":1}This is a runtime policy projection repair and serializer deduplication, with no persistent data-model change or required migration. The native session layer outranks user/project settings, while legacy managed layers and administrative requirements retain their authority, as documented and tested. The full exact-head CI run is green: https://github.com/openclaw/openclaw/actions/runs/33781795118 . GitHub rejected the first merge request because main changed during dispatch; the PR remains open with no merge event, and the native recovery workflow retains that rejected attempt before retrying. |
|
Merged via squash.
|
Apply connected-app ask policy through native thread session overrides, preserving saved native preferences across warm reuse, cold resume, user-config reload, side-question forks, and scheduled turns. Remove durable approval writes, readback, and the best-effort reload dependency. Keep scheduled tool ceilings and reject legacy-managed app layers that outrank session configuration. Preserve literal JSON property names through approval projection, configuration merge, and binding fingerprints so changed dynamic schemas, app links, and MCP settings invalidate the correct binding. Share identical ordinary/scheduled policy serialization. Ordinary inventory timeouts continue with apps disabled; scheduled authority remains strict. Validation: 327 focused tests; full changed-file type, lint, boundary, dead-export, and cycle checks; independent Codex review. Real Codex 0.153.0 app-server probes with synthetic localhost services verify approval before execution, denied calls executing nothing, unchanged saved settings, apps-disabled recovery, and literal schema transport. Related: openclaw#137167. Production net -87 lines. No new user option, database schema, storage format, or protocol version. Native administrative requirements remain authoritative; exposing effective app requirements is recorded as a separate follow-up in the PR.
Related: #137167.
What Problem This Solves
A warm Codex conversation in
askmode could keep a saved connected-app approval after OpenClaw cleared it. Native config readback describes the current configuration, while tool calls use the loaded thread's captured layers. The first proposed fix requested a reload, but Codex can acknowledge the write while an individual thread reload fails. Ordinary app-inventory timeouts also stopped conversations that could safely continue without apps.Why This Change Was Made
App admission now projects the writable-tool and account-link approval settings into the native session configuration. The native merge gives these settings precedence over user/project configuration, and subsequent user-config reloads preserve them. This removes the durable config writes, readback requests, reload dependency, and obsolete failure paths. Saved native settings, read-only tool policy, disabled tools, and unrelated app policy stay intact.
Normal, resumed, and
/btwfork paths share this projection. Existing binding fingerprints refresh cold configurations and rotate warm bindings when override keys change; a private fingerprint revision also invalidates bindings created before this repair. Scheduled authority applies the same link policy after intersecting current and captured approval modes, then keeps its stricter per-tool ceilings. Active legacy-managed app settings outrank session flags, so admission rejects those layers with migration guidance, using the same native precedence set as restricted turns.Literal-key preservation also covers binding fingerprints: changes to native dynamic-tool schemas, app-link policy, and MCP settings now invalidate identity correctly. Authorization redaction and ordinary fingerprint bytes are preserved. The identical ordinary/scheduled policy serializer is shared, and the assertion baseline decreases for a removed cast.
Ordinary inventory timeouts use the existing
features.apps=falserecovery. Scheduled runs still stop when their captured authority cannot be verified. No new user configuration, schema, storage format, migration, or protocol version is introduced.Production: +148/-235, net -87 lines, including shared config-layer and policy-serialization declarations. Guard metadata: +1/-1 (assertion allowance lowered). Tests: +760/-849, net -89, replacing obsolete write/readback fixtures with owner and lifecycle coverage. Docs: +13/-6.
User Impact
askpolicy applies to the admitted native thread without modifying shared saved preferences. Existing warm conversations remain warm while their projected policy is unchanged. Ordinary conversations continue without app tools during inventory timeouts; scheduled automations retain their authorization ceiling.Evidence
__proto__tool-title/link keys being lost during object assignment. The native probe reproduced one synthetic write with zero approval requests. Approval projection now creates own data properties, and the shared configuration merge preserves them through JSON serialization; the same native probe then requested approval and denied execution.@openai/[email protected]app-server, using the production approval projection helper and synthetic localhost provider/MCP: ordinary, same-thread-after-reload, forked, and scheduled-policy calls each requested one approval; declining each produced zero tool executions. Saved automatic overrides remained unchanged. A separate native probe completed with apps disabled and no exposed app namespace or app MCP server despite saved app enablement. The native model request also retained a literal__proto__dynamic-schema property. Four fingerprint collision regressions failed before the shared-owner repair and passed afterward. No real credentials or external services were used; these are native-runtime tests with synthetic services.{"nativeRuntime":"0.153.0","productionHelperUsed":true,"savedOverridesPreserved":true,"ordinary":{"approvalRequests":1,"toolExecutions":0},"afterUserReload":{"approvalRequests":1,"toolExecutions":0},"fork":{"approvalRequests":1,"toolExecutions":0},"scheduledPolicy":{"approvalRequests":1,"toolExecutions":0}}Direct dependency evidence at
openai/codexcommit41e22fee981a63b3698df7ed36bad393cda24715:Review Follow-through
The reload-acknowledgment finding and rank-up request are resolved by removing reload from admission altogether. Unit, lifecycle, native-runtime, and scheduled-sibling evidence cover the replacement. The ordinary timeout and scheduled strictness findings from #137167 remain addressed.
Named follow-up: native administrative requirements can independently force automatic review or per-tool approval. This pre-existing policy precedence is outside saved user/project overrides, and 0.153.0 does not expose app requirements through
configRequirements/read(native policy, exported requirements). The docs now make administrative authority explicit; exposing that upstream contract and surfacing conflicting effective policy is separate work.