Skip to content

fix(update): ignore Finder metadata when discovering recovery sets - #186664

Closed
yy19971996 wants to merge 1 commit into
openclaw:mainfrom
yy19971996:fix/186650-ds-store-capture
Closed

yy19971996 wants to merge 1 commit into
openclaw:mainfrom
yy19971996:fix/186650-ds-store-capture

Conversation

@yy19971996

Copy link
Copy Markdown
Contributor

Closes #186650

What Problem This Solves

Fixes: openclaw update status reports every update recovery set as unavailable when a Finder .DS_Store file sits in the update-capture directory — routine on macOS — hiding the retained captures that an interrupted update would need.

User Impact

Recovery state stays inspectable on macOS. openclaw update status lists the valid and incomplete captures again instead of Update recovery sets unavailable: Unresolved update capture …/.DS_Store has incomplete publication, and no manual find … -name .DS_Store -delete is required. The stray file is left untouched, and capture validation plus incomplete-evidence reporting are unchanged.

Why This Change Was Made

readUpdateRecoveryBackups() enumerates every entry in <state>.update-captures/ and must classify each as a sealed or incomplete capture. It already exempts the privacy marker, Doctor schema archives, and rehearsal scratch, but a regular .DS_Store fell through to the final non-capture throw. That throw aborts the whole scan, so one OS metadata file suppressed every recovery set.

The fix adds a narrow exemption for a regular file named .DS_Store at the discovery step. It deliberately does not filter dotfiles or non-UUID names in general: requiring marker files or UUID-shaped names would change admission of malformed recovery evidence, which must still be reported. A directory named .DS_Store, symlinks, and every other unexpected entry still reach the existing validation.

Evidence

Real CLI, same fixture before and after (node --import tsx src/index.ts update status --json, isolated OPENCLAW_STATE_DIR). The capture root holds .DS_Store, one sealed capture with a committed outcome, and one incomplete capture directory.

Before (eba63b90f, no fix) — the two real captures disappear behind the stray file:

{"recoverySetsError": "Unresolved update capture /…/state.update-captures/.DS_Store has incomplete publication. Inspection only: openclaw update status --json; npx openclaw@latest doctor --fix. Earlier captures are retained."}

After — recoverySetsError absent, both captures listed, .DS_Store unmodified:

"recoverySets": [
  {"runId": "11111111-…", "status": "stale", "nextAction": "openclaw update status --json"},
  {"directory": "…/22222222-…", "status": "incomplete", "nextAction": "openclaw update status --json"}
]

Regression (red on base, green with the fix): vitest run src/cli/update-cli/status.recovery.test.ts → 17 passed. With the source change stashed, the new case fails on expected {…} to not have property "recoverySetsError"; with it, it passes. update-repair-triage.test.ts → 2 passed.

Checks: oxlint 0 warnings / 0 errors on both files; run-format.mts --list-different clean; git diff --check clean. Typecheck leaf tsconfig.core.test.cli-update.json: 57 errors, identical profile on base and head, none in the changed files — all in untouched files (TS2883 vitest/undici declaration portability from this worktree's symlinked node_modules). pnpm check:changed could not run here (heap OOM in this sandbox).

Environment note: pnpm openclaw and node openclaw.mjs were unavailable in this checkout — the dev runner refuses to publish runtime artifacts while the host Gateway is running, and pnpm build rejects a worktree with symlinked node_modules. The evidence therefore drives the shipped CLI command implementation from source.

AI Assistance

This PR is AI-assisted. Used shell tools (gh, git diff, grep) to trace update status into the capture scan and to build the before/after CLI fixture; the fix and its regression test were written by the assistant. The implementer understands the change: discovery must skip OS metadata files while still surfacing sealed and incomplete captures.

readUpdateRecoveryBackups() enumerates every entry of the update-capture
root and must classify each as a sealed or incomplete capture. It already
exempts the privacy marker, Doctor schema archives, and rehearsal scratch,
but a regular .DS_Store fell through to the final non-capture throw. That
throw aborts the whole scan, so one Finder metadata file reported every
recovery set as unavailable and hid the captures an interrupted update
would need.

Skip a regular file named .DS_Store at discovery. Dotfiles and non-UUID
names stay admissible otherwise: requiring marker files or UUID-shaped
names would change admission of malformed recovery evidence, which must
still be reported.
@clawsweeper

clawsweeper Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@yy19971996
yy19971996 marked this pull request as ready for review October 28, 2026 09:24
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Oct 28, 2026
@yy19971996

Copy link
Copy Markdown
Contributor Author

Superseded by #186663, which fixes the same discovery bug at the same owner with a marker-based admission contract plus docs. This narrower .DS_Store exemption was opened a few minutes later; the maintainer route covers the report. Closing to avoid a duplicate fix — thanks @woshicby for the reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: update-captures scan treats a stray Finder .DS_Store as an unresolved capture — all recovery sets reported unavailable

1 participant