Skip to content

fix(config): render validation array indices with brackets#104935

Merged
steipete merged 2 commits into
openclaw:mainfrom
VectorPeak:fix/config-validation-array-index-path-v2
Jul 17, 2026
Merged

fix(config): render validation array indices with brackets#104935
steipete merged 2 commits into
openclaw:mainfrom
VectorPeak:fix/config-validation-array-index-path-v2

Conversation

@VectorPeak

@VectorPeak VectorPeak commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Related: #104854

What Problem This Solves

Fixes an issue where users reading openclaw config validate output would see array indexes as dotted object properties, for example agents.list.0.tools.profile instead of agents.list[0].tools.profile.

This is limited to human-facing validation output. It does not add line numbers or rejected-value rendering.

Why This Change Was Made

ConfigValidationIssue.path is a machine-readable dot path used by JSON, gateway, daemon, and other shared consumers. This revision keeps that contract unchanged and applies bracket notation only while formatting terminal issue lines.

The formatter traverses the include/env-resolved snapshot.sourceConfig, so it brackets a numeric segment only when its actual parent is an array. Numeric object keys such as diagnostics.otel.headers.0 remain dotted. No validation producer, protocol field, or persisted config shape changes.

User Impact

Human CLI output distinguishes arrays from object properties:

Before: agents.list.0.tools.exec.commandHighlighting
After:  agents.list[0].tools.exec.commandHighlighting

Machine output remains compatible:

{ "path": "agents.list.0.tools.exec.commandHighlighting" }

Evidence

Current-head live proof used a root config that $included the invalid agents.list entry and also contained the numeric object key diagnostics.otel.headers.0.

node --import tsx src/entry.ts config validate
OpenClaw config is invalid: <redacted>/openclaw.json
  ? diagnostics.otel.headers.0: Invalid input: expected string, received boolean
  ? agents.list[0].tools.exec.commandHighlighting: Invalid input: expected boolean, received string (allowed: true, false)
terminal_exit=1
{
  "valid": false,
  "issues": [
    {
      "path": "diagnostics.otel.headers.0",
      "message": "Invalid input: expected string, received boolean"
    },
    {
      "path": "agents.list.0.tools.exec.commandHighlighting",
      "message": "Invalid input: expected boolean, received string (allowed: true, false)",
      "allowedValues": ["true", "false"]
    }
  ]
}

Focused coverage on head 8f26d7e72c7:

  • node scripts/run-vitest.mjs run src/config/issue-format.test.ts src/cli/config-cli.test.ts - 2 files passed, 136 tests passed
  • repository oxfmt on the touched files - passed
  • single-file test typecheck - no src/cli/config-cli.test.ts errors
  • git diff --check upstream/main..HEAD - passed
  • current-head GitHub CI: 80 passed, 35 scope-skipped, no failed or pending checks

Tests cover invalid issues, valid warnings, $include-resolved arrays, binding-union paths, manual issues, numeric object keys, absent display context, and unchanged --json paths.

Possible call chain / impact

config file + $include/env resolution
  -> snapshot.sourceConfig
  -> validation issues keep dotted paths
  -> config validate --json serializes dotted paths unchanged
  -> non-JSON config validate passes sourceConfig as displayRoot
  -> terminal formatter brackets only real array indexes

Unaffected surfaces include ConfigValidationIssue.path, JSON and gateway responses, daemon/status summaries, config get/set path syntax, validation producers, and numeric record keys.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 12, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 7:34 PM ET / 23:34 UTC.

Summary
The branch refactors identity-avatar validation issues to retain typed path segments while preserving the dotted ConfigValidationIssue.path contract.

PR surface: Source +8, Tests +1. Total +9 across 2 files.

Reproducibility: yes. from source: direct identity-avatar validation issues retain only a dotted string on current main, so a failing agents.list[0].identity.avatar diagnostic lacks the typed numeric segment the display formatter needs. The repository sandbox did not permit a local read command to run the CLI path.

Review metrics: none identified.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Post redacted exact-head terminal output for an invalid agents.list[0].identity.avatar value, showing bracketed terminal output and unchanged dotted --json output.
  • [P1] Confirm the failed compact shard is unrelated or repair it, then wait for the remaining exact-head checks.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body contains credible redacted terminal and JSON output for the earlier formatter head, but the latest head adds the identity-avatar-specific path-metadata repair and lacks an exact-head run of that behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The supplied live terminal proof demonstrates the earlier generic formatter head, not the latest identity-avatar-specific head; merge should wait for a redacted exact-head invalid-avatar terminal transcript or equivalent maintainer-run evidence.
  • [P1] Several exact-head checks are still in progress and one compact shard is reported failed in the supplied check state; inspect that failure against the latest head before merging.

Maintainer options:

  1. Decide the mitigation before merge
    Keep typed segments as internal display metadata, preserve dotted machine-readable paths, and merge this focused producer repair once exact-head invalid-avatar behavior and the current check result are verified.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No mechanical repair is indicated; ordinary maintainer verification must confirm exact-head real behavior and the current CI result before merge.

Security
Cleared: The patch only preserves internal validation-path metadata and adds a regression assertion; it introduces no dependency, workflow, permission, secret, or code-execution change.

Review details

Best possible solution:

Keep typed segments as internal display metadata, preserve dotted machine-readable paths, and merge this focused producer repair once exact-head invalid-avatar behavior and the current check result are verified.

Do we have a high-confidence way to reproduce the issue?

Yes from source: direct identity-avatar validation issues retain only a dotted string on current main, so a failing agents.list[0].identity.avatar diagnostic lacks the typed numeric segment the display formatter needs. The repository sandbox did not permit a local read command to run the CLI path.

Is this the best way to solve the issue?

Yes for the remaining edge: attach typed segments at the producer while retaining the existing dotted path, rather than changing the shared validation, JSON, gateway, or daemon contract.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 748fc044192a.

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body contains credible redacted terminal and JSON output for the earlier formatter head, but the latest head adds the identity-avatar-specific path-metadata repair and lacks an exact-head run of that behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P3: This is a small CLI diagnostic readability correction with no evidence of data loss, runtime outage, or blocked onboarding.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body contains credible redacted terminal and JSON output for the earlier formatter head, but the latest head adds the identity-avatar-specific path-metadata repair and lacks an exact-head run of that behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +8, Tests +1. Total +9 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 20 12 +8
Tests 1 1 0 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 21 12 +9

What I checked:

Likely related people:

  • steipete: Assigned this PR and authored the latest identity-avatar path-segment follow-up on the current head. (role: recent area contributor and PR updater; confidence: high; commits: 89cd13e55f80; files: src/config/validation.ts, src/config/config.identity-avatar.test.ts)
  • ekinnee: Authored the merged config-validation diagnostic implementation that established the shared display-boundary behavior this PR extends. (role: broader feature author; confidence: high; commits: 135aa7a0025d; files: src/config/issue-format.ts, src/config/validation.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-12T07:34:53.833Z sha f63b4b8 :: needs changes before merge. :: [P1] Preserve the documented dot-path field
  • reviewed 2026-07-12T10:32:28.470Z sha 681a136 :: needs real behavior proof before merge. :: [P2] Preserve numeric object keys in display paths
  • reviewed 2026-07-12T11:03:19.232Z sha df57b0f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-16T05:34:55.240Z sha 0d924b8 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-16T06:17:03.444Z sha 0d924b8 :: needs real behavior proof before merge. :: [P2] Carry typed segments through binding-union diagnostics
  • reviewed 2026-07-16T10:58:39.570Z sha 8f26d7e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-16T11:40:50.035Z sha 8f26d7e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-16T12:25:12.230Z sha 8f26d7e :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 12, 2026
@VectorPeak
VectorPeak force-pushed the fix/config-validation-array-index-path-v2 branch from 9a200e3 to 24a4cfb Compare July 12, 2026 05:37
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jul 12, 2026
@VectorPeak
VectorPeak force-pushed the fix/config-validation-array-index-path-v2 branch 2 times, most recently from 5fc577f to 77bc0b1 Compare July 12, 2026 06:24
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 12, 2026
@VectorPeak

Copy link
Copy Markdown
Contributor Author

Added the requested real behavior proof to the PR body.

Captured on current PR head f63b4b871d22df4768dcd3daea216be895bde7b7 with a redacted temporary invalid config using:

node scripts/run-node.mjs config validate
node scripts/run-node.mjs config validate --json

Both normal and JSON outputs now show bracketed array paths such as agents.list[0].tools.exec.commandHighlighting, while the PR diff remains limited to config validation path formatting/tests.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 12, 2026
@VectorPeak

Copy link
Copy Markdown
Contributor Author

Updated the PR body again using UTF-8 without a leading BOM/zero-width marker so the proof parser can read the ## What Problem This Solves heading literally.

The body still includes the requested current-head real behavior proof for both:

node scripts/run-node.mjs config validate
node scripts/run-node.mjs config validate --json

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 12, 2026
@VectorPeak

Copy link
Copy Markdown
Contributor Author

Cleaned the PR branch on top of latest upstream/main and removed the merge commit. The PR now has the same six config-validation files, with the three intended commits replayed onto $cleanHead.

The PR body has also been updated to keep the current-head real behavior proof marker in sync.

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 12, 2026
@knoal

knoal commented Jul 12, 2026

Copy link
Copy Markdown

A/B verified locally against base SHA. Ran vitest with the PR's test file against the PR's fix (B) and against the base's fix (A).

Result: CLEAN A/B

A (PR test + base fix): FAIL - 1 test failed
B (PR test + PR fix):   PASS - 1 test passed

The new test preserves numeric string path segments in display mode fails on base (because the path segment handling doesn't preserve numeric strings properly), passes with the fix. Failing-first signature is correct. Looks ready to merge.

@clawsweeper

clawsweeper Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@VectorPeak
VectorPeak force-pushed the fix/config-validation-array-index-path-v2 branch 3 times, most recently from a6cb36e to 8f26d7e Compare July 16, 2026 10:52
@steipete steipete self-assigned this Jul 17, 2026
VectorPeak and others added 2 commits July 18, 2026 00:15
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
@steipete
steipete force-pushed the fix/config-validation-array-index-path-v2 branch from 8f26d7e to 89cd13e Compare July 17, 2026 23:30
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed cli CLI command changes size: S labels Jul 17, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 17, 2026
@steipete

Copy link
Copy Markdown
Contributor

Maintainer rewrite complete. The stale competing formatter/CLI path is gone. Manual identity-avatar issues now preserve typed array segments through the existing withConfigIssuePath diagnostics owner while keeping the public dotted JSON path unchanged.

Proof:

@steipete
steipete merged commit af917f9 into openclaw:main Jul 17, 2026
206 of 218 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…104935)

* fix(config): format validation indexes at display boundary

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>

* fix(config): preserve identity avatar issue paths

Co-authored-by: VectorPeak <[email protected]>

---------

Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants