fix(cli): preserve numeric config set record keys#83769
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-reproducible: current main chooses array containers for all-digit next path segments in PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the schema-aware config writer fix after normal maintainer review so #83331 can close through this PR. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main chooses array containers for all-digit next path segments in Is this the best way to solve the issue? Yes. Consulting the runtime config schema at the missing-parent path is narrower and more maintainable than hard-coding channel-specific numeric ID paths, and the tests cover both record and list behavior. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against de5f1fa99a09. |
376e731 to
6fb04b8
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
giodl73-repo
left a comment
There was a problem hiding this comment.
Looks good. The fix uses the runtime config schema to choose object versus array containers for missing config-set path parents, which addresses numeric-looking record keys without regressing schema-backed array paths. The PR has focused real CLI proof plus full relevant validation and green CI.
b46046b to
15b06e1
Compare
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Clockwork Test Hopper Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
cb1e6aa to
6d87faf
Compare
6d87faf to
7121fdb
Compare
aa67857 to
cb55b4a
Compare
|
Merged via squash.
Thanks @TurboTheTurtle! |
Fixes #83331.
Behavior or issue addressed:
openclaw config set channels.discord.guilds.<snowflake>.requireMention truecould createguildsas an array because the next path segment was all digits.agents.list.0.*, while keeping schema-backed records such aschannels.discord.guilds.<id>andchannels.telegram.groups.<id>as object keys.Real behavior proof
Behavior or issue addressed:
config setnow preserves numeric-looking record keys under schema-backed object fields instead of materializing those parents as arrays, while still creating arrays for schema-backed list paths.Real environment tested: Local OpenClaw checkout on macOS using the real source CLI entrypoint (
node --import tsx src/entry.ts) withOPENCLAW_CONFIG_PATHandOPENCLAW_STATE_DIRpointed at a mktemp directory. The command wrote an actual tempopenclaw.json; no production user config was modified.Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix:
channels.discord.guilds.1495587801394184362as an object key (discord_guilds_is_array=False).channels.telegram.groups.1495587801394184362as an object key (telegram_groups_is_array=False).agents.list.0.id(agents_list_is_array=True,agents_list=[{'id': 'tech'}]).What was not tested: A globally installed packaged
openclawbinary. The patched source CLI entrypoint was tested with a real temp config file, and the normal test harness covers the same mutation path without touching user config.Validation
Focused regression:
Full validation:
Commit author verification: