Repository navigation
fix(control-ui): config form save corrupts 64-bit id strings in string|number fields - #126402
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 10:51 AM ET / 14:51 UTC. ClawSweeper reviewWhat this changesThe PR changes Control UI schema-form parsing and serialization so mixed string-or-number settings preserve exact large identifier strings during autosave. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still has the number-first mixed-union serializer, while this branch repairs that owner boundary and supplies focused browser and real-Gateway proof. No blocking patch defect found; refresh the clean merge result against current main before landing. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherControl UI turns Gateway configuration snapshots into schema-driven editors, then submits changed form state through Gateway config writes. The changed code chooses and preserves primitive branches before that persistent write boundary. flowchart LR
A[Gateway config snapshot] --> B[Control UI schema form]
B --> C[Scalar and collection editors]
C --> D[Lossless branch selection]
D --> E[Gateway config write]
E --> F[Persisted configuration]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +345, Tests +759, Config +20. Total +1124 across 14 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Integrate the lossless form-boundary repair with current main, retain one shared exact-number parser, and rerun the real-Gateway configuration round trip on the merge result. Do we have a high-confidence way to reproduce the issue? Yes—current main's number-first mixed-union serializer provides a high-confidence source path, and the supplied real-Gateway regression uses an unrelated Control UI save to exercise it. Is this the best way to solve the issue? Yes—the repair acts at the form producer and serialization boundary, rather than attempting to recover rounded identifiers downstream after the Gateway write. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 855599d7e940. 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
HistoryReview history (21 earlier review cycles; latest 8 shown)
|
Saving the schema-driven config form coerced every numeric-looking string to a JS number before submission. For union-typed fields such as tools.elevated.allowFrom.* (anyOf: string | number), string entries holding 64-bit ids (Discord/Telegram snowflakes) were rewritten through Number(), which rounds past 2^53: "1048113311314608148" -> 1048113311314608100. The corruption also hit untouched fields, because serialization coerces the whole form, so merely saving an unrelated setting silently broke elevated-approval allowlists (fail-closed: the real user id no longer matched). Two guards fix this: - coerceFormValues keeps a string that already satisfies a string variant of an anyOf/oneOf union instead of parsing it into another variant's number. - coerceConfigFormNumberString refuses lossy integer parses: plain integer text beyond Number.MAX_SAFE_INTEGER that does not round-trip through BigInt stays a string, so pure number/integer fields fail validation loudly instead of storing a corrupted id. Co-Authored-By: Claude Fable 5 <[email protected]>
73033af to
b4a92c5
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdbfb2b339
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Merged via squash.
|
…g|number fields (openclaw#126402) * fix(control-ui): stop config form save from corrupting 64-bit id strings Saving the schema-driven config form coerced every numeric-looking string to a JS number before submission. For union-typed fields such as tools.elevated.allowFrom.* (anyOf: string | number), string entries holding 64-bit ids (Discord/Telegram snowflakes) were rewritten through Number(), which rounds past 2^53: "1048113311314608148" -> 1048113311314608100. The corruption also hit untouched fields, because serialization coerces the whole form, so merely saving an unrelated setting silently broke elevated-approval allowlists (fail-closed: the real user id no longer matched). Two guards fix this: - coerceFormValues keeps a string that already satisfies a string variant of an anyOf/oneOf union instead of parsing it into another variant's number. - coerceConfigFormNumberString refuses lossy integer parses: plain integer text beyond Number.MAX_SAFE_INTEGER that does not round-trip through BigInt stays a string, so pure number/integer fields fail validation loudly instead of storing a corrupted id. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(control-ui): harden 64-bit config id preservation * fix(control-ui): validate mixed-union scalar branches * test(control-ui): prove real gateway id preservation * test(control-ui): use communications route for config proof * test(control-ui): grant config proof admin scope * test(control-ui): reopen raw config for proof * fix(control-ui): preserve explicit union input types * test(control-ui): exercise union collection draft * ci: retry flaky control ui e2e * fix(control-ui): preserve mixed scalar branch types * ci: retry service worker e2e * fix(control-ui): preserve typeless string union branches * fix(control-ui): reject lossy decimal coercion * fix(control-ui): reject lossy pure numeric input * fix(control-ui): preserve exact numeric branch semantics * ci: retry checkout rate limit * ci(control-ui): capture real gateway proof * test(control-ui): frame config proof values * ci: retry checkout download * test(control-ui): prove Gateway-served production bundle * fix(control-ui): preserve exact incremental union edits * refactor(control-ui): isolate scalar edit session state * fix(control-ui): keep scalar edit branch type internal * fix(control-ui): avoid detached focus selector * fix(control-ui): round-trip exact numeric branches * refactor(control-ui): share exact scalar formatting --------- Co-authored-by: Claude Fable 5 <[email protected]>
Closes #126401
What Problem This Solves
The schema-driven Control UI settings form could silently change stored 64-bit identifier strings into rounded JavaScript numbers when any unrelated form field auto-saved. The observed value
"1048113311314608148"became1048113311314608100, which broke the elevated-exec approver match without a visible error.The historical write path is now reconciled with source: at 2026-08-19 13:01:13 JST the Gateway recorded a successful
config.setwhose changed paths includedtools.elevated.allowFrom.discord; nearbyconfig.patchwrites changed only UI preferences ortools.swarmand were not the destructive write.Why This Change Was Made
Form submission serialized the whole draft and offered numeric-looking strings to a number branch before retaining the authored string branch. Collection drafts had a second loss path: an unquoted string-or-number array item was passed through
JSON.parse, which rounds large integers before submit-time code can recover the original text.This change keeps the repair at form serialization and the input producer boundaries:
BigInt(number)instead of trustingNumber.toString(). Exact values (including2^53and zero with large exponents) remain numbers; genuinely lossy values fail validation or use an allowed string branch, while ordinary decimal spellings retain their established form semantics.Non-goal: this PR does not change form dirty-state tracking.
User Impact
Existing and newly added Discord/Telegram/channel/approval identifiers in string-or-number config fields survive Control UI saves byte-identical and retain string type. Exactly representable number and boolean fields continue to coerce from text as before.
Evidence
oneOf: string | numberidentifier survives an unrelated save; non-representable numeric-only text remains a string for Gateway rejection.1e5remains numeric.falseliteral commits as boolean, and a newly authored unsafe 64-bit identifier remains a string. A focused 19-digit edit is typed one character at a time with a rerender after every accepted patch; the final persisted value is the exact string.Number.MAX_SAFE_INTEGER,2^53, negative values, exponent notation, and.0notation.Number()would silently round to a different integer, decimal, or zero (including1.0000000000000001,9007199254740991.1,1e-324, and the shortest-decimal masking case1000000000000000100whose actual double integer is1000000000000000128).config.setpayload, resolves the mocked Gateway write, reloads the page, and reads the exact quoted identifier back from Raw mode.dist/control-ui, serves that directory from the Gateway, matches the Gateway-served fingerprinted JS bytes to the built file by SHA-256, confirms Chromium loaded that asset path, then changes an unrelated response prefix through the Settings form. It observes one successfulconfig.set, reads the temp config file, reconnects, and confirms quoted Raw-mode read-back.578605eca79df982d8b581af3e16c4bf4d029f79: before/after screenshots visibly show the same quoted synthetic ID"9223372036854775807"while onlyproof-beforechanges toproof-after. The redacted trace records{"configSetRequests":1,"identifierMatches":true,"identifierType":"string","method":"config.set","persistedPrefix":"proof-after","rawReadbackQuoted":true,"servedAssetLoaded":true,"servedAssetPath":"assets/index-BLuV7lQc.js","servedAssetSha256":"0b309e2d2c8aca1dae709c6eec48c0b3a752161dc056fd7fb5a4bf3e75969f3c","uiSource":"gateway-dist-control-ui"}. The proof job and artifact succeeded; remaining fork jobs were intentionally cancelled afterward.578605eca79df982d8b581af3e16c4bf4d029f79: all 149 jobs completed with no failures in run 32375940965, including the finalopenclaw/ci-gate.config-safe-write.e2e.test.tspassed 4/4, including the unrelated-save identifier round-trip.uiSource: gateway-dist-control-ui, a loaded asset path and matching SHA-256, oneconfig.set, exact string type/value, quoted Raw-mode read-back, and clean shutdown; all 3 auth/transport tests passed.2^53boundaries, type-less stringconst/enumbranches, edit-session branch stability, and hidden IEEE-754 integer rounding were independently reproduced and fixed without retyping loaded identifier strings.🤖 Generated with Codex