Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 2:14 AM ET / 06:14 UTC. Summary PR surface: Source +28, Tests +141, Docs +10. Total +179 across 5 files. Reproducibility: yes. with medium confidence: the PR gives a concrete current-main scenario using a valid 32 MiB JSON plan and records the differing apply diagnostic, but this review did not independently execute that path. Review metrics: 1 noteworthy metric.
Stored data model 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
Maintainer decision needed
Security Review detailsBest possible solution: Confirm that 16 MiB is the intended long-term serialized secrets-plan contract for existing and external workflows, then retain the matched configure/apply boundary and documentation as the canonical behavior. Do we have a high-confidence way to reproduce the issue? Yes, with medium confidence: the PR gives a concrete current-main scenario using a valid 32 MiB JSON plan and records the differing apply diagnostic, but this review did not independently execute that path. Is this the best way to solve the issue? Unclear until the ceiling is accepted: sharing one bounded serialized-file contract across generation and application is the maintainable implementation, while the chosen 16 MiB value needs maintainer confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5bfd03b845f2. Label changesLabel justifications:
Evidence reviewedPR surface: Source +28, Tests +141, Docs +10. Total +179 across 5 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
Review history (3 earlier review cycles)
|
4fe4d14 to
f1151ce
Compare
f1151ce to
f37fd3f
Compare
|
Merged via squash.
|
…109652) * fix(cli): reject oversized secrets plan files * fix(cli): keep generated secrets plans applyable * fix(cli): reject special plan files without blocking * docs(cli): refresh secrets plan documentation map
…109652) * fix(cli): reject oversized secrets plan files * fix(cli): keep generated secrets plans applyable * fix(cli): reject special plan files without blocking * docs(cli): refresh secrets plan documentation map
What Problem This Solves
Fixes an issue where operators running
openclaw secrets apply --from <path>could make the CLI fully allocate and parse an arbitrarily large plan file before its shape was validated. A 32 MiB valid JSON file reached plan validation instead of being rejected at the file boundary, creating avoidable memory pressure before either dry-run or mutation could begin.Why This Change Was Made
The serialized plan-file boundary now has one 16 MiB contract for both commands that own it.
secrets configure --plan-outmeasures the exact UTF-8 bytes of its pretty-printed JSON before writing, whilesecrets apply --fromopens the path non-blockingly, verifies the pinned descriptor is a regular file, and uses the existing bounded reader. This prevents configure from emitting a plan file that apply would reject solely because of its size, and prevents FIFO paths from stalling before regular-file validation.The limit is shown in both CLI help paths and documented in the canonical plan contract and Secrets CLI reference for hand-written plans and external generators. Plan schema, target validation, provider behavior, in-memory configure/apply behavior, and apply semantics are unchanged.
A fresh semantic recall checked 26 open pull requests. The closest changes improve malformed-JSON and missing-file diagnostics in the same reader, but neither bounds successful file reads or aligns generated-plan output with an apply-time byte contract.
User Impact
Oversized secrets plans now fail early with a clear byte-limit error instead of being fully loaded and parsed. FIFO and other special-file paths are rejected without waiting for a writer. Plans at or below 16 MiB can still be generated and applied. If interactive configuration would produce a larger file,
--plan-outnow fails before creating an unusable artifact.Evidence
Real CLI proof on the fixed apply path:
The 32 MiB fixture was valid JSON (whitespace followed by
{}), and the output did not reach the previousInvalid secrets plan filediagnostic. The same real CLI check on the pinned latest-main snapshot still reachedInvalid secrets plan file, confirming the problem remained upstream before this patch.Focused validation after review feedback:
The regression coverage drives the real Commander actions and locks both sides of the serialized contract: configure writes an exact 16 MiB plan, rejects a 16 MiB + 1 byte plan without creating the output file, apply rejects an oversized input before
runSecretsApplyis called, and a writerless Unix FIFO is rejected within a one-second bound. Gateway startup is not part of this behavior because plan-file serialization and loading complete in the standalone CLI before apply or any Gateway interaction begins.