openclaw - 💡(How to fix) Fix tools.config.schema.lookup on unknown path surfaces a JS TypeError to channels instead of a clean tool-result [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When a bot calls tools.config.schema.lookup with a path that doesn't exist in the OC config schema, the gateway logs a clean error internally but the unhandled JS exception (TypeError: Cannot read properties of undefined (reading 'split')) is what gets surfaced to the channel as a ⚠️🔌 Gateway: <path> failed chip. The bot's underlying work succeeded — the chip is cosmetic noise from a separate exploratory schema lookup during the same turn.

Error Message

⚠️🔌 Gateway: agents.main.authorizedSenders failed Assistant: main Error: Cannot read properties of undefined (reading 'split')

Root Cause

When a bot calls tools.config.schema.lookup with a path that doesn't exist in the OC config schema, the gateway logs a clean error internally but the unhandled JS exception (TypeError: Cannot read properties of undefined (reading 'split')) is what gets surfaced to the channel as a ⚠️🔌 Gateway: <path> failed chip. The bot's underlying work succeeded — the chip is cosmetic noise from a separate exploratory schema lookup during the same turn.

Fix Action

Fixed

Code Example

{"action": "config.schema.lookup", "path": "agents.main.authorizedSenders"}

---

[tools] gateway failed: config schema path not found
     raw_params={"action":"config.schema.lookup","path":"agents.main.authorizedSenders"}

---

⚠️🔌 Gateway: agents.main.authorizedSenders failed
   Assistant: main
   Error: Cannot read properties of undefined (reading 'split')

---

const node = resolveSchemaPath(path);
if (!node) {
  return { ok: false, code: "schema_path_not_found", path };
}
RAW_BUFFERClick to expand / collapse

Summary

When a bot calls tools.config.schema.lookup with a path that doesn't exist in the OC config schema, the gateway logs a clean error internally but the unhandled JS exception (TypeError: Cannot read properties of undefined (reading 'split')) is what gets surfaced to the channel as a ⚠️🔌 Gateway: <path> failed chip. The bot's underlying work succeeded — the chip is cosmetic noise from a separate exploratory schema lookup during the same turn.

Repro

  1. Have a bot (Slack, in our case) call tools.config.schema.lookup with a non-existent path, e.g.:
    {"action": "config.schema.lookup", "path": "agents.main.authorizedSenders"}
  2. Observe the gateway error log (clean):
    [tools] gateway failed: config schema path not found
      raw_params={"action":"config.schema.lookup","path":"agents.main.authorizedSenders"}
  3. Observe the chip delivered to Slack (raw JS error):
    ⚠️🔌 Gateway: agents.main.authorizedSenders failed
    Assistant: main
    Error: Cannot read properties of undefined (reading 'split')

Expected

tools.config.schema.lookup against an unknown path should return a structured tool-result indicating "path not found" — exploratory schema lookups are a legitimate discovery move and a miss is informative, not a gateway failure. The user-visible chip should not fire at all for this case (it's an in-band tool result, not a gateway error), and the JS exception should not propagate.

Actual

Two layers seem confused:

  • The schema resolver returns undefined for unknown paths.
  • A downstream code path (chip renderer? error serializer?) then calls .split(...) on the undefined schema object and crashes.
  • The crash is caught one level up and routed to the channel-error chip pipeline, which embeds the raw JS message and the requested path.

The internal log line ("config schema path not found") shows OC already classifies this case correctly — it just doesn't reach the user-facing output path.

Environment

  • OC version: 2026.5.28 (e932160)
  • Plugin surface: Slack gateway, socket mode
  • Date observed: 2026-05-31

Suggested fix

Treat unknown schema paths as a first-class tool-result:

const node = resolveSchemaPath(path);
if (!node) {
  return { ok: false, code: "schema_path_not_found", path };
}

…before any downstream code that assumes node is defined. And gate the channel-error chip so it doesn't fire on tools.* returning a structured error — those belong in the tool-call message, not in a sidebar warning.

Related

  • Mirrors the shape of #87371 (exec preflight error reporting): an upstream check returns useful info internally but the user-facing surface shows a raw JS error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix tools.config.schema.lookup on unknown path surfaces a JS TypeError to channels instead of a clean tool-result [1 pull requests]