Repository navigation
Conversation
Configuration POST/PATCH used the general 64 KiB body limit, while provisioning accepts 448 KiB and the Kubernetes Configuration Driver stores up to 1 MiB of values. A dedicated Agent provisioned with a ~100 KB Configuration could never save it again, including from the console's Slack editor, which PATCHes the whole Configuration; an embedded Agent launched from such a Preset failed the same way. Configuration writes now allow 6 MiB + 64 KiB: the Driver's 1 MiB of values written with six-byte JSON escapes, plus `kind` and up to 64 Secret bindings. As with Preset writes, onRequest runs the new OpenClawController.authorizeConfigurationWrite (configuration:create on the Namespace or configuration:update on the Configuration) before the body is read, so only callers with the grant can make the controller buffer a large body; the transaction repeats the check with the Secret binding checks. The workspace file PUT allowed 48 KiB (3x the 16 KiB content cap), so 16 KiB of U+0001 (98 KB as JSON) or ASCII-escaped two-byte letters got 413. It now allows 6 x 16 KiB + 1 KiB. Finding 1118.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR raises Configuration and workspace-file request limits and authorizes Configuration writes before reading their bodies. Example: An authorized user saves a Configuration containing 102,400 bytes of plugin notes.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs current request-admission bugs, and both prior findings are resolved in source; no new actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Provenance
Tests
Agent review detailsHow this fits togetherThe Fastify API authenticates requests and applies transport limits before OCC authorizes exact resources, validates content, and invokes Configuration or workspace storage owners. flowchart TB
Client[Authenticated client] --> API[Fastify admission]
API --> IAM[Exact resource IAM]
IAM --> Body[Bounded JSON body]
Body --> OCC[OCC transaction and authorization recheck]
OCC --> Storage[Configuration or workspace owner]
OCC --> Audit[Attributable audit]
Technical reviewBest possible solution: Retain the focused admission repair within the existing API, OCC authorization, and Driver ownership boundaries. Do we have a high-confidence way to reproduce the issue? Source establishes the mismatch: 102,400-byte Configuration values exceed main's 64 KiB route budget, and 16,384 U+0001 characters require about 98 KiB of JSON against a 48 KiB workspace budget; supplied regression results were not independently executed. Is this the best way to solve the issue? The repair fits the existing owners, preserves explicit Configuration body-limit overrides and decoded validation, and repeats exact-resource authorization inside the transaction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 220cc9572400. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 9:28 AM ET / 13:28 UTC (Revision 2). |
…uite Review follow-ups for finding 1118: the Configuration body limit is now 6 x (1 MiB + 32 KiB), so the envelope (kind and up to 64 Secret bindings) is also covered in six-byte escapes. Map configuration-body-limits.test.mjs in checks-baseline-1 (Suite Audit refused the unmapped file), check that an explicit maxBodyBytes still bounds the Configuration routes, and reflow the flow doc paragraph.
Problem
Request-body limits disagreed with the code that consumes the bodies (finding 1118):
createConfigurationandupdateConfigurationused the general 64 KiB limit, whileprovisionAgentaccepts 448 KiB and the Kubernetes Configuration Driver stores up to 1 MiB of values. A dedicated Agent provisioned with a ~100 KB Configuration could never save it again (413). That includes the console's Slack channel editor, which PATCHes the whole Configuration, and an embedded Agent launched from a Preset with such values.putAgentWorkspaceFilecaps content at 16 KiB of UTF-8 but the body at 48 KiB (3x). JSON can need six bytes per content byte, so 16 KiB of U+0001 (a 98 KB body asJSON.stringifywrites it) or 8192 two-byte letters sent as ASCII-only JSON (49,166 bytes) got 413. The Agent create route already reserves 6x.Change
bodyLimit6 x (1 MiB + 32 KiB), about 6.2 MiB: the Driver's 1 MiB of values plus the envelope (kindand up to 64 Secret bindings, under 32 KiB), all written in six-byte JSON escapes. An explicitmaxBodyBytesstill wins, as on the other large routes.onRequestresolves the caller and runs the newOpenClawController.authorizeConfigurationWrite(configuration:createon the Namespace, orconfiguration:updateon the Configuration) before the body is read. Callers without the grant get the same 403/404 and audit row as before, and the controller never buffers their body. The transaction repeats the check, followed by the Secret binding checks that need the body.6 x 16 KiB + 1 KiB(97 KiB).Verification
tests/integration/configuration-body-limits.test.mjs(real HTTP server):tests/conformance/workspace-files.test.mjs: a PUT of 16 KiB of U+0001, of ASCII-escaped two-byte letters, and of fully escaped ASCII succeeds; the existing over-limit case now sends one byte over the new limit and still gets 413.tests/conformance/occ-api-security.test.mjs: an explicit smallermaxBodyBytesstill bounds both Configuration routes (as it does Preset routes).maxBodyBytesignored on the Configuration routes; create or update dropped from the before-body set; update checks the create grant; before-body check a no-op; workspace limit without envelope, +1, or back to 48 KiB).tsc --build, eslint and prettier on touched files clean.checks-baseline-1;run-tests.mjs auditclean.git merge-treeshows the same conflicted files against this branch as against main, so no new conflicts.Risks