Skip to content

refactor(status): consolidate scan projections and lazy loaders - #119412

Merged
steipete merged 1 commit into
mainfrom
codex/loc-0804-commands-luem8u
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/loc-0804-commands-luem8u

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Status scanning duplicated overview/result contracts and projections and wrapped existing lazy loaders in repeated one-use adapters. This is part of a maintainer-requested project-wide production LOC reduction campaign.

Why This Change Was Made

Derive scan results from the authoritative overview owner, retain an explicit credential-safe gateway projection, and invoke existing lazy loaders directly.

User Impact

Status command text, JSON output, advertised links, and gateway credential isolation remain unchanged. Removes 133 production lines.

Evidence

Exact-head isolated CLI transcript

Observed on exact PR head 5afd26cb8e185dbecb1d8c8c7fe827de5d9c4d0e; all five changed source Git blobs were independently verified on a fresh Blacksmith Testbox. The CLI was compiled from that exact source and run with isolated HOME/state/config, an unused ephemeral localhost port, and no inherited credentials or live operator gateway. Host names, paths, and ports are redacted.

$ openclaw status --timeout 1500
OpenClaw status
Overview
Gateway          <HOSTNAME> · ws://127.0.0.1:<EPHEMERAL_PORT> (<HOSTNAME> loopback) · unreachable
Gateway service  systemd user not installed
Node service     systemd user not installed
Agents           0 · no workspaces bootstrapping · sessions 0
Memory           enabled (plugin memory-core) · not checked
Sessions         0 active · default unknown · unknown
Channels
Sessions
[exit 0]

$ openclaw status --json --timeout 1500
{
  "updateChannel": "stable",
  "gateway": {
    "mode": "<HOSTNAME>",
    "url": "ws://127.0.0.1:<EPHEMERAL_PORT>",
    "urlSource": "<HOSTNAME> loopback",
    "reachable": false,
    "connectLatencyMs": null,
    "error": null
  },
  "memoryPlugin": { "enabled": true, "slot": "memory-core" },
  "secretDiagnostics": [],
  "agents": { "defaultId": "main", "totalSessions": 0, "count": 0 }
}
[exit 0]

$ openclaw status --all --timeout 1500
OpenClaw status --all
Overview
Config           <ISOLATED_STATE_DIR>/state/openclaw.json
Gateway          <HOSTNAME> · ws://127.0.0.1:<EPHEMERAL_PORT> (<HOSTNAME> loopback) · unreachable
Gateway service  systemd user not installed
Node service     systemd user not installed
Agents           0 total · 0 bootstrapping · 0 active · 0 sessions
Channels
Agents
Diagnosis (read-only)
! Channel issues skipped (gateway unreachable)
  gateway unreachable
[exit 0]

This intentionally proves cold/isolated unreachable-gateway behavior; it does not access an operator's live gateway or credentials.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete
steipete marked this pull request as ready for review August 5, 2026 02:14
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 10:20 PM ET / August 5, 2026, 02:20 UTC.

ClawSweeper review

What this changes

The PR removes duplicate status-scan projections and one-use lazy-loader wrappers while preserving the existing text, JSON, and status-all output paths.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

The refactor is still necessary and source review found no correctness or credential-isolation regression. It should remain open under its protected maintainer label, but merge proof is currently CI/test-only rather than an inspectable after-fix status run.

Priority: P3
Reviewed head: 5afd26cb8e185dbecb1d8c8c7fe827de5d9c4d0e

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is a coherent, source-supported cleanup, but its real behavior evidence is presently limited to CI and test claims.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The body reports tests and CI but provides no inspectable after-fix terminal output or runtime artifact; add redacted real-command proof and a refreshed review should follow automatically. 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.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The body reports tests and CI but provides no inspectable after-fix terminal output or runtime artifact; add redacted real-command proof and a refreshed review should follow automatically. 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 6 items Current main still has the duplication: Current main retains the separate overview-to-surface field projection, so the central cleanup is not already implemented.
Safe canonical projection: The PR derives the flattened scan type from the overview owner while explicitly omitting gatewayCallOverrides, then copies only the established display fields.
Credential boundary remains intact: The gateway snapshot may retain call overrides containing credentials internally, but the JSON payload has an explicit credential-free input and output projection.
Findings None None.
Security None None.

How this fits together

OpenClaw’s status command gathers configuration, gateway health, channel state, and local agent information before rendering terminal or JSON diagnostics. The changed projection layer supplies those renderers while keeping gateway call credentials out of published status data.

flowchart LR
  A[Status command options] --> B[Status scan overview]
  B --> C[Gateway snapshot]
  B --> D[Full scan result]
  C --> D
  D --> E[Shared safe projection]
  E --> F[Terminal status]
  E --> G[JSON status]
  B --> H[Full status report]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The body reports tests and CI but provides no inspectable after-fix terminal output or runtime artifact; add redacted real-command proof and a refreshed review should follow automatically. 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.
  • Resolve merge risk (P1) - The supplied PR body and accessible context contain CI and test claims but no inspectable after-fix terminal output or runtime artifact for the preserved status behavior.
  • Complete next step (P2) - The protected maintainer label and missing inspectable real-behavior evidence make this an active human merge-review item, not a repair-lane candidate.
Agent review details

Security

None.

PR surface

Source -133. Total -133 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 5 83 216 -133
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 83 216 -133

Review metrics

Metric Value Why it matters
Production versus test LOC production −133, tests 0 The change removes duplicated production code without expanding the test surface; existing contract tests remain the regression boundary.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the canonical projection refactor, then add a redacted after-fix terminal capture or log covering openclaw status, openclaw status --json, and openclaw status --all before maintainer merge review.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the canonical projection refactor, then add a redacted after-fix terminal capture or log covering openclaw status, openclaw status --json, and openclaw status --all before maintainer merge review.

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

Not applicable: this PR refactors established status behavior rather than reporting a failure; source and existing tests define the preserved outputs.

Is this the best way to solve the issue?

Yes — deriving the result from the overview owner and deleting one-use loader adapters is the narrowest maintainable solution, and the shared projection retains the explicit credential boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 50c7444edf4b.

Labels

Label changes:

  • add P3: This is a behavior-preserving internal cleanup of the status command, with no current user-facing defect identified.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports tests and CI but provides no inspectable after-fix terminal output or runtime artifact; add redacted real-command proof and a refreshed review should follow automatically. 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:

  • P3: This is a behavior-preserving internal cleanup of the status command, with no current user-facing defect identified.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The body reports tests and CI but provides no inspectable after-fix terminal output or runtime artifact; add redacted real-command proof and a refreshed review should follow automatically. 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

What I checked:

Likely related people:

  • steipete: Available history identifies Peter Steinberger’s earlier shared status overview refactor, and the current projection lines are attributed to this PR head. (role: original status-surface contributor and current refactor author; confidence: high; commits: 143f501fe533, 5afd26cb8e18; files: src/commands/status-overview-surface.ts, src/commands/status.scan-result.ts, src/commands/status.command.ts)
  • shakkernerd: The immediately preceding shared overview/result shape in the touched status surface is attributed to Shakker’s commit. (role: recent area contributor; confidence: medium; commits: f979883b8fa9; files: src/commands/status-overview-surface.ts, src/commands/status.scan-result.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted terminal capture or log from the exact head showing preserved status, status --json, and status --all behavior.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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 merged commit 5ffd2df into main Aug 5, 2026
195 of 202 checks passed
@steipete
steipete deleted the codex/loc-0804-commands-luem8u branch August 5, 2026 02:41
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
* origin/main: (22 commits)
  refactor(plugins): consolidate lifecycle hook dispatch (#119429)
  fix(ci): stabilize TUI PTY proof ownership (#119420)
  test(system-agent): reduce suite setup overhead (#119424)
  fix(ui): keep session rail pill status from overlapping the headline (#119397)
  fix(discord): avoid doctor runtime loading (#119391)
  fix(media): decouple playback cache retention (#119417)
  fix(slack): infer upload filename extensions from MIME types (#119399)
  refactor(channels): unify configured binding resolution (#119414)
  refactor(google-meet): unify gateway and tool dispatch (#119413)
  test(state): reuse legacy database fixtures (#119423)
  fix(reset): preserve bootstrap guidance for dynamic models (#119179)
  fix(chutes): honor serving context limits (#119196)
  refactor(status): consolidate scan projections and lazy loaders (#119412)
  fix(status): status --all slows down with missing plugins (#119203)
  refactor(gateway): consolidate usage reporting and caches (#119409)
  perf(gateway): keep reload and recovery machinery off gateway cold start (#119094)
  fix(cli): align TaskFlow controller columns for wide text (#118801)
  fix: make startup migration restart guidance install-neutral (#119406)
  fix(ci): preserve cache warmer shard envelopes (#119403)
  fix(sessions): preserve compatible auth profiles on model changes (#117550)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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