Skip to content

Hide tool_code blocks in UI while preserving in conversation history #44

@ForestMars

Description

@ForestMars

Hide tool_code blocks in UI while preserving in conversation history

Problem: When MCP tools execute successfully, the raw tool_code blocks are displayed to users, making the UI ugly and confusing. However we need to keep the tool_code in context history or it confuses the model as to how to call the tool.

Expected: User sees clean message like "Email sent successfully"

Actual: User sees raw output including ```tool_code send_email(to="...", subject="...", body="...")```

Solution: In message rendering component, strip tool_code blocks from display while keeping them in conversation data sent to LLM.

Example:

  • Display to user: "Email sent successfully"
  • Keep in LLM context: Full message with tool_code block intact

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions