Skip to content

fix(install-x64): guard openclaw config set against ConfigMutationConflictError#254

Open
KrasimirKralev wants to merge 1 commit into
ID-Robots:betafrom
KrasimirKralev:fix/install-x64-config-guards
Open

fix(install-x64): guard openclaw config set against ConfigMutationConflictError#254
KrasimirKralev wants to merge 1 commit into
ID-Robots:betafrom
KrasimirKralev:fix/install-x64-config-guards

Conversation

@KrasimirKralev

@KrasimirKralev KrasimirKralev commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Closes #193.

Same bug class as #192 (fixed for the Jetson installer), now in the x64 path.

Problem

install-x64.sh:282 ran config set gateway.controlUi.allowInsecureAuth true --json under set -euo pipefail with no retry β€” a ConfigMutationConflictError (OpenClaw 2026.6.x optimistic concurrency, triggered by the live gateway or the CLI's own state migrations) aborts the install step mid-update. Four other calls (:354/369/371/372) took the opposite shortcut (2>/dev/null || true) β€” conflicts there were silently swallowed and the config just wasn't applied.

Fix

x64 has no gateway-pre-start.sh to defer these writes to, so the fix is the retry treatment: ported install.sh's oc_config_set (adapted to x64's as_user), and routed all five config-set calls through it.

  • :282 now retries up to 3Γ— and only aborts on a genuine persistent failure β€” keeps its fail-loud intent, minus the transient-conflict abort.
  • The four || true calls now retry and log on persistent failure (still non-fatal) instead of silently dropping config with no trace.

Validation

bash -n clean. (No local node/bun on the dev box β€” installer behavior verified on device/CI per project convention.)

Summary by CodeRabbit

  • Bug Fixes
    • Improved installer reliability when applying configuration, reducing failures caused by temporary update conflicts.
    • Configuration changes are now retried automatically instead of being silently skipped on error.
    • Setup now more consistently applies authentication-related and access-related settings during installation.

…flictError

Closes ID-Robots#193. Same bug class as ID-Robots#192 (fixed for the Jetson installer), in the
x64 path. install-x64.sh:282 ran `config set gateway.controlUi.allowInsecureAuth`
under `set -euo pipefail` with no retry β€” a ConfigMutationConflictError
(OpenClaw 2026.6.x optimistic concurrency, from the live gateway or the CLI's
own state migrations) aborted the install step mid-update.

x64 has no gateway-pre-start.sh to defer these writes to, so the fix is the
retry treatment: ported install.sh's oc_config_set (adapted to as_user), and
routed all five config-set calls through it.

- :282 (was unguarded β†’ aborted on conflict) now retries 3x and only aborts
  on a genuine persistent failure β€” its original fail-loud semantics, minus
  the transient-conflict abort.
- The four calls that took the opposite shortcut (2>/dev/null || true) β€”
  auth.mode, auth.token, allowInsecureAuth, dangerouslyDisableDeviceAuth β€”
  now retry and LOG on persistent failure (kept non-fatal with || true) instead
  of silently dropping the config with no trace.
@KrasimirKralev
KrasimirKralev requested a review from a team as a code owner July 5, 2026 11:32
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cb92ba52-557f-4926-adcc-924c8d8ef4a1

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7d7bf64 and 98a2fea.

πŸ“’ Files selected for processing (1)
  • install-x64.sh

πŸ“ Walkthrough

Walkthrough

Adds an oc_config_set helper in install-x64.sh that retries openclaw config set up to 3 times to handle optimistic-concurrency conflicts, and replaces direct/stderr-suppressed config set calls for gateway auth and controlUi settings with calls to this helper.

Changes

Config Set Retry Handling

Layer / File(s) Summary
Retry helper
install-x64.sh
Adds oc_config_set, which retries openclaw config set up to 3 times with delays, reporting an error only after the third failure.
Wire retry helper into config writes
install-x64.sh
Replaces direct config set calls (some previously stderr-suppressed) for gateway.controlUi.allowInsecureAuth, gateway.auth.mode, gateway.auth.token, and gateway.controlUi.dangerouslyDisableDeviceAuth with oc_config_set invocations.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Installer
  participant oc_config_set
  participant openclaw

  Installer->>oc_config_set: gateway.auth.mode token
  oc_config_set->>openclaw: config set (attempt 1)
  openclaw-->>oc_config_set: ConfigMutationConflictError
  oc_config_set->>openclaw: config set (attempt 2)
  openclaw-->>oc_config_set: success
  oc_config_set-->>Installer: return success
Loading

Possibly related PRs

  • ID-Robots/clawbox#192: Introduces the same oc_config_set retry helper pattern for the Jetson installer to handle optimistic-concurrency conflicts on config set calls.
πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately summarizes the main fix in install-x64.sh for OpenClaw config set conflict handling.
Description check βœ… Passed The description covers the summary, problem, fix, and validation, though the template's checklist fields are not filled.
Linked Issues check βœ… Passed The changes match #193 by retrying the x64 config writes, removing silent suppression, and using the adapted oc_config_set helper.
Out of Scope Changes check βœ… Passed The PR stays focused on x64 installer config-set conflict handling and doesn't add unrelated changes.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

πŸ¦€ ClawReview

Claws waving β€” here's what this change is about.

Ports the oc_config_set retry helper (already in the Jetson install.sh) into install-x64.sh, fixing the same ConfigMutationConflictError class on the x64 path. One bare config set call that could abort the install under set -euo pipefail now retries up to 3Γ—; four previously-silent || true calls now retry and log persistent failures to stderr instead of swallowing them without a trace.

At a glance

  • πŸ”§ Fix Β· touches x64 installer β€” openclaw config-set calls in step_openclaw_patch and step_openclaw_config
  • Base branch: beta Β· +31 source / +0 tests across 1 file
  • βœ… base beta matches the beta-first convention
  • βœ… conventional PR title
  • ℹ️ touches security-sensitive paths (install-x64.sh) β€” review with extra care

Good to know

  • 🟑 Touches the install/update path that runs on customer x64 devices β€” worth a manual smoke-test on a real x64 box if CI doesn't cover that path.
  • ℹ️ The four formerly-silent || true calls now emit to stderr on persistent failure, which is a nice observability win for debugging install logs.
  • ℹ️ No tests included β€” consistent with project convention (bash -n clean + device/CI validation noted in the PR body).

β€” ClawReview πŸ¦€, scuttling off. General info only β€” see CodeRabbit for the detailed review. Conventions: docs.

@github-actions github-actions Bot added the area: install Auto-triage area label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: install Auto-triage area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant