Repository navigation
fix: allow plugin state values up to 1 MiB - #130387
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
20e2e66 to
4557e92
Compare
|
Codex review: found issues before merge. Reviewed August 26, 2026, 5:13 PM ET / 21:13 UTC. ClawSweeper reviewWhat this changesThe branch raises plugin keyed-state JSON values to 1 MiB, updates boundary tests and SDK documentation, and makes package tar operations use local archive paths on Windows. Merge readinessKeep this maintainer-authored, maintainer-labeled PR open. Raising the shared value cap multiplies the already-known unbounded Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherPlugin keyed state is SQLite-backed durable JSON storage used by trusted plugins; Codex thread bindings are one consumer. Its public flowchart LR
A[Plugin or Codex binding] --> B[Keyed state write]
B --> C[JSON byte limit]
C --> D[SQLite state row]
D --> E[Plugin entries read]
E --> F[In-memory JSON array]
G[Package tarball] --> H[System tar helper]
H --> I[Package artifact]
Decision needed
Why: The cap affects all trusted plugin namespaces, while changing Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +14, Docs 0, Other +16. Total +30 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Introduce a compatibility-reviewed bounded or paginated enumeration path, migrate relevant consumers, and only then raise the shared keyed-state value limit or document an explicit accepted availability tradeoff. Do we have a high-confidence way to reproduce the issue? Yes, by source: the PR allows 1 MiB JSON values while the documented 50,000-row plugin fuse and whole-array Is this the best way to solve the issue? No: a global write-cap increase without a bounded enumeration plan worsens the known availability boundary tracked by #105002. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 771336481e41. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
|
|
Maintainer decision and review closeout:
Both rank-up items are addressed: the bounded-enumeration decision is explicitly recorded with its named follow-up, and the direct pinned Codex contract plus real behavior were verified. No further production change is requested for these findings. |
|
Merged via squash.
|
* fix: allow plugin state values up to 1 MiB * test: type-check plugin state write rejection cases * fix(ci): keep tar archive paths local on Windows
Related: #129597, #128362, #126986. Separate follow-up: #105002.
What Problem This Solves
Fixes an issue where users starting or resuming Codex-backed conversations could fail before model execution when the frozen workspace instruction snapshot exceeded the plugin keyed-state limit of 65,536 bytes. The workspace bootstrap budget is measured in characters, but the saved JSON is measured in UTF-8 bytes, so a permitted multibyte instruction file can cross that limit.
Why This Change Was Made
Maintainer decision: raise the shared plugin keyed-state JSON value limit to 1 MiB (1,048,576 bytes) for all plugins. Keep the existing single-row binding and its atomic mutation/lifecycle ownership. No Codex-specific exception, new store, migration, schema change, or blob lifecycle is necessary for this decision.
The limit includes JSON encoding overhead. Namespace entry limits, the plugin-wide entry fuse, TTL behavior, and the separate 64 KiB blob-metadata limit are unchanged. Larger individual values increase the existing eager-enumeration memory ceiling; aggregate/paged enumeration remains the separately tracked #105002 concern, not a claim resolved by this PR.
CI repair included: the test merge picked up #130335 from
main, whose package-mode normalization passed absolute Windows archive paths to GNU tar. Windows CI failed withCannot connect to C: resolve failed. The three existing system-tar archive operations now use an archive basename with its containing directory as cwd, retaining the extraction destination and platform-independent system-tar contract. This covers both package normalization and the sibling bundled-runtime extraction; no package dependency or GNU-only flag was added.User Impact
Plugins can persist larger JSON values through both synchronous and asynchronous keyed APIs. Codex can retain larger frozen instruction snapshots without truncation or changing its restart/resume semantics. Values over 1 MiB still fail explicitly, and a rejected update leaves the prior value intact.
Evidence
PLUGIN_STATE_LIMIT_EXCEEDED: plugin state value exceeds 65536 byte limit.openclaw agent --localCLI usingopenai/gpt-5.6-luna, isolated temporary state, and the configured Codex runtime with no fallback. A 72,496-byte frozen developer-instruction snapshot was persisted in an 81,164-byte binding. After the CLI/native runtime exited, the workspace file was changed and a second CLI process resumed the same native thread. It returned the original marker (which had not appeared in the first assistant reply), and the saved instruction SHA-256 remained identical. Both turns exited 0; no tools were called.4557e92aa4b1fa116862aa3d4d6e7002f8f65262: all 129 focused tests passed again, and the authenticated cold-resume proof passed again. Native rollout metadata confirmed Codex 0.149.1. The final run retained thread01a03fe5-9d1d-7010-ac99-b175fc66417band instruction hash60af6696d3a26faa9c201e0e5d297b6bb4f8b8a1cedfdc28f66c0e923b0cc00eacross the restart.Direct dependency contract checked against Codex
rust-v0.149.1(ff29a44391deccde0aba0f8390337d7f3c319ea4), matching the plugin pin:codex-rs/app-server-protocol/src/protocol/v2/thread.rs:103,392accepts developer instructions on start and resume;codex-rs/core/src/session/mod.rs:657,695restores base instructions from history but takes developer instructions from the supplied configuration;codex-rs/protocol/src/protocol.rs:2871does not persist a developer-instruction field in session metadata. OpenClaw therefore still owns preserving and resupplying its exact frozen snapshot.Plugin runtime delta: +1/-1, net zero. Tests: +36/-22, net +14; docs: +1/-1. The bounded packaging-tooling repair is +28/-12, mostly formatter wrapping around the three changed archive arguments/cwd pairs; the additional behavior is required for Windows path correctness. No new production abstraction was added.
Release-note context: Plugin state now accepts JSON values up to 1 MiB, allowing larger frozen Codex workspace instructions to persist across restarts.
AI-assisted: yes.
Named follow-up: the existing multi-session probe in
src/gateway/gateway-codex-harness.live.test.tsstill supplies the retireduntrustedapp-server approval-policy value. The live probe above uses the currenton-requestvalue. This unrelated test-fixture cleanup is not included in the storage-limit change.