Skip to content

fix: persist tool results in demo route conversations#1394

Merged
msywulak merged 2 commits intomainfrom
fix/1392-demo-tool-persistence
Apr 12, 2026
Merged

fix: persist tool results in demo route conversations#1394
msywulak merged 2 commits intomainfrom
fix/1392-demo-tool-persistence

Conversation

@msywulak
Copy link
Copy Markdown
Contributor

Summary

  • Apply the same agentResult.steps persistence pattern from chat.ts to demo.ts
  • Demo conversations now persist tool call/result data alongside text, so loaded conversations render SQL cards, charts, explore output, and the "Add to Dashboard" button

Closes #1392

Test plan

  • Start a demo conversation, ask a query that triggers executeSQL
  • Reload the page or navigate away and back — tool result cards should render
  • Verify old demo conversations (text-only) still load without errors

Apply the same agentResult.steps persistence pattern from chat.ts
so demo conversations render SQL cards, charts, and explore output
when loaded from history.
Deduplicate 42-line step persistence block from chat.ts and demo.ts
into a single persistAssistantSteps() in conversations.ts. Fixes:
empty-content fallback (skip instead of persisting phantom message),
dead inner try/catch removal, log.warn→log.error for data loss,
flatMap for cleaner iteration.
@msywulak msywulak merged commit c393600 into main Apr 12, 2026
6 checks passed
@msywulak msywulak deleted the fix/1392-demo-tool-persistence branch April 12, 2026 21:33
@msywulak msywulak added bug Something isn't working area: api Backend, agent, tools, SQL validation labels Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api Backend, agent, tools, SQL validation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: demo.ts does not persist tool results in conversations

1 participant