Commit Graph

4 Commits

Author SHA1 Message Date
Hiroshi Tanaka 55f1738d50 fix(control-ui): config form save corrupts 64-bit id strings in string|number fields (#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 <noreply@anthropic.com>

* 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 <noreply@anthropic.com>
2026-08-20 08:50:24 -07:00
Peter Steinberger c3ae887f46 fix(ui): autosave acks no longer wipe open add-entry drafts and in-progress JSON (#123502)
A drained autosave ack (and the config.changed refresh path) clones the
whole config form, changing every object/array identity while content is
byte-identical. The collection add-entry draft closed on identity change
and the JSON textarea reset its uncommitted text — the operator's typing
vanished ~1s after any earlier toggle. Both guards now check content
equality when the identity churns; a genuinely external content change
still closes/resets as before.
2026-08-14 04:51:26 -07:00
Peter Steinberger 9aad7e4b0b test(ui): deduplicate config array fixtures (#118557) 2026-08-03 00:34:59 -07:00
Vincent Koc 183db47e97 fix(ui): preserve schema-backed settings edits (#116282)
* fix(ui): harden schema-backed settings controls

Co-authored-by: wangmiao0668000666 <wang.miao86@xydigit.com>

* test(ui): match config secret label in Chromium

* chore(ui): remove release-owned changelog entry

* test(agents): mock incremental registry persistence

---------

Co-authored-by: wangmiao0668000666 <wang.miao86@xydigit.com>
2026-07-30 23:08:53 +08:00