openclaw - ✅(Solved) Fix gateway config.patch blocks `diagnostics.cacheTrace.*` even with content capture disabled [1 pull requests, 1 participants]

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…
GitHub stats
openclaw/openclaw#72883Fetched 2026-04-28 06:30:56
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

gateway.config.patch (and the underlying protected-paths list) refuses to set diagnostics.cacheTrace.enabled even when the patch also explicitly disables all sensitive content capture (includeMessages: false, includePrompt: false, includeSystem: false).

The schema help text for diagnostics.cacheTrace says:

Enable this temporarily for debugging and disable afterward to reduce sensitive log footprint.

That guidance implies the protection rationale is the sensitive payload capture, not the trace itself. But protection is enforced uniformly across the entire subtree, so users have no way to enable cache-decision observability via the supported tool path even with a safe (decision/stage-only) configuration.

Root Cause

gateway.config.patch (and the underlying protected-paths list) refuses to set diagnostics.cacheTrace.enabled even when the patch also explicitly disables all sensitive content capture (includeMessages: false, includePrompt: false, includeSystem: false).

The schema help text for diagnostics.cacheTrace says:

Enable this temporarily for debugging and disable afterward to reduce sensitive log footprint.

That guidance implies the protection rationale is the sensitive payload capture, not the trace itself. But protection is enforced uniformly across the entire subtree, so users have no way to enable cache-decision observability via the supported tool path even with a safe (decision/stage-only) configuration.

Fix Action

Fix / Workaround

Summary

gateway.config.patch (and the underlying protected-paths list) refuses to set diagnostics.cacheTrace.enabled even when the patch also explicitly disables all sensitive content capture (includeMessages: false, includePrompt: false, includeSystem: false).

gateway config.patch '{"diagnostics":{"cacheTrace":{"enabled":true,"includeMessages":false,"includePrompt":false,"includeSystem":false}}}'
→ "gateway config.patch cannot change protected config paths: diagnostics.cacheTrace.enabled, diagnostics.cacheTrace.includeMessages, diagnostics.cacheTrace.includePrompt, diagnostics.cacheTrace.includeSystem"

Suggested fix

Either:

  1. Allow diagnostics.cacheTrace.enabled via config.patch when the same patch sets all three include* flags to false, or
  2. Permit diagnostics.cacheTrace.enabled unconditionally and keep only the include* flags as protected (since those are the ones with sensitive-data implications), or
  3. Add a dedicated gateway diagnostics cache-trace enable --safe CLI/tool action that enables tracing with content capture forced off.

PR fix notes

PR #73098: Allow safe cache trace config patches

Description (problem / solution / changelog)

Summary

  • allow gateway config.patch/apply to change diagnostics.cacheTrace only when content capture is fully disabled
  • keep cache trace content capture fields protected when a patch would enable/include sensitive payloads
  • add regression coverage for safe enablement, missing safe flags, and re-enabling content capture

Fixes #72883

Validation

  • pnpm exec oxfmt --write --threads=1 src/agents/tools/gateway-tool.ts src/agents/openclaw-gateway-tool.test.ts
  • pnpm exec oxlint src/agents/tools/gateway-tool.ts src/agents/openclaw-gateway-tool.test.ts
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/openclaw-gateway-tool.test.ts

Changed files

  • src/agents/openclaw-gateway-tool.test.ts (modified, +91/-0)
  • src/agents/tools/gateway-tool.ts (modified, +43/-1)

Code Example

gateway config.patch '{"diagnostics":{"cacheTrace":{"enabled":true,"includeMessages":false,"includePrompt":false,"includeSystem":false}}}'
"gateway config.patch cannot change protected config paths: diagnostics.cacheTrace.enabled, diagnostics.cacheTrace.includeMessages, diagnostics.cacheTrace.includePrompt, diagnostics.cacheTrace.includeSystem"
RAW_BUFFERClick to expand / collapse

Summary

gateway.config.patch (and the underlying protected-paths list) refuses to set diagnostics.cacheTrace.enabled even when the patch also explicitly disables all sensitive content capture (includeMessages: false, includePrompt: false, includeSystem: false).

The schema help text for diagnostics.cacheTrace says:

Enable this temporarily for debugging and disable afterward to reduce sensitive log footprint.

That guidance implies the protection rationale is the sensitive payload capture, not the trace itself. But protection is enforced uniformly across the entire subtree, so users have no way to enable cache-decision observability via the supported tool path even with a safe (decision/stage-only) configuration.

Reproduction

Tested on 2026.4.24:

gateway config.patch '{"diagnostics":{"cacheTrace":{"enabled":true,"includeMessages":false,"includePrompt":false,"includeSystem":false}}}'
→ "gateway config.patch cannot change protected config paths: diagnostics.cacheTrace.enabled, diagnostics.cacheTrace.includeMessages, diagnostics.cacheTrace.includePrompt, diagnostics.cacheTrace.includeSystem"

Suggested fix

Either:

  1. Allow diagnostics.cacheTrace.enabled via config.patch when the same patch sets all three include* flags to false, or
  2. Permit diagnostics.cacheTrace.enabled unconditionally and keep only the include* flags as protected (since those are the ones with sensitive-data implications), or
  3. Add a dedicated gateway diagnostics cache-trace enable --safe CLI/tool action that enables tracing with content capture forced off.

Why it matters

Without this, operators who want real cache hit/miss data to validate their agents.defaults.models.*.params.cacheRetention settings have no path that doesn't require a direct config-file edit + restart, which bypasses the gateway's safety surface entirely.

Environment

  • OpenClaw 2026.4.24 (cbcfdf6)
  • Darwin 25.3.0 / arm64 / node v25.9.0

extent analysis

TL;DR

Enable diagnostics.cacheTrace.enabled via a dedicated CLI action or modify the protection rules for config.patch to allow this setting when sensitive content capture is disabled.

Guidance

  • Review the gateway.config.patch protection rules to determine if they can be modified to allow diagnostics.cacheTrace.enabled when includeMessages, includePrompt, and includeSystem are set to false.
  • Consider adding a dedicated gateway diagnostics cache-trace enable --safe CLI action to enable tracing with content capture forced off.
  • Evaluate the trade-offs between the suggested fix options: modifying protection rules, adding a CLI action, or keeping the current protection rules and using a different approach for cache hit/miss data validation.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a configuration or CLI action adjustment.

Notes

The suggested fixes aim to balance the need for cache hit/miss data validation with the protection of sensitive log content. The chosen solution should consider the specific use case and security requirements.

Recommendation

Apply workaround: Add a dedicated gateway diagnostics cache-trace enable --safe CLI action to enable tracing with content capture forced off, as this approach maintains the current protection rules while providing a safe path for operators to validate cache settings.

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 - ✅(Solved) Fix gateway config.patch blocks `diagnostics.cacheTrace.*` even with content capture disabled [1 pull requests, 1 participants]