Skip to content

fix: search-actors text output has unwanted indentation from dedent #740

@MQ37

Description

@MQ37

Problem

The search-actors tool text output has unwanted leading whitespace on all lines (headers, actor cards, instructions). This is caused by dedent padding multi-line interpolated strings (${actorCardText}) to match the surrounding template indentation level.

Affected files:

  • src/tools/default/search_actors.ts (lines 58-73)
  • src/tools/openai/search_actors.ts (similar pattern)

Expected

# Search results:
- **Search query:** google maps
- **Number of Actors found:** 5

# Actors:

## [Google Maps Scraper](...

Actual

           # Search results:
           - **Search query:** google maps
           - **Number of Actors found:** 5

           # Actors:

           ## [Google Maps Scraper](...

Fix

Don't embed actorCardText inside the dedent block. Build the string by joining header, card text, and footer separately:

const header = dedent\`
    # Search results:
    ...
    # Actors:
\`;
const footer = dedent\`
    If you need more...
\`;
const instructions = [header, actorCardText, footer].join('\n\n');

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-aiIssues owned by the AI team.

    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