Skip to content

fix(dispatch): suppress provider inventory on shared surfaces#75728

Closed
gazeatcode wants to merge 1 commit intoopenclaw:mainfrom
gazeatcode:fix/issue-75166-provider-inventory-shared-surface
Closed

fix(dispatch): suppress provider inventory on shared surfaces#75728
gazeatcode wants to merge 1 commit intoopenclaw:mainfrom
gazeatcode:fix/issue-75166-provider-inventory-shared-surface

Conversation

@gazeatcode
Copy link
Copy Markdown

Summary

  • Problem: image/video provider inventory tool output can be visible on shared chat surfaces.
  • Why it matters: provider availability, auth hints, and operator-environment details belong in direct diagnostics, not group/channel delivery.
  • What changed: tag image/video provider inventory tool results, suppress that tagged text on non-direct surfaces before tool TTS runs, and preserve generated media plus direct-chat diagnostics.
  • What did NOT change (scope boundary): normal tool summaries, direct-chat verbose output, media delivery, provider selection, and generation behavior are unchanged.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Root Cause (if applicable)

  • Root cause: completed image/video provider inventory results were treated like ordinary visible tool output after agent execution.
  • Missing detection / guardrail: the dispatcher had no typed way to distinguish internal provider inventory from normal tool result text before shared-surface delivery and tool TTS synthesis.
  • Contributing context (if known): verbose/full tool-output delivery is useful in direct diagnostics, but shared chat delivery needs a stricter rule for internal operator-environment inventory.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/agents/tool-output-shapes.test.ts, src/auto-reply/reply/dispatch-from-config.test.ts, src/agents/pi-embedded-subscribe.handlers.tools.media.test.ts
  • Scenario the test should lock in: image/video provider inventory is tagged, non-direct delivery suppresses the text before tool TTS, generated media still delivers, and direct chats still receive diagnostics.
  • Why this is the smallest reliable guardrail: the classifier test locks the producer shape, and the dispatcher tests lock the shared-surface delivery seam where text/TTS/media decisions happen.
  • Existing test that already covers this (if any): media handler coverage validates the existing image/video result path still works.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

Shared chat surfaces no longer receive image/video provider inventory text. Direct chats keep that diagnostic output visible.

Diagram (if applicable)

Before:
image/video provider inventory -> ordinary tool result -> shared text/TTS delivery

After:
image/video provider inventory -> tagged internal shape -> shared text/TTS suppressed, media preserved

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: Node 22 with repo pnpm
  • Model/provider: mocked image/video tool result payloads
  • Integration/channel (if any): Discord channel and Telegram group/direct dispatcher contexts
  • Relevant config (redacted): automatic group reply config with TTS mode exercised in tests

Steps

  1. Emit an image_generate or video_generate list result with details.providers.
  2. Deliver it through a non-direct chat with tool TTS enabled.
  3. Deliver the same tagged payload through a direct chat.

Expected

  • Non-direct chats suppress provider inventory text before TTS.
  • Non-direct media-only payloads still deliver media.
  • Direct chats keep provider inventory diagnostics visible.

Actual

  • Matches expected with the new dispatcher and classifier coverage.

Evidence

  • Trace/log snippets

Commands run locally:

  • pnpm test src/agents/tool-output-shapes.test.ts src/auto-reply/reply/dispatch-from-config.test.ts --run
  • pnpm test src/agents/pi-embedded-subscribe.handlers.tools.media.test.ts --run
  • pnpm changed:lanes --base refs/tmp/openclaw-main-current --json
  • pnpm check:changed --base refs/tmp/openclaw-main-current
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/tools/thinking.md src/agents/pi-embedded-subscribe.ts src/agents/runtime-plan/types.ts src/agents/tool-output-shapes.ts src/agents/tool-output-shapes.test.ts src/auto-reply/reply-payload.ts src/auto-reply/reply/dispatch-from-config.ts src/auto-reply/reply/dispatch-from-config.test.ts
  • git diff --check refs/tmp/openclaw-main-current...

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: provider inventory classifier, non-direct pre-TTS suppression, non-direct media preservation, direct-chat diagnostics, existing image/video media handler behavior, changed-lane gate.
  • Edge cases checked: unrelated tools with details.providers are not tagged; image/video media results without provider inventory are not tagged; group/channel suppression strips text and spokenText while preserving media.
  • What you did not verify: live Discord/Telegram delivery against real accounts.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: shared chats may lose a diagnostic provider inventory message that was useful during debugging.
    • Mitigation: direct chats keep the diagnostic visible, and generated media still delivers on shared surfaces.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels May 1, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 1, 2026

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded. The linked provider-inventory leak was resolved by the merged canonical PR #75550 and current main now removes the hidden-output compact inventory bypass with regression coverage; this PR’s remaining direct-only verbose/full behavior is a separate delivery-policy choice rather than the merge vehicle for the already-closed bug.

So I’m closing this here and keeping the remaining discussion on the canonical linked item.

Review details

Best possible solution:

Keep #75550 as the canonical #75166 fix, and open a new maintainer-owned policy issue if shared-surface verbose/full diagnostics should be restricted further.

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

Yes. For this PR’s stricter behavior, current main still has a source-level path where verbose/full tool output emits image/video provider inventory and Discord-style channel surfaces send tool summaries; the default hidden-output leak from #75166 is no longer reproduced because #75550 removed the compact bypass.

Is this the best way to solve the issue?

No. The best cleanup path is not to merge this branch, because #75550 already landed the canonical #75166 fix and this PR’s remaining direct-only verbose/full policy should be handled separately if maintainers want it.

Security review:

Security review cleared: The proposed diff narrows shared-surface delivery of provider inventory and does not add dependencies, workflows, secret handling, network calls, or execution surfaces.

What I checked:

Likely related people:

  • vincentkoc: Current-main blame for the relevant handler, dispatcher, tests, and changelog points to Vincent Koc, and local history also shows prior image-generation provider migration work in commit 21c2ba4. (role: recent maintainer and adjacent media/reply-routing owner; confidence: high; commits: 188c3b74badc, 21c2ba480a80; files: src/agents/pi-embedded-subscribe.handlers.tools.ts, src/auto-reply/reply/dispatch-from-config.ts, src/agents/pi-embedded-subscribe.handlers.tools.media.test.ts)
  • steipete: Commit 932194b added video provider support and Discord fallback, matching the historical provider-inventory behavior referenced by the linked bug and prior review context. (role: introduced adjacent provider/media behavior and central maintainer; confidence: medium; commits: 932194b7d58c; files: src/agents/tools/image-generate-tool.ts, src/agents/tools/media-generate-tool-actions-shared.ts, src/agents/pi-embedded-subscribe.handlers.tools.ts)
  • MkDev11: The merged superseding PR fix: keep media provider inventory internal #75550 was authored by MkDev11 and is the current canonical fix path for [Bug]: image/video provider inventory leaks into Discord group channels as visible tool output #75166. (role: canonical fix contributor; confidence: medium; commits: 56069df90306; files: src/agents/pi-embedded-subscribe.handlers.tools.ts, src/agents/pi-embedded-subscribe.handlers.tools.media.test.ts, CHANGELOG.md)

Codex review notes: model gpt-5.5, reasoning high; reviewed against ae87f7800b2a.

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: image/video provider inventory leaks into Discord group channels as visible tool output

1 participant