openclaw - 💡(How to fix) Fix [Bug]: image/video provider inventory leaks into Discord group channels as visible tool output [1 comments, 2 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#75166Fetched 2026-05-01 05:37:25
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
2
Author
Timeline (top)
commented ×1

image_generate / video_generate provider inventory output can be delivered into Discord group channels as user-visible tool output, leaking internal provider/model/configured/auth-hint information.

This is not an API-key leak, but it exposes operator environment details that should stay internal, especially on group surfaces.

Root Cause

This is similar in class to previous group-surface internal trace leaks such as #70912, though the data here is provider inventory rather than Working… tool traces.

Impact:

  • Reveals which providers/models are installed or configured.
  • Reveals auth mechanism hints / env var names.
  • Creates noisy, surprising messages in group channels.
  • Makes operators less likely to trust media-generation tools in shared spaces.

Code Example

const COMPACT_PROVIDER_INVENTORY_TOOLS = new Set(["image_generate", "video_generate"]);

function shouldEmitCompactToolOutput(params: {
  toolName: string;
  result: unknown;
  outputText?: string;
}): boolean {
  if (!COMPACT_PROVIDER_INVENTORY_TOOLS.has(params.toolName)) {
    return false;
  }
  if (!hasProviderInventoryDetails(params.result)) {
    return false;
  }
  return Boolean(params.outputText?.trim());
}

---

ctx.shouldEmitToolOutput() || shouldEmitCompactToolOutput({ toolName, result, outputText })
RAW_BUFFERClick to expand / collapse

Summary

image_generate / video_generate provider inventory output can be delivered into Discord group channels as user-visible tool output, leaking internal provider/model/configured/auth-hint information.

This is not an API-key leak, but it exposes operator environment details that should stay internal, especially on group surfaces.

Affected versions

Confirmed by inspecting npm package dist:

  • 2026.4.24: affected
  • 2026.4.27: affected
  • 2026.4.29-beta.1: affected

The behavior appears to have been introduced in 2026.4.5 by commit 932194b (feat(video): add provider support and discord fallback), which added compact provider inventory emission for image_generate / video_generate.

Environment where observed

  • OpenClaw app: 2026.4.24
  • Channel: Discord
  • Surface: group/channel
  • Tool profile: full/coding-capable agent with image_generate

Repro

  1. In a Discord channel, ask the agent to perform an image generation/editing task where it decides to inspect available image-generation providers first.
  2. The agent calls:
    • image_generate with action: "list"
  3. The provider inventory output is posted into Discord as visible text, e.g. lines containing:
    • provider ids
    • model names
    • configured: yes/no
    • auth hints such as required env var names
    • capabilities / supported sizes / aspect ratios

Expected

Provider inventory should be available to the agent internally, but it should not be emitted to external chat surfaces by default.

For group channels, this kind of runtime/environment inventory should be treated as diagnostic/internal data unless the operator explicitly asks to display it.

Actual

The compact provider inventory is emitted to Discord as user-visible tool output.

Code pointer

Current dist/source contains this logic in src/agents/pi-embedded-subscribe.handlers.tools.ts:

const COMPACT_PROVIDER_INVENTORY_TOOLS = new Set(["image_generate", "video_generate"]);

function shouldEmitCompactToolOutput(params: {
  toolName: string;
  result: unknown;
  outputText?: string;
}): boolean {
  if (!COMPACT_PROVIDER_INVENTORY_TOOLS.has(params.toolName)) {
    return false;
  }
  if (!hasProviderInventoryDetails(params.result)) {
    return false;
  }
  return Boolean(params.outputText?.trim());
}

Then tool output emission uses:

ctx.shouldEmitToolOutput() || shouldEmitCompactToolOutput({ toolName, result, outputText })

So provider inventory can bypass the normal tool-output visibility decision.

Why this matters

This is similar in class to previous group-surface internal trace leaks such as #70912, though the data here is provider inventory rather than Working… tool traces.

Impact:

  • Reveals which providers/models are installed or configured.
  • Reveals auth mechanism hints / env var names.
  • Creates noisy, surprising messages in group channels.
  • Makes operators less likely to trust media-generation tools in shared spaces.

Suggested fix direction

Prefer not to emit compact provider inventory to external chat surfaces by default.

Possible approaches:

  1. Remove image_generate / video_generate from compact tool-output emission entirely.
  2. Gate it on direct/private surfaces only.
  3. Gate it on explicit verbose/debug mode only.
  4. Redact provider inventory before external delivery, while keeping the full result in the agent/tool context.

The generated media delivery path should remain unchanged; only the action=list inventory output needs suppression or stricter gating.

extent analysis

TL;DR

The issue can be fixed by modifying the shouldEmitCompactToolOutput function to restrict the emission of compact provider inventory to internal or private surfaces.

Guidance

  • Review the shouldEmitCompactToolOutput function in src/agents/pi-embedded-subscribe.handlers.tools.ts to understand the current logic for emitting compact tool output.
  • Consider removing image_generate and video_generate from COMPACT_PROVIDER_INVENTORY_TOOLS to prevent their inventory from being emitted to external chat surfaces.
  • Alternatively, modify the shouldEmitCompactToolOutput function to check for private or internal surfaces before emitting the compact provider inventory.
  • Evaluate the suggested fix approaches, such as gating the emission on direct/private surfaces only, explicit verbose/debug mode only, or redacting provider inventory before external delivery.

Example

function shouldEmitCompactToolOutput(params: {
  toolName: string;
  result: unknown;
  outputText?: string;
  surface: string; // Add surface information
}): boolean {
  if (!COMPACT_PROVIDER_INVENTORY_TOOLS.has(params.toolName)) {
    return false;
  }
  if (!hasProviderInventoryDetails(params.result)) {
    return false;
  }
  // Only emit on private or internal surfaces
  if (params.surface !== 'private' && params.surface !== 'internal') {
    return false;
  }
  return Boolean(params.outputText?.trim());
}

Notes

The fix should ensure that the provider inventory is not emitted to external chat surfaces by default, while still allowing the agent to access the inventory internally.

Recommendation

Apply a workaround by modifying the shouldEmitCompactToolOutput function to restrict the emission of compact provider inventory to internal or private surfaces, as this approach is less invasive and can be implemented quickly.

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 [Bug]: image/video provider inventory leaks into Discord group channels as visible tool output [1 comments, 2 participants]