Skip to content

fix: ToolRenderConfig BorderColor and Background fields are ignored #2

Description

@ezynda3

Bug Description

The BorderColor and Background fields in ToolRenderConfig are documented and accepted by the API, but they are never actually applied during tool rendering.

Code Flow Analysis

  1. Extension API (internal/extensions/api.go:1657-1665): Fields exist with full documentation
  2. Conversion (cmd/root.go:488-495): Fields ARE correctly copied from ToolRenderConfig to ui.ToolRendererData
  3. UI Struct (internal/ui/model.go:133-139): Fields are defined on ToolRendererData
  4. Rendering (internal/ui/messages.go:304-385): Fields are completely ignored - only DisplayName, RenderHeader, RenderBody, and BodyMarkdown are used

Expected Behavior

When a tool renderer specifies BorderColor: #89b4fa or Background: #1e1e2e, the tool result block should render with those colors.

Actual Behavior

The fields are silently ignored. The tool renders with default styling regardless of what values are set.

Example Extension Code

Proposed Fix

The RenderToolMessage function in internal/ui/messages.go needs to:

  1. Check for extRd.BorderColor and extRd.Background
  2. Apply them using the existing WithBorderColor and WithBackground option functions in block_renderer.go

This may require extending UIMessage to carry styling metadata, or applying the styling during the render phase.

Related Code

  • internal/ui/block_renderer.go:55-121 - Option functions for border/background
  • internal/ui/messages.go:304-385 - RenderToolMessage (needs fix)
  • examples/extensions/tool-renderer-demo.go - Example that tries to use these fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions