Skip to content

[Bug]: Multiple runtime policy & extension issues: lspci bridge diagnosis blocked in View mode, phantom bcm_search_docs tool, broken test_bcm_docs.py import, and Grafana crash on empty prometheusUrl #69

Open

Description

@Akshatshukla-25

AI Factory Operations Agent version

main branch (commit a5d07b6) / v0.0.1

Kubernetes version

1.30+

Installation method

Helm chart from source

Enabled modules and relevant configuration

modules:
kubernetes:
enabled: true
bcm:
enabled: true
observability:
enabled: true
grafana:
enabled: true
edit:
enabled: false # Default View mode
observability:
prometheusUrl: "" # When Prometheus is omitted or VictoriaMetrics/Loki used independently
loki:
url: "http://loki:3100"

Description

Several reproducible issues across extensions, diagnostic policies, and unit tests impact cluster investigations and developer workflows:

  1. lspci -s <bridge> -vvv Blocked in View Mode:

    • skills/gpu-networking/references/gpu-network-path.md explicitly instructs agents to inspect PCIe ancestor bridges using lspci -s <bridge> -vvv or lspci -s "$bridge_bdf" -vvv.
    • However, diagnostic-policy.ts validates lspci with flags(/^(-[Dknmvx]+|-[a-zA-Z]{2,})$/). This rejects the -s flag (fails both the character set and min-length requirement) as well as the BDF address argument (e.g. 0000:01:00.0 does not begin with -).
    • Consequently, in View mode, automation-guard classifies the command as an unapproved Edit mutation and blocks it.
  2. Phantom bcm_search_docs Tool Registration in bcm/index.ts:

    • In commit f138c26d, BCM manuals were updated to be extracted directly from the UI image into the workspace, and SKILL.md was updated with: "Never call bcm_search_docs; that tool is not available".
    • bcm_search_docs was removed from openclaw.plugin.json contracts and bcm-mcp-ssh-server.py.
    • However, bcm/index.ts (lines 909–933) still registers bcm_search_docs and dispatches to "search_bcm_docs". Because it was omitted from READ_ONLY_TOOLS in automation-context.ts, it is blocked in View mode and fails if executed.
  3. Orphan test_bcm_docs.py Fails Python Test Discovery:

    • helm/mosaic-stack/tests/test_bcm_docs.py unconditionally imports files/docs/download_bcm_docs.py, which is not present in the repository. Running python3 -m unittest discover fails with an uncaught FileNotFoundError.
  4. Grafana Extension Crashes Agent Startup on Empty prometheusUrl:

    • observability/grafana.ts unconditionally executes resolveString(api.pluginConfig, "prometheusUrl") without a fallback.
    • If Grafana is enabled for Loki logs alone or without a separate Prometheus endpoint (e.g. when configured with --set observability.prometheusUrl=""), OpenClaw crashes at startup with Error: observability.prometheusUrl is required.
  5. Path Prefix Discarded in utils/mosaic-mcp.mjs:

    • new URL(path, baseUrl) strips any pathname in MOSAIC_URL when path begins with /, breaking MCP clients connecting through subpath ingress routes (e.g., https://cluster.internal/mosaic).

Reproduction steps

# 1. Verify lspci bridge diagnosis is rejected by diagnostic policy
node -e '
import("./helm/mosaic-stack/files/openclaw-seed/extensions/diagnostic-policy.ts")
  .then(m => console.log("lspci -s bridge allowed:", m.isAllowedDiagnosticArgv(["lspci", "-s", "0000:01:00.0", "-vvv"])));
'

# 2. Verify test discovery failure due to missing download_bcm_docs.py
python3 -m unittest discover -s helm/mosaic-stack/tests

# 3. Verify Grafana plugin startup crash on empty prometheusUrl
node -e '
import("./helm/mosaic-stack/files/openclaw-seed/extensions/observability/grafana.ts")
  .then(m => m.registerGrafanaTools({
    pluginConfig: {
      grafanaEnabled: true,
      grafanaUrl: "http://grafana:3000",
      prometheusUrl: "",
      datasourceUid: "loki-uid",
      datasourceType: "loki"
    },
    registerTool: () => {}
  }));
'

# 4. Verify subpath loss in mosaic-mcp URL construction
node -e 'console.log(new URL("/api/openclaw/tools", "https://cluster.internal/mosaic").href)'

Relevant sanitized logs

# lspci output:
lspci -s bridge allowed: false

# Test discovery output:
ERROR: test_bcm_docs (unittest.loader._FailedTest.test_bcm_docs)
ImportError: Failed to import test module: test_bcm_docs
FileNotFoundError: [Errno 2] No such file or directory: '.../helm/mosaic-stack/files/docs/download_bcm_docs.py'
FAILED (errors=1)

# Grafana plugin output:
Error: observability.prometheusUrl is required
    at resolveString (.../grafana.ts:37:9)
    at registerGrafanaTools (.../grafana.ts:363:25)

# URL resolution output:
https://cluster.internal/api/openclaw/tools # Note: /mosaic path prefix was dropped

Code of Conduct

  • I agree to follow the AI Factory Operations Agent Code of Conduct.
  • I searched open issues and found no duplicate.

Activity

  1. RohanAdwankar commented on Oct 28, 2026

    @RohanAdwankar
    Member

    Thanks for reporting, I'll take a look.

  2. Akshatshukla-25 commented on Oct 31, 2026

    @Akshatshukla-25
    Author
  3. RohanAdwankar commented on Nov 2, 2026

    @RohanAdwankar
    Member

    Hi @Akshatshukla-25 do you mind breaking down your PR into the separate changes you are requesting?
    I see changes to the lspci policy which seem independent to the other tool use cases.

  4. Akshatshukla-25 commented on Nov 3, 2026

    @Akshatshukla-25
    Author

    Hi @RohanAdwankar ,
    sure I have closed the previous multi-component PR and opened a focused, standalone PR strictly covering the lspci diagnostic policy change: #92.

    I will submit the other tool extension fixes in a separate follow up PR.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions