Skip to content

bug(web): Claude tool-call markup (<function_calls>/<invoke>) renders as raw text instead of a tool card #994

Description

@0xshawn

Summary

In the web chat view, a Claude session's assistant turn rendered raw tool-call markup as literal text instead of being parsed into a tool card. The <function_calls> / <invoke name="..."> / <parameter ...> block leaked directly into the message bubble.

What I saw

The chat bubble showed literal text like:

<invoke name="TaskUpdate">
<parameter name="taskId">8</parameter>
<parameter name="status">completed</parameter>
</invoke>
<invoke name="Bash">
<parameter name="command">git add CLAUDE.md && git commit -q -m "docs: add project CLAUDE.md" && git log --oneline -5</parameter>
<parameter name="description">Commit CLAUDE.md</parameter>
</invoke>

Expected: this is a TaskUpdate + Bash tool call and should render as tool cards (like #480), not as raw XML-ish text in the message body.

Environment

  • hapi version: 0.20.2 (latest at time of report)
  • Agent flavor: Claude (Claude Code CLI)
  • Surface: web PWA chat view
  • Deployment: self-hosted hub (container) + host runner

Notes / suspected cause

The leaked markup is Claude Code's internal tool-call serialization. Two candidate causes:

  1. The CLI streamed the tool-call block into the assistant text channel (partial/mis-tagged event), and the web renderer passed it through verbatim.
  2. The web renderer received a well-formed tool-use event but failed to recognize/strip this markup shape, falling back to plain-text render.

Either way, the web side should detect and either render a tool card or suppress the raw markup rather than displaying it as message text.

Repro

Not yet reliably reproduced — appeared during a normal Claude session that emitted TaskUpdate + Bash tool calls. Will add exact steps / session export if it recurs.

Severity

Cosmetic — session state and execution were unaffected; only the rendered transcript was wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:claudeClaude Code flavorarea:webWeb PWA / React clientbugSomething isn't workingstatus:needs-reproNeeds reproduction steps

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions