Skip to content

fix(plugins): prevent terminal controls in installed plugin reports - #172873

Closed
Alix-007 wants to merge 3 commits into
openclaw:mainfrom
Alix-007:fix/alix-plugin-terminal-text-20261015
Closed

Alix-007 wants to merge 3 commits into
openclaw:mainfrom
Alix-007:fix/alix-plugin-terminal-text-20261015

Conversation

@Alix-007

@Alix-007 Alix-007 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes installed plugin metadata and discovery diagnostics emitting terminal control sequences during plugins list and plugins inspect.

User Impact

Operators can inspect installed plugins without manifest strings changing terminal state. Normal plugin labels, versions, and trusted status colors remain readable. Report JSON retains its raw metadata values; there are no new settings, permissions, protocols, schemas, or migration steps.

Why This Change Was Made

Apply the existing canonical terminal filter at human list and inspection boundaries, including verbose/all modes and global diagnostic stderr. Filter untrusted table cells before trusted status styling. Plugin discovery, enablement, runtime loading, and structured report data retain their existing behavior.

Evidence

Current-head maintenance

  • Product head: 662557a4301c7347ffd185b81b1f7c66982c2fd8; integrated main: 27e7e5ee87ccbc1cfa11b7e0b79d78bbf503280f; clean reviewed tree: 8a6cf30d798eb3571014cf39581e06339420c795. Original contribution and authentic merge parents are retained.
  • Repair: Resolved the actual list-renderer merge conflict by preserving terminal sanitization alongside main’s Trust column and verbose trust label. Main’s inline JSON projection remains intact; raw JSON metadata and missing IDs remain unchanged.
  • Exact current collector command: node proof-reports.mjs "$CHECKOUT" green plugins (Node 26.12.1, isolated synthetic state). Actual command, process excerpts, independent readback and original baseline evidence are inline below; source hashes identify the local collectors.
  • Actual runtime readback: Real built plugins list/inspect CLI subprocesses discover a synthetic installed manifest. Tainted and ordinary human reports emit zero unsafe terminal controls; JSON preserves raw tainted metadata. Missing-plugin human errors escape newlines and remove controls, while JSON preserves the original ID. The plugin entrypoint throws if imported, so this is metadata-only discovery.
  • Validation: Six related CLI files passed: plugins-terminal-format, plugins-list-format, plugins-cli.list, plugins-cli.inspect, plugins-list-command and plugins-list-route-cold-imports; 57/57 tests across 3 shards, exit 0, single-worker command wall 214.00 s including native preparation. A separate pnpm test src/cli/plugins-terminal-format.test.ts --maxWorkers=1 on this final commit passed 11/11, exit 0, wall 147.256 s (Vitest 136.93 s). That single-file run prepared a distinct native generation in 116.662 s for 17,899 inputs/22,648 outputs, so it is not a warm-only timing and does not replace the six-file aggregate. Targeted production/test type graph with tsgo, type-aware lint, oxfmt and PR-range whitespace checks passed. Independent P0–P3 complete-candidate review passed.
  • Normal pnpm build cliStartup passed with a matching clean-head buildstamp before this collector ran. This does not claim the full release/package build.
  • Evidence reuse: historical RED observations keep their original versions. The current-head receipt below is a fresh runtime run. Required hosted CI is checked separately after push.
  • Not tested and cleanup: Linux byte-boundary report proof only; no interactive PTY, loaded plugin/provider execution, external service, other OS or installed-release upgrade. Discovery and lifecycle behavior are unchanged. The historical RED baseline and its original SHA below are reused, and are not current-head runs.
Current-head CLI execution and independent readback receipt
{
  "observedAt": "2026-10-25T12:58:43.604Z",
  "head": "662557a4301c7347ffd185b81b1f7c66982c2fd8",
  "tree": "8a6cf30d798eb3571014cf39581e06339420c795",
  "integratedMain": "27e7e5ee87ccbc1cfa11b7e0b79d78bbf503280f",
  "result": "PASS",
  "buildProfile": "cliStartup",
  "buildStamp": {
    "builtAt": 1792932996147,
    "head": "662557a4301c7347ffd185b81b1f7c66982c2fd8",
    "inputsClean": true,
    "inputSignature": "3ada7021df66c10d9e3247d0f05735f5189215e3c5aa64db18996af5f30d07aa"
  },
  "harnessSha256": "0b8761cd91c01774a724a683e649c24c597f502ac1092a9409540c524b5cb9a8",
  "receiptSha256": "5348f7a18f7aed69af177cb1810ef27a39d3bef0fcfd4ac16eb5672de30bb8bb",
  "observations": [
    {
      "label": "plugin-list-verbose",
      "controlBytes": 0,
      "expected": "PLUGIN_MARKER"
    },
    {
      "label": "plugin-inspect",
      "controlBytes": 0,
      "expected": "PLUGIN_MARKER"
    },
    {
      "label": "legal-plugin-list-verbose",
      "controlBytes": 0,
      "expected": "PLUGIN_MARKER"
    },
    {
      "label": "legal-plugin-inspect",
      "controlBytes": 0,
      "expected": "PLUGIN_DESCRIPTION"
    },
    {
      "label": "missing-plugin-human",
      "controlBytes": 0,
      "rawIdPreservedInJson": true
    }
  ],
  "runs": [
    {
      "name": "plugin-list-verbose",
      "args": [
        "plugins",
        "list",
        "--verbose"
      ],
      "exit": 0,
      "stdout": "Plugins (0/177 enabled)\nTrust is provenance, not a code-safety guarantee.\nPLUGIN_MARKER (report-plugin) disabled\n  format: openclaw\n  source: <fixture>/plugin/index.js\n  origin: config\n  version: 1.0.0\n  trust: record-missing\n\nAbliteration (abliteration) disabled\n  format: openclaw\n  source: <checkout>/extensions/abliteration/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: abliteration\n\nAmazon Bedrock (amazon-bedrock) disabled\n  format: openclaw\n  source: <checkout>/extensions/amazon-bedrock/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: amazon-bedrock\n\nAmazon Bedrock Mantle (amazon-bedrock-mantle) disabled\n  format: openclaw\n  source: <checkout>/extensions/amazon-bedrock-mantle/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: amazon-bedrock-mantle\n\nAnthropic Vertex (anthropic-vertex) disabled\n  format: openclaw\n  source: <checkout>/extensions/anthropic-vertex/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: anthropic-vertex\n\n@openclaw/arcee-provider (arcee) disabled\n  format: openclaw\n  source: <checkout>/extensions/arcee/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: arcee\n\nBaseten (baseten) disabled\n  format: openclaw\n  source: <workspace>/alix-replace-two-202\n[excerpt; SHA-256 covers full output]",
      "stdoutSha256": "3134ff465ff14edb4b55594dcadf27443d115ee20439f96f0908fcc3037fd04e",
      "stderr": "",
      "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    {
      "name": "plugin-inspect",
      "args": [
        "plugins",
        "inspect",
        "report-plugin"
      ],
      "exit": 0,
      "stdout": "PLUGIN_MARKER\nid: report-plugin\nPLUGIN_DESCRIPTION\n\nStatus: disabled\nFormat: openclaw\nSource: <fixture>/plugin/index.js\nOrigin: config\nTrust: reason=record-missing; registryPath=\"<fixture>/state/state/openclaw.sqlite\"; origin=\"config\"; installSource=null; installSpec=null\nVersion: 1.0.0\nShape: non-capability\nCapability mode: none\n\nReason: plugins disabled\n",
      "stdoutSha256": "b9c42ca77f4eacdbc4c42c532d4ec478cb9cd7c169763be1ffeb2d220f5b1a76",
      "stderr": "",
      "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    {
      "name": "tainted-plugin-json",
      "args": [
        "plugins",
        "inspect",
        "report-plugin",
        "--json"
      ],
      "exit": 0,
      "stdout": "{\n  \"workspaceDir\": \"<fixture>/workspace\",\n  \"plugin\": {\n    \"id\": \"report-plugin\",\n    \"name\": \"PLUGIN_MARKER\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\",\n    \"description\": \"PLUGIN_DESCRIPTION\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\",\n    \"packageVersion\": \"1.0.0\",\n    \"version\": \"1.0.0\",\n    \"packageName\": \"report-plugin\",\n    \"format\": \"openclaw\",\n    \"source\": \"<fixture>/plugin/index.js\",\n    \"rootDir\": \"<fixture>/plugin\",\n    \"origin\": \"config\",\n    \"workspaceDir\": \"<fixture>/workspace\",\n    \"trust\": {\n      \"reason\": \"record-missing\",\n      \"registryPath\": \"<fixture>/state/state/openclaw.sqlite\",\n      \"origin\": \"config\"\n    },\n    \"enabled\": false,\n    \"compat\": [],\n    \"explicitlyEnabled\": false,\n    \"activated\": false,\n    \"activationSource\": \"disabled\",\n    \"activationReason\": \"plugins disabled\",\n    \"syntheticAuthRefs\": [],\n    \"status\": \"disabled\",\n    \"toolNames\": [],\n    \"hookNames\": [],\n    \"channelIds\": [],\n    \"cliBackendIds\": [],\n    \"providerIds\": [],\n    \"embeddingProviderIds\": [],\n    \"speechProviderIds\": [],\n    \"realtimeTranscriptionProviderIds\": [],\n    \"realtimeVoiceProviderIds\": [],\n    \"mediaUnderstandingProviderIds\": [],\n    \"transcriptSourceProviderIds\": [],\n    \"imageGenerationProviderIds\": [],\n    \"videoGenerationProviderIds\": [],\n    \"musicGenerationProviderIds\": [],\n    \"webFetchProviderIds\": [],\n    \"webSearchProviderIds\": [],\n    \"migrationProviderIds\": [],\n    \"contextEngineIds\": [],\n    \"agentHarnessIds\": [],\n    \"cliCommands\": [],\n    \"services\": [],\n    \"gatewayDiscoveryServi\n[excerpt; SHA-256 covers full output]",
      "stdoutSha256": "245e23ec0dce85f9f10566a7ee9d2c7268ea0666cb2a417635d166239f60deac",
      "stderr": "",
      "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    {
      "name": "legal-plugin-list-verbose",
      "args": [
        "plugins",
        "list",
        "--verbose"
      ],
      "exit": 0,
      "stdout": "Plugins (0/177 enabled)\nTrust is provenance, not a code-safety guarantee.\nPLUGIN_MARKER (report-plugin) disabled\n  format: openclaw\n  source: <fixture>/plugin/index.js\n  origin: config\n  version: 1.0.0\n  trust: record-missing\n\nAbliteration (abliteration) disabled\n  format: openclaw\n  source: <checkout>/extensions/abliteration/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: abliteration\n\nAmazon Bedrock (amazon-bedrock) disabled\n  format: openclaw\n  source: <checkout>/extensions/amazon-bedrock/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: amazon-bedrock\n\nAmazon Bedrock Mantle (amazon-bedrock-mantle) disabled\n  format: openclaw\n  source: <checkout>/extensions/amazon-bedrock-mantle/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: amazon-bedrock-mantle\n\nAnthropic Vertex (anthropic-vertex) disabled\n  format: openclaw\n  source: <checkout>/extensions/anthropic-vertex/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: anthropic-vertex\n\n@openclaw/arcee-provider (arcee) disabled\n  format: openclaw\n  source: <checkout>/extensions/arcee/index.ts\n  origin: bundled\n  version: 2026.10.7\n  trust: bundled\n  providers: arcee\n\nBaseten (baseten) disabled\n  format: openclaw\n  source: <workspace>/alix-replace-two-202\n[excerpt; SHA-256 covers full output]",
      "stdoutSha256": "3134ff465ff14edb4b55594dcadf27443d115ee20439f96f0908fcc3037fd04e",
      "stderr": "",
      "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    {
      "name": "legal-plugin-inspect",
      "args": [
        "plugins",
        "inspect",
        "report-plugin"
      ],
      "exit": 0,
      "stdout": "PLUGIN_MARKER\nid: report-plugin\nPLUGIN_DESCRIPTION\n\nStatus: disabled\nFormat: openclaw\nSource: <fixture>/plugin/index.js\nOrigin: config\nTrust: reason=record-missing; registryPath=\"<fixture>/state/state/openclaw.sqlite\"; origin=\"config\"; installSource=null; installSpec=null\nVersion: 1.0.0\nShape: non-capability\nCapability mode: none\n\nReason: plugins disabled\n",
      "stdoutSha256": "b9c42ca77f4eacdbc4c42c532d4ec478cb9cd7c169763be1ffeb2d220f5b1a76",
      "stderr": "",
      "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    {
      "name": "missing-plugin-human",
      "args": [
        "plugins",
        "inspect",
        "missing-plugin\u001b]0;ALIX_CONTROL_PROOF\u0007�\nforged error"
      ],
      "exit": 1,
      "stdout": "",
      "stdoutSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "stderr": "Plugin not found: missing-plugin\\nforged error. Run `openclaw plugins list` to see installed plugins, or `openclaw plugins search missing-plugin\\nforged error` to look for installable plugins.\n",
      "stderrSha256": "777bfa2fcfad773ca7330b3dc991b97092e8824fcdbe88fd819b4ce00b682a37"
    },
    {
      "name": "missing-plugin-json",
      "args": [
        "plugins",
        "inspect",
        "missing-plugin\u001b]0;ALIX_CONTROL_PROOF\u0007�\nforged error",
        "--json"
      ],
      "exit": 1,
      "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"Plugin not found: missing-plugin\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\\nforged error. Run `openclaw plugins list` to see installed plugins, or `openclaw plugins search missing-plugin\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\\nforged error` to look for installable plugins.\"\n  }\n}\n",
      "stdoutSha256": "b0d201cf9d6182fc6458195a4615046430801eab0a2b841d58adb0c53425825f",
      "stderr": "",
      "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    }
  ],
  "cleanup": "All synthetic fixture directories are owned and retained with the receipt; no production state or channels touched."
}

Earlier evidence (historical SHAs and CI observations)

  • Product head: 292cf5f9ef550be6ba89df162f78dde3729143b0.
  • RED base: 520302d8ee63fd254e88042e96c393d8dc3ec461.
  • Normally built CLI: pnpm build qaRuntime, Node 26.1.0. Same local plugin fixture and CLI arguments on base and head, with isolated HOME, configuration, state, workspace, and temporary directories. Plugins are disabled; the fixture entrypoint throws if imported.
  • Entry and readback: real openclaw.mjs subprocesses, installed manifest discovery, and production list/inspect renderers; captured actual stdout, stderr, and exit status. Controls count C0 other than tab/newline/carriage return, plus DEL/C1.
Identical command on base and head RED control characters GREEN control characters Exit
node openclaw.mjs plugins list --verbose 3 0 0
node openclaw.mjs plugins inspect report-plugin 6 0 0

Exact-head GREEN receipt time: 2026-10-15 06:57 UTC; all five CLI subprocesses exited 0.

The production owners exercised were plugins-list-command.ts, plugins-list-format.ts, and plugins-inspect-command.ts, through metadata-only discovery. This does not claim provider or runtime handler execution.

Controls: replacing tainted names/descriptions with ordinary values preserves their human output and produces zero unsafe controls. plugins inspect report-plugin --json retains the exact tainted parsed name while escaping ESC in the serialized output. Command tests additionally exercise the default table, verbose list, inspect --all, trusted status colors, both single/all global diagnostic stderr, and list/inspect raw JSON values.

Synthetic manifest and inspectable output

The fixture has a normal package manifest with extension ./index.js, version 1.0.0, and an entrypoint that throws if imported. Its directory is an explicit plugin load path; plugins.enabled is false. The installed openclaw.plugin.json contains:

{"id":"report-plugin","name":"PLUGIN_MARKER\u001b]0;ALIX_CONTROL_PROOF\u0007\u009f","description":"PLUGIN_DESCRIPTION\u001b]0;ALIX_CONTROL_PROOF\u0007\u009f","configSchema":{"type":"object","properties":{}}}

Escaped excerpts of actual CLI stdout:

RED list:      PLUGIN_MARKER\u001b]0;ALIX_CONTROL_PROOF\u0007\u009f (report-plugin) disabled
GREEN list:    PLUGIN_MARKER (report-plugin) disabled
RED inspect:   PLUGIN_MARKER\u001b]0;ALIX_CONTROL_PROOF\u0007\u009f
               PLUGIN_DESCRIPTION\u001b]0;ALIX_CONTROL_PROOF\u0007\u009f
GREEN inspect: PLUGIN_MARKER
               PLUGIN_DESCRIPTION

The collector records the clean checkout SHA, timestamp, complete subprocess outputs, and numeric observations, and validates the matching clean buildstamp. Collector SHA-256: 77ecf3ee51f7af0ffcbc35d3a41a92abf37edc3dd090c31c415a96c8f20a98a6; its subprocess/isolation helper SHA-256: 9618fa1e6e0263e7ce22d485b7c1620a8db3cd0dee2ef11727c0d4253bace8cb. Evidence needed to assess the result is reproduced above.

Validation:

  • pnpm test src/cli/plugins-terminal-format.test.ts --maxWorkers 1: 9/9 passed, exit 0; single-file wall 26.04s (Vitest duration 18.76s).
  • Existing plugins-list-format, plugins-cli.list, plugins-cli.inspect, and plugins-list-route-cold-imports suites: 42/42 passed on the same production patch.
  • Native targeted type checking, typed lint, formatting, whitespace checks, line-cap ratchet, and independent adversarial review passed.
  • Production LOC: +52/-28; test LOC: +136/-0; four files total.

Existing-solutions preflight: reuse the canonical terminal sanitizer; all-state semantic/symbol searches and Alix/Leon open-file footprints found no competing fix. Human warning, default/verbose list, single/all inspection, install provenance, and inspection diagnostics are sanitized at their existing owner. Report JSON remains raw; diagnostic console envelopes continue using the existing formatter.

Cleanup: fixtures and captured outputs are retained in owned temporary directories outside the product branch. No production configuration, data, services, or channels were touched.

Not tested: a physical interactive terminal, loaded plugin/provider execution, authenticated external services, and other plugin lifecycle commands. This proves the real CLI byte boundary, not a PTY or runtime execution claim. Broad platform checks remain with PR CI.

@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Sanitize untrusted text in human-readable installed-plugin reports while preserving raw JSON metadata and trusted styling.

Example: Run openclaw plugins inspect report-plugin with the manifest name PLUGIN_MARKER\u001b]0;ALIX_CONTROL_PROOF\u0007.

  • Before: The report emits the embedded terminal-title control sequence.
  • After: The report prints PLUGIN_MARKER without the control sequence; JSON retains the original metadata.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with shipped-entry-point evidence, meaningful command-boundary coverage, and no open correctness findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The exact-head Linux built-CLI receipt exercises installed-manifest discovery through verbose list and single inspection, showing zero unsafe controls, preserved ordinary text, preserved raw JSON, and sanitized missing-ID errors; historical baseline traces demonstrate the defect.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Inspecting installed plugins can emit manifest-controlled terminal sequences even when the plugin runtime is disabled.
Reason: This restores safe human report rendering using an established sanitizer while retaining the existing output contracts and avoiding new options.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current terminal-output defect with a focused patch, credible built-CLI evidence, and no actionable findings.

Priority: P2
Reviewed head: 662557a4301c7347ffd185b81b1f7c66982c2fd8

Before merge

None.

Findings

None.

Agent review details

How this fits together

Installed-plugin manifests and discovery diagnostics become inventory and inspection reports; CLI renderers produce human-readable terminal output or structured JSON.

flowchart LR
  A[Installed plugin manifests] --> B[Metadata discovery]
  B --> C[Plugin reports]
  C --> D[Human report renderers]
  D --> E[Canonical terminal sanitizer]
  E --> F[Terminal output]
  C --> G[Raw JSON serialization]
Loading

Technical review

Best possible solution:

Land the focused sanitization at the existing human report owners while retaining raw JSON and trusted styling.

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

The manifest projector preserves the offending metadata and current-main renderers print it directly; the contributor also supplies historical failing CLI output and current-head corrected output, which I inspected without executing target code.

Is this the best way to solve the issue?

The patch uses the canonical terminal filter at the existing output boundaries, preserving structured data, lifecycle behavior, source formatting, and status colors without introducing additional machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main still exposes the reported path: Current main passes manifest-derived names and descriptions directly into single-plugin inspection output and verbose list formatting. (src/cli/plugins-inspect-command.ts:236, fb28b4d8f7de)
  • Owned metadata producer: The installed-index projector copies manifest names and descriptions into PluginRecord, establishing the concrete input path to the affected renderers. (src/plugins/status-snapshot.ts:254, 662557a4301c)
  • Introduced patch: The pinned introduction diff applies the existing sanitizer in the list and inspection output owners without adding a competing sanitizer, state, setting, or JSON projection. (src/cli/plugins-list-command.ts:101, 662557a4301c)
  • Built-CLI behavior evidence: The full PR body supplies exact-head built-CLI subprocess output for tainted and ordinary installed manifests, missing-plugin human errors, and raw JSON controls. Human output records zero unsafe controls; historical baseline output records the original failure. (662557a4301c)
  • Distinct command-boundary regressions: Added tests exercise default and verbose listing, single and all inspection, missing-ID errors, global diagnostic stderr, trusted status styling, and raw JSON preservation through the registered commands. (src/cli/plugins-terminal-format.test.ts:74, 662557a4301c)
  • Existing owner and intent: Scoped history and base-line blame identify the formatter extraction, diagnostic visibility repairs, path-aware home formatting, and inspection lifecycle refactor; the patch retains those contracts. (src/cli/plugins-list-format.ts:39, 27e7e5ee87cc)

Likely related people:

  • Peter Steinberger: Raw commit 2681bbd adds src/cli/plugins-list-format.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2681bbd9e7d1; files: src/cli/plugins-list-format.ts)
  • Vincent Koc: Raw commit 29444b2 adds src/cli/plugins-inspect-command.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 29444b26f281; files: src/cli/plugins-inspect-command.ts)
  • SunnyShu: Raw commit 5d973f1 adds src/cli/plugins-list-format.ts:51 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 5d973f1079e4; files: src/cli/plugins-list-format.ts)

PR surface

Source +24, Tests +153. Total +177 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 52 28 +24
Tests 1 153 0 +153
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 205 28 +177

Review metrics

Metric Value Why it matters
Production versus test changes Production +52/-28; tests +153/-0 Production growth adds filtering at distinct terminal boundaries; tests cover separate rendering, diagnostic, styling, and JSON contracts.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Installed-plugin metadata can alter terminal state during routine inspection; the repair is focused and does not change plugin execution or configuration.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-15T07:18:54.452Z sha 292cf5f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-23T04:16:22.336Z sha 0b78eac :: needs maintainer review before merge. :: none

Reviewed October 25, 2026, 9:40 AM ET / 13:40 UTC (Revision 3).

@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated product head: 0b78eac0af2238edc5558312e729af0fa4678a1c. Resolved main’s inspection formatter refactor in its current inline owner. Preserved human-output sanitization and raw JSON, and closed a separately reproduced missing-plugin-ID error path: only the human failure branch sanitizes controls; JSON retains the exact raw ID.

Related list/format/inspect suites passed; the added missing-ID human control first failed while JSON passed, then the final terminal suite passed 11/11. Type-aware lint/format and independent source/test review PASS. Normal cliStartup build has a clean exact-head stamp.

The current-head proof receipt includes the exact entry, canonical owner, readback, controls, cleanup and limitations. Required hosted CI is tracked separately; no all-green CI or maintainer product acceptance is claimed.

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated head: 662557a4301c7347ffd185b81b1f7c66982c2fd8. Resolved the actual plugin report-owner conflict and preserved current Trust columns and raw JSON. Fresh built CLI list/inspect/error and JSON controls are in the updated Evidence; 57 related tests and the separate 11-case changed-file run pass.

The updated Evidence records current verification and the exact reuse boundaries. Required CI is green on this head. Independent source review and publication preflight passed. Any existing maintainer product/compatibility decision remains pending; this update does not imply acceptance.

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Oct 26, 2026
…ll preview

The uninstall preview sanitizes the manifest display name (openclaw#183708) but
renders preview.pluginId and package-entry ids raw. Local-path installs
only path-validate ids (validatePluginId), so a manifest id carrying
ESC/BEL reaches the dry-run preview terminal output unchanged, bypassing
the name sanitization. Strip control characters from the owner id and
package entry ids with the existing sanitizeTerminalText helper, matching
the id handling in plugins list/inspect (openclaw#172873).
obviyus added a commit that referenced this pull request Oct 27, 2026
fix(cli): escape terminal controls in untrusted values through one owner

CLI human-readable output printed user-controlled values such as config paths, names, directories, binding descriptions, plugin metadata and dead-letter scopes without neutralizing terminal control sequences, so a crafted value could inject ANSI, OSC 8 or C1 sequences into the terminal. Earlier fixes wrapped one call site at a time. A single owner now does this: `terminalText` in terminal-core's safe-text escapes interpolated values before styling, and the display-only `displayPath` delegates to it. Raw path shortening, JSON output and the trusted styling of `renderTable` are unchanged, and the per-site wrapping is replaced.

This absorbs #184685, #184666, #184324, #184303, #176763, #176773 and #172873 by @Alix-007 and #184861 by @qingminglong, whose original commits are kept, and moves the earlier merged per-site fixes onto the same owner.

Evidence: built CLI in a secretless container, with ESC/CSI, OSC 8 and C1 sequences injected into values for eleven commands across eight families. Main printed the raw sequences; this change printed them neutralized, normal colored output and JSON values were unchanged, and dead-letter errors keep their stderr and JSON contracts. Raw-byte captures: #185927 (comment). Production +81.

Co-authored-by: Alix-007 <[email protected]>
Co-authored-by: qingminlong <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
@obviyus

obviyus commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

@shakkernerd: #185927 (2d2b465) landed a root-cause fix that routes the covered CLI report values through one terminalText owner, and it covers this PR's output sites. @Alix-007's commit from this PR is kept there with co-author credit. Leaving the close to you since it's assigned to you.

Rechecked against current main 7b31ab208c80123884bb3d67842331122e48d3d6: Plugin list and inspect human tables, descriptions, diagnostics and paths use terminalText/displayPath before styling; the JSON paths remain separate. The site is fixed on main. This PR remains open for its assignee.

@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Oct 28, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
fix(cli): escape terminal controls in untrusted values through one owner

CLI human-readable output printed user-controlled values such as config paths, names, directories, binding descriptions, plugin metadata and dead-letter scopes without neutralizing terminal control sequences, so a crafted value could inject ANSI, OSC 8 or C1 sequences into the terminal. Earlier fixes wrapped one call site at a time. A single owner now does this: `terminalText` in terminal-core's safe-text escapes interpolated values before styling, and the display-only `displayPath` delegates to it. Raw path shortening, JSON output and the trusted styling of `renderTable` are unchanged, and the per-site wrapping is replaced.

This absorbs openclaw#184685, openclaw#184666, openclaw#184324, openclaw#184303, openclaw#176763, openclaw#176773 and openclaw#172873 by @Alix-007 and openclaw#184861 by @qingminglong, whose original commits are kept, and moves the earlier merged per-site fixes onto the same owner.

Evidence: built CLI in a secretless container, with ESC/CSI, OSC 8 and C1 sequences injected into values for eleven commands across eight families. Main printed the raw sequences; this change printed them neutralized, normal colored output and JSON values were unchanged, and dead-letter errors keep their stderr and JSON contracts. Raw-byte captures: openclaw#185927 (comment). Production +81.

Co-authored-by: Alix-007 <[email protected]>
Co-authored-by: qingminlong <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for verifying the plugin reports against the shared fix. Appreciate you taking the time to follow up.

@Alix-007

Alix-007 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi @shakkernerd, could you take a look at the final disposition here when you have a chance? It's been open for over a week; #185927 already includes the fix with co-author credit. Thanks!

@Alix-007 Alix-007 closed this Nov 2, 2026
@Alix-007

Alix-007 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing this as absorbed by the merged #185927, with contributor credit retained. Thanks @obviyus for integrating the fix, and @shakkernerd for taking a look!

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

Labels

clawtributor-review Clawtributor pull request awaiting prioritized maintainer review clawtributors PR from a clawtributor cli CLI command changes P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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.

4 participants