Fix config.patch explicit array replacement#91551
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 8, 2026, 10:27 PM ET / 02:27 UTC. Summary PR surface: Source +275, Tests +493, Docs +11, Other +14. Total +793 across 28 files. Reproducibility: Do we have a high-confidence way to reproduce the issue? Yes from source and the linked report: current main lets config.patch write a shorter non-id array over the existing config after a config.get round-trip; I did not execute the repro because this review is read-only. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land a maintainer-approved fail-closed config.patch contract with clear upgrade/release-note context: unconfirmed destructive array writes reject, and intentional array replacement uses Do we have a high-confidence way to reproduce the issue? Do we have a high-confidence way to reproduce the issue? Yes from source and the linked report: current main lets config.patch write a shorter non-id array over the existing config after a config.get round-trip; I did not execute the repro because this review is read-only. Is this the best way to solve the issue? Is this the best way to solve the issue? Yes, if maintainers accept the compatibility tradeoff: Gateway-side intent enforcement is the right owner boundary for preventing destructive RPC writes, and the PR updates the protocol/tool/docs/test callers that need the new contract. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 82afc4678ace. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +275, Tests +493, Docs +11, Other +14. Total +793 across 28 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
* fix config patch explicit array replacement * fix generated config patch protocol model * fix config patch test helper typing * fix shared auth patch replacement tests * update config patch prompt snapshots * harden qa lab config patch replace paths
* fix config patch explicit array replacement * fix generated config patch protocol model * fix config patch test helper typing * fix shared auth patch replacement tests * update config patch prompt snapshots * harden qa lab config patch replace paths
Summary
replacePathscontract for destructiveconfig.patcharray replacement.config.patchpayloads that would remove existing array entries, including nested arrays under id-keyed config arrays.Refs #90540
Verification
.agents/skills/autoreview/scripts/autoreview --mode localautoreview clean: no accepted/actionable findings reportedrun_c11f1f03de06, provideraws, leasecbx_baaa409355ec, machinec7a.8xlarge, exit0config.patchattempt from 82 bindings to 2 was rejected; disk remained at 82 and hash stayed unchanged.replacePaths: ["bindings"]succeeded and disk moved to 2 entries intentionally.src/gateway/server.config-patch.test.tssrc/agents/tools/gateway-tool.test.tssrc/agents/openclaw-gateway-tool.test.tsextensions/qa-matrix/src/runners/contract/runtime.test.tsextensions/qa-matrix/src/runners/contract/scenarios.test.tspackages/gateway-protocol/srcpnpm test src/gateway/server.config-patch.test.tspnpm test src/agents/tools/gateway-tool.test.ts src/agents/openclaw-gateway-tool.test.tspnpm test src/config/merge-patch.test.ts extensions/qa-matrix/src/runners/contract/runtime.test.ts extensions/qa-matrix/src/runners/contract/scenarios.test.ts packages/gateway-protocol/srcpnpm format:docsgit diff --checkswift buildinapps/shared/OpenClawKitKnown proof gaps:
swift testinapps/shared/OpenClawKitstill fails existing unrelatedTalkConfigContractTests.selectionFixturesfixture expectations.xcodebuildcompiled the touched Design files, then failed existing unrelatedapps/ios/Sources/Onboarding/QRScannerView.swift/AppleReviewDemoModeresolution.Real behavior proof
Behavior addressed:
config.patchcould silently remove existing array entries after a truncatedconfig.getround-trip.Real environment tested: AWS Crabbox Linux host via Gateway WebSocket RPCs and on-disk config verification.
Exact steps or command run after this patch:
pnpm crabbox:run -- --provider aws --idle-timeout 90m --ttl 240m --timing-json --script-stdinwith a temporary Gateway RPC proof plus focused regression tests.Evidence after fix: Crabbox
run_c11f1f03de06printedE2E_REGRESSION_REPRO_SUMMARYshowing rejected destructive patch and unchanged disk, thenE2E_FIX_PROOF_SUMMARYshowing explicitreplacePathsreplacement was accepted.Observed result after fix: Unconfirmed destructive array patch from 82 bindings to 2 was rejected; confirmed replacement with
replacePaths: ["bindings"]succeeded.What was not tested: Full Control UI browser flow; this bug’s mutation contract was proven at Gateway RPC and disk-write level.