-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
config patch/set coerce numeric-string object keys into array indices #83331
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
openclaw config patchandopenclaw config setcoerce all-digit string keys into array indices. This breaks valid Record-typed config paths such aschannels.discord.guilds, where Discord snowflake IDs are string keys but look numeric.Environment
Reproduction
Create two minimal patch files:
Then run:
Expected
Numeric-looking string keys should remain string keys for Record/object fields. Both patch and set operations should preserve the object shape of
channels.discord.guilds.Actual
The numeric-key patch fails validation:
The non-numeric key patch passes, which suggests the failure is caused by numeric-key coercion rather than the value shape.
config setshows the same class of failure for the same reason.Why this matters
Discord guild IDs are all-digit strings by design. Any Record-typed config that accepts numeric IDs becomes hard or impossible to write through the CLI patch/set path, even though the on-disk JSON shape is valid and the runtime reader handles it correctly.
Suggested fix
config setpath parsing can target string-keyed object members whose keys are numeric strings.Notes
AoAOS workaround: write the final config atomically with Python/JSON instead of using the CLI patch path.
Source doc:
docs/upstream-bugs/config-patch-numeric-key-array-coercion.md