Skip to content

fix(cli): report honest SQLite store labels and consistent build SHA in help#111659

Merged
steipete merged 1 commit into
mainfrom
claude/fix-status-labels
Jul 20, 2026
Merged

fix(cli): report honest SQLite store labels and consistent build SHA in help#111659
steipete merged 1 commit into
mainfrom
claude/fix-status-labels

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Two QA rounds flagged misleading CLI output:

  1. Phantom .json store paths. cron/sessions status and sessions cleanup advertised a JSON store path (e.g. cron/jobs.json, .../sessions/sessions.json) even though OpenClaw storage is SQLite-only and no such file exists — so operators were pointed at a database file that isn't there.
  2. Stale build SHA in group help. openclaw models --help reported a different build SHA than openclaw --version and every other subcommand's help, because the models group's cached help text wasn't invalidated when the build identity changed.

Why This Change Was Made

Status output should name the real storage. And a build SHA shown in help should be a single source of truth so it can't drift between the group help cache and --version.

User Impact

  • cron/sessions status, sessions list, and sessions cleanup now report the actual SQLite database (e.g. .../agents/<id>/agent/openclaw-agent.sqlite) for locally-owned stores.
  • Cross-platform safe: when sessions cleanup is delegated to a remote gateway, the gateway-owned path is passed through unchanged (never re-resolved client-side) — so a POSIX CLI won't mangle a Windows gateway's path and vice-versa.
  • openclaw models --help, --version, and other group helps now report the same SHA; the cached group help invalidates whenever build identity changes.

Evidence

  • Store labels: cron src/cron/service/ops.ts (resolves on the gateway host), sessions src/commands/sessions.ts (local-only). Delegated-vs-local branch in src/commands/sessions-cleanup.ts — local resolves to SQLite (:145), gateway-owned passes through (:278); the gateway RPC returns summaries directly (server-methods/sessions-read.ts).
  • Build SHA: scripts/write-cli-startup-metadata.ts invalidates cached group help on build-identity change.
  • Tests: sessions-cleanup.test.ts (local + delegated + Windows-path pass-through, JSON + human), sessions.test.ts, write-cli-startup-metadata.test.ts (group help SHA == canonical). Testbox 25/25 + focused suites; AutoReview clean (0.93).
  • doctor slow (~10.7s) exit was investigated and intentionally left unchanged: the two provider loads have different scopes (not a removable duplicate) and completion regen runs in a child process — deduping needs a tested doctor-scoped prepared provider context first (follow-up).

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts commands Command implementations size: M maintainer Maintainer-authored PR labels Jul 20, 2026
@steipete steipete self-assigned this Jul 20, 2026
@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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 20, 2026
@clawsweeper

clawsweeper Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 20, 2026, 12:55 AM ET / 04:55 UTC.

Summary
The PR rewrites cron and session storage labels to show SQLite targets and invalidates cached group help when the CLI build identity changes.

PR surface: Source +42, Tests +61, Other +8. Total +111 across 11 files.

Reproducibility: no. high-confidence live reproduction was available to inspect. The supplied branch and tests identify clear current paths for local sessions cleanup, delegated gateway cleanup, session JSON output, cron status, and generated group help, but they do not include a verifiable before-and-after runtime transcript.

Review metrics: 1 noteworthy metric.

  • Machine-readable storage values: 3 display values changed. The PR changes path, aggregate store paths, and SQLite session-file marker output, so the correction can affect CLI JSON consumers beyond human-readable status text.

Stored data model
Persistent data-model change detected: migration/backfill/repair: test/scripts/write-cli-startup-metadata.test.ts, serialized state: src/commands/sessions-cleanup.test.ts, serialized state: src/commands/sessions-cleanup.ts, serialized state: src/commands/sessions.default-agent-store.test.ts, serialized state: src/commands/sessions.test.ts, serialized state: src/commands/sessions.ts, and 7 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • Attach redacted terminal output for local sessions or cleanup output showing the SQLite target.
  • Attach redacted delegated-gateway output showing that a Windows-style gateway path is passed through unchanged.
  • Record maintainer confirmation of whether the rewritten JSON fields are the intended public CLI contract.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body reports focused tests, Testbox results, and CI, but the available material contains no inspectable redacted after-fix terminal output, recording, log, or artifact showing the local and delegated CLI 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 sessions JSON output changes existing path, stores[].path, and SQLite session-file values; consumers that treated the former legacy-looking paths as stable may observe a compatibility break despite the corrected labels.
  • [P1] The PR body reports focused tests and Testbox coverage, but no inspectable redacted live CLI transcript, terminal capture, or linked artifact was available to confirm the after-fix operator output.

Maintainer options:

  1. Confirm and prove the corrected output (recommended)
    Confirm that replacing the JSON path values is the intended public CLI contract, then attach redacted local and delegated live output before merge.
  2. Accept the output break deliberately
    Merge the corrected values as a deliberate compatibility change if maintainers conclude the prior nonexistent paths were never supported for automation.
  3. Pause for a compatibility design
    Pause this PR if the project needs a deprecated output field or release migration policy rather than an immediate replacement.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require maintainer confirmation of the JSON output contract and redacted after-fix CLI evidence for local and delegated gateway paths.

Next step before merge

  • [P1] This protected maintainer-labeled PR needs normal human review of the CLI JSON compatibility decision and contributor-supplied runtime proof; no narrow automated repair is established.

Maintainer decision needed

  • Question: Should the corrected SQLite values replace the existing machine-readable sessions path fields now, or should the CLI retain an explicitly deprecated compatibility field for consumers of the old output?
  • Rationale: The patch intentionally corrects values that point to nonexistent JSON stores, but it also changes fields that can be parsed by external automation; source excerpts alone do not establish whether those fields are a supported compatibility contract.
  • Likely owner: steipete — This person is assigned to the PR and is the only concrete routing signal available for the affected command and startup-metadata surfaces.
  • Options:
    • Adopt corrected JSON values (recommended): Treat the old nonexistent JSON paths as erroneous diagnostic output and merge after adding redacted live CLI proof for local and delegated cases.
    • Provide a migration-shaped output: Keep a clearly named deprecated compatibility field while exposing canonical SQLite fields if maintainers consider the former JSON values externally consumed.
    • Narrow to human-readable output: Avoid changing JSON values if their compatibility status cannot be resolved for this release.

Security
Cleared: The supplied diff changes CLI rendering, cache reuse conditions, types, and tests without adding dependencies, permissions, network access, secret handling, or executable supply-chain inputs.

Review details

Best possible solution:

Keep the SQLite-only labels and build-identity cache guard, then land only after maintainers confirm the intended JSON-output compatibility contract and attach redacted real CLI evidence for both a local store and a delegated gateway path.

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

No high-confidence live reproduction was available to inspect. The supplied branch and tests identify clear current paths for local sessions cleanup, delegated gateway cleanup, session JSON output, cron status, and generated group help, but they do not include a verifiable before-and-after runtime transcript.

Is this the best way to solve the issue?

Unclear. Resolving only locally owned labels to the canonical SQLite target and preserving gateway-owned paths is the narrowest apparent fix, but replacing machine-readable JSON values is safe only if maintainers confirm the prior fields are not a supported external contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1508a586744d.

Label changes

Label changes:

  • add P2: This is a bounded CLI correctness and operator-diagnostics fix with limited but user-visible blast radius.
  • add merge-risk: 🚨 compatibility: The branch replaces established machine-readable sessions path values, requiring an explicit decision about external CLI-output consumers.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests, Testbox results, and CI, but the available material contains no inspectable redacted after-fix terminal output, recording, log, or artifact showing the local and delegated CLI 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.

Label justifications:

  • P2: This is a bounded CLI correctness and operator-diagnostics fix with limited but user-visible blast radius.
  • merge-risk: 🚨 compatibility: The branch replaces established machine-readable sessions path values, requiring an explicit decision about external CLI-output consumers.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests, Testbox results, and CI, but the available material contains no inspectable redacted after-fix terminal output, recording, log, or artifact showing the local and delegated CLI 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 +42, Tests +61, Other +8. Total +111 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 63 21 +42
Tests 5 89 28 +61
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 8 0 +8
Total 11 160 49 +111

What I checked:

  • Local versus remote session-path handling: The branch resolves locally owned session-store labels through the SQLite target helper while the added cleanup test preserves a gateway-returned Windows path unchanged, matching the stated host-ownership boundary. (src/commands/sessions-cleanup.ts:145, b6c4b2da54e3)
  • Machine-readable sessions output changes: The branch rewrites the JSON path, aggregate stores paths, and SQLite session-file marker path rather than only changing human-readable CLI text. (src/commands/sessions.ts:234, b6c4b2da54e3)
  • Group-help cache invalidation: The cache reuse checks now require the existing root-help bundle signature to equal the current build identity signature, so a changed build identity forces regenerated group help. (scripts/write-cli-startup-metadata.ts:778, b6c4b2da54e3)
  • Focused regression coverage: The PR adds coverage for a locally resolved SQLite label, a delegated Windows gateway path, SQLite-backed session JSON, cron status aliasing, and a changed help banner. (src/commands/sessions-cleanup.test.ts:227, b6c4b2da54e3)
  • Current review state: The PR is labeled maintainer and assigned in its timeline, so automated cleanup should not close or rewrite it; required checks were still incomplete in the supplied context.

Likely related people:

  • steipete: The PR timeline assigns the item to this person, who also authored the proposed cross-cutting CLI/storage correction; no independent current-main history trail was available in the supplied review material. (role: assigned reviewer and recent area contributor; confidence: low; commits: b6c4b2da54e3; files: src/commands/sessions-cleanup.ts, src/commands/sessions.ts, src/cron/service/ops.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.

@steipete
steipete force-pushed the claude/fix-status-labels branch from b6c4b2d to 5c58545 Compare July 20, 2026 04:59
@steipete

Copy link
Copy Markdown
Contributor Author

/allow-security-sensitive-change 5c58545

@steipete

Copy link
Copy Markdown
Contributor Author

/allow-dependencies-change 5c58545

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Jul 20, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer disposition of the current ClawSweeper rank-up moves:

  • Confirmed: the corrected SQLite values intentionally replace the misleading, nonexistent JSON paths as the CLI contract.
  • Proof: the focused sessions-cleanup local, delegated, and Windows tests passed; Testbox passed 25/25; and the exact-head CI gate is green. The delegated Windows-path case proves that gateway-owned paths pass through unchanged.
  • Separate redacted terminal captures are skipped because these deterministic command-output contracts are covered directly at the local and delegation boundaries, with no external provider or service behavior involved.

@steipete
steipete merged commit 8f9e42f into main Jul 20, 2026
125 of 127 checks passed
@steipete
steipete deleted the claude/fix-status-labels branch July 20, 2026 05:07
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M 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.

1 participant