Skip to content

bug(agents): visible tool-result text can collapse to attachment placeholder #97267

Description

@snowzlmbot

Problem

Visible OpenClaw session output can replace tool-result text with an attachment placeholder even when the underlying tool result is structured non-image content.

Impact

This makes local tool verification unreliable because ordinary tool output can disappear from the visible transcript and be replaced by a placeholder.

Suspected source

extractToolResultText in src/agents/embedded-agent-subscribe.tools.ts originally only collected explicit text content blocks. Structured non-image blocks like JSON/resource content therefore produced no visible text in the subscription/display path.

Expected

  • Structured non-image tool-result blocks should be serialized into safe visible text.
  • True image-only blocks should remain skipped or handled by media delivery.

Local fix

  • Add a narrow structured-block fallback inside extractToolResultText.
  • Skip text and image blocks in the fallback.
  • Add a focused unit test covering structured non-image output and mixed text/image output.

Local evidence

  • git diff --check
  • node scripts/run-vitest.mjs src/agents/embedded-agent-subscribe.tools.test.ts

Resolution status

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions