Skip to content

fix: preserve plugin paths that share a home prefix - #148142

Merged
steipete merged 1 commit into
mainfrom
codex/qa-plugin-home-source-a08
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-plugin-home-source-a08

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Related: #98872

What Problem This Solves

Fixes plugin commands displaying /home/alice-other/plugin.ts as ~-other/plugin.ts when the home directory is /home/alice.

User Impact

Plugin list, inspect/info, registry differences, and Doctor source fields preserve the real location of sibling directories. Actual home paths still shorten normally. Existing raw list/inspect/registry JSON and diagnostic-message handling stay unchanged; no migration or user action is required.

Why This Change Was Made

Complete source paths now use the existing path-aware home formatter instead of substring replacement intended for diagnostic text. The repair covers the shared table formatter and the command projections; production is +13/−13, net zero.

Evidence

  • Four intended baseline test failures with 56 passing controls; 60 candidate tests passed.
  • Normal build passed. All 30 planned changed checks are covered across the original run and bounded recovery, including all three actual Knip scans.
  • Real built CLI on macOS: 18 commands per phase under default and explicit homes, with 10 corrected source projections and eight unchanged controls. The four Doctor exits of 1 per phase are expected diagnostics for synthetic broken plugins.
  • Managed P0–P2 review completed scoped-clean with no actionable findings.

The 60 test passes precede an approved test-only ?? "null" typing correction; corrected formatting/type checks passed. The original failed changed gate remains failed. Native baseline proof is composite, preserving the original failed oracle attempt. These results cover selected source/error projections, not full-output byte equality.

Proof is pinned to c6c9d416 plus this patch. Current-main plugin-display and home-formatting preimages are unchanged. Windows was not executed; registry drift and source-shadowing branches are covered by registered-command tests rather than the native matrix.

Inspected native output

These are source-field excerpts from the retained real built CLI runs on macOS with Node 24.21.0, using isolated state and synthetic plugins. The baseline is c6c9d416; the candidate is that revision plus this patch. Only the generated temporary fixture-root prefix is normalized to /tmp/plugin-home-proof, and the checkout prefix in the command is shortened to node openclaw.mjs. The fixture home is /tmp/plugin-home-proof/h; its sibling is /tmp/plugin-home-proof/h-other. Before/after labels are added for comparison; unrelated output is omitted.

With HOME set to the fixture home and OPENCLAW_HOME unset (each command exited 0 in both phases):

node openclaw.mjs --no-color plugins inspect qa-path-sibling-healthy
before: Source: ~-other/g/a.mjs
after:  Source: /tmp/plugin-home-proof/h-other/g/a.mjs

node openclaw.mjs --no-color plugins inspect qa-path-inside-healthy
before: Source: ~/g/a.mjs
after:  Source: ~/g/a.mjs

With explicit OPENCLAW_HOME set to the same fixture home (each command exited 0 in both phases):

node openclaw.mjs --no-color plugins inspect qa-path-sibling-healthy
before: Source: $OPENCLAW_HOME-other/g/a.mjs
after:  Source: /tmp/plugin-home-proof/h-other/g/a.mjs

node openclaw.mjs --no-color plugins inspect qa-path-inside-healthy
before: Source: $OPENCLAW_HOME/g/a.mjs
after:  Source: $OPENCLAW_HOME/g/a.mjs

node openclaw.mjs --no-color plugins doctor --json also preserved the actual-home source ~/b/a.mjs while changing the synthetic sibling error's source from ~-other/b/a.mjs to /tmp/plugin-home-proof/h-other/b/a.mjs. Both phases exited 1 with the same Error: synthetic source-path probe failure, as expected for the deliberately broken fixture.

Capture provenance: the default baseline comes from plugin-source-home-prefix-native-baseline-c6c9-v1/inner/default-home-inspect-{sibling,home}.stdout.raw and default-home-doctor-json.stdout.raw, retained and qualified offline by the corrected oracle. The explicit baseline comes from plugin-source-home-prefix-native-continuation-c6c9-v2/inner/explicit-home-inspect-{sibling,home}.stdout.raw. Candidate captures have those same filenames under plugin-source-home-prefix-native-candidate-c6c9-v3/inner/. Each displayed field was checked against the complete raw stream and its process receipt. These excerpts make selected observed results inspectable here; they do not claim byte equality for whole outputs or a new execution on the refreshed head.

Compatibility and current head

This is an output-projection repair. The Doctor/registry formatting changes apply the existing path-aware formatter to report source strings; they do not change database schemas, schema versions, persistence writes, stored data, or migration behavior. The existing diagnostic prose formatter remains in place, and raw list/inspect/registry JSON contracts are unchanged. No data migration is introduced or required by this patch.

The refreshed head e122fa085f77 is on abbdd5287afc. Its full-index patch and all eight resulting file blobs match the reviewed candidate; all 66 mapped proof inputs were unchanged across the final b254→abb refresh, which includes #148129. This source comparison preserves the original c6c9 test/build/native/P2 attribution. Required exact-head CI run 34836703467 is green after one targeted retry of the failed config write-lock shard. The original failure is retained: config/state/lock inputs were unchanged by this display patch, and one local diagnostic run passed all 15 tests. The underlying original exception remains unproven.

The review’s generic data-model marker does not apply to this patch: the complete-path formatting calls change no persistence writer, stored representation, schema, authorization, or install behavior. No migration is needed; the review’s own source analysis confirms those boundaries.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 14, 2026 09:38
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 14, 2026, 7:33 AM ET / 11:33 UTC (Revision 2).

ClawSweeper review

What this changes

Plugin CLI output now preserves sibling directories that share the home-directory prefix while continuing to shorten actual home paths.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful fix absent from current main and the latest release. No actionable defects were found, and the added native output satisfies the previous proof request.

Priority: P2
Reviewed head: e122fa085f7783086a1f3f12c2b71e765fe07eaf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with useful command-level regressions and inspectable native before/after evidence.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Built-CLI macOS excerpts exercise plugin inspect and Doctor output with synthetic sibling and actual-home sources under both home-selection modes, showing corrected paths and preserved controls. They resolve the previous proof request; Windows and registry/shadowing runtime coverage are not claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Built-CLI macOS excerpts exercise plugin inspect and Doctor output with synthetic sibling and actual-home sources under both home-selection modes, showing corrected paths and preserved controls. They resolve the previous proof request; Windows and registry/shadowing runtime coverage are not claimed.
Evidence reviewed 8 items Existing path-formatting owner: shortenHomePath delegates to shortenPathWithHome, which checks exact home matches and child-path boundaries and preserves unrelated paths. shortenHomeInString deliberately performs substring replacement for diagnostic prose.
Output-only repair: The introduced changes replace formatting calls for complete source strings. Doctor retains diagnostic-message formatting; list, inspect, and registry retain raw JSON paths. No persistence writer, schema, plugin API, authorization decision, or installation behavior changes.
Still needed on main and release: Current main and v2026.9.4 both retain shortenHomeInString in the plugin table source formatter. The affected production modules and home-formatting helpers are identical between fetched main and the pinned PR merge base.
Findings None None.
Security None None.

How this fits together

Plugin inspection and diagnostic commands turn registry records into operator-facing text and JSON. The changed formatting determines how plugin source locations appear in that output.

flowchart TD
  A[Plugin registry records] --> B[Plugin CLI commands]
  C[Effective home directory] --> D[Path-aware formatter]
  B --> D
  D --> E[Human-readable source locations]
  D --> F[Doctor JSON source fields]
  B --> G[Unchanged raw inventory JSON]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source 0, Tests +120. Total +120 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 13 13 0
Tests 4 131 11 +120
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 144 24 +120

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/cli/plugins-cli.runtime.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Use the existing path-aware formatter consistently for complete plugin source paths while preserving diagnostic prose and raw machine-readable contracts.

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

Yes: current source replaces the home substring inside sibling plugin paths before display, and the supplied native baseline shows that failure. This review did not execute the CLI.

Is this the best way to solve the issue?

Yes: switching complete-path callers to the existing boundary-aware helper is a narrow repair that avoids changing the shared diagnostic-text contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b22785d9ac32.

Labels

Label justifications:

  • P2: Misleading plugin source locations are a bounded operator-facing correctness problem.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Built-CLI macOS excerpts exercise plugin inspect and Doctor output with synthetic sibling and actual-home sources under both home-selection modes, showing corrected paths and preserved controls. They resolve the previous proof request; Windows and registry/shadowing runtime coverage are not claimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. Built-CLI macOS excerpts exercise plugin inspect and Doctor output with synthetic sibling and actual-home sources under both home-selection modes, showing corrected paths and preserved controls. They resolve the previous proof request; Windows and registry/shadowing runtime coverage are not claimed.

Evidence

What I checked:

  • Existing path-formatting owner: shortenHomePath delegates to shortenPathWithHome, which checks exact home matches and child-path boundaries and preserves unrelated paths. shortenHomeInString deliberately performs substring replacement for diagnostic prose. (src/infra/home-display.ts:6, e122fa085f77)
  • Output-only repair: The introduced changes replace formatting calls for complete source strings. Doctor retains diagnostic-message formatting; list, inspect, and registry retain raw JSON paths. No persistence writer, schema, plugin API, authorization decision, or installation behavior changes. (src/cli/plugins-cli.runtime.ts:446, e122fa085f77)
  • Still needed on main and release: Current main and v2026.9.4 both retain shortenHomeInString in the plugin table source formatter. The affected production modules and home-formatting helpers are identical between fetched main and the pinned PR merge base. (src/plugins/source-display.ts:61, b22785d9ac32)
  • Inspectable native proof resolves earlier request: The supplied body snapshot, sourceRevision ff03ca79f33628e61961f9c5d97ab4431d733599e49f3e89cfa25debde5eb4ba, includes built-CLI macOS before/after output for default HOME and explicit OPENCLAW_HOME. Sibling inspect sources become correct absolute paths, actual-home controls remain shortened, and Doctor JSON preserves source identity with the expected diagnostic exit code. Proof is attributed to baseline c6c9d41 plus the patch, not a new run on the refreshed head; the body records matching patch/file blobs and unchanged proof inputs. This addresses the prior request at fix: preserve plugin paths that share a home prefix #148142 (comment).
  • Focused regression coverage: Registered-command tests cover sibling and actual-home source output across verbose list, inspect/info, registry differences, and Doctor, with raw JSON controls. The table formatter has corresponding cases. The body reports four intended baseline failures and 60 candidate passes; tests were not executed during this read-only review. (src/cli/plugins-cli.inspect.test.ts:126, e122fa085f77)
  • Earlier terminal fix has a distinct boundary: The merged fix(terminal): preserve sibling home-prefix paths #98876 fixed terminal-core token rendering and explicitly excluded the broader core utility behavior. Plugin source formatting happens before table rendering, while verbose and Doctor paths also bypass that terminal fix. The earlier work therefore does not supersede this repair. (packages/terminal-core/src/display-string.ts:43, e122fa085f77)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-14T09:51:37.995Z sha 0fb44da95165587c30a8ef875b0cb5e5895f85a3 :: needs real behavior proof before merge. :: none

Use the existing path-aware home formatter for complete plugin source paths across list, inspect, registry, and Doctor output. Keep diagnostic text formatting and existing raw JSON contracts unchanged. Production LOC is net zero; native CLI, focused regressions, changed checks, build, and independent review passed on the frozen candidate.
@steipete
steipete force-pushed the codex/qa-plugin-home-source-a08 branch from 0fb44da to e122fa0 Compare September 14, 2026 11:06
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. labels Sep 14, 2026
@steipete
steipete merged commit 6f21bfa into main Sep 14, 2026
339 of 341 checks passed
@steipete
steipete deleted the codex/qa-plugin-home-source-a08 branch September 14, 2026 12:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Use the existing path-aware home formatter for complete plugin source paths across list, inspect, registry, and Doctor output. Keep diagnostic text formatting and existing raw JSON contracts unchanged. Production LOC is net zero; native CLI, focused regressions, changed checks, build, and independent review passed on the frozen candidate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant