Skip to content

Render TorchAgent ClickHouse queries with real newlines#8064

Open
wdvr wants to merge 1 commit into
mainfrom
wouter/format-clickhouse-query
Open

Render TorchAgent ClickHouse queries with real newlines#8064
wdvr wants to merge 1 commit into
mainfrom
wouter/format-clickhouse-query

Conversation

@wdvr
Copy link
Copy Markdown
Contributor

@wdvr wdvr commented May 11, 2026

Summary

  • In TorchAgentPage/ToolUse.tsx, the tool input was rendered via JSON.stringify(toolInput, null, 2), so multi-line ClickHouse queries showed up with literal \n characters instead of being formatted.
  • When toolInput.query is a string, render it as raw text inside the existing <pre> (ToolInput) so newlines render. Remaining input fields (e.g. inline_result_limit_bytes) are still shown as pretty-printed JSON below.

Test plan

  • Open a TorchAgent session that runs a ClickHouse query; expand the tool block and confirm the query renders with real newlines.
  • Confirm non-ClickHouse tools (no query field) still render their input as JSON.
  • Verify dark and light mode both render correctly.

Previously ClickHouse query inputs were JSON.stringify'd, so newlines
showed up as literal \n in the UI. Render the query field as raw text
in the <pre> block and stringify only the remaining input fields.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
torchci Ready Ready Preview May 11, 2026 2:00am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant