• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive-studio / 25510592722
70%

Build:
DEFAULT BRANCH: main
Ran 07 May 2026 05:11PM UTC
Jobs 1
Files 505
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 May 2026 05:07PM UTC coverage: 67.958% (+0.2%) from 67.719%
25510592722

push

github

web-flow
fix(playground): defer empty chat thread persistence until first message (#2207)

* feat(chat): allow ensureThreadExists to promote a draft thread id

ensureThreadExists previously generated a fresh thread id whenever the provided id was not already in the DB, which made it unusable for the case where the renderer wants to promote a draft it has already routed to. Extend createThread with an optional explicitId parameter so the row is written with the caller-supplied id, and pass it through ensureThreadExists's missing-row branch.

Default behaviour (omit the id, let the helper generate one) is unchanged. New main/src/chat/__tests__/thread-integration.test.ts covers the existing/promoted/generated/failure branches.

This is the main-process foundation for the upcoming renderer change that stops persisting empty playground threads.

* fix(playground): defer empty thread persistence until first message

Visiting /playground or clicking + New chat used to call createChatThread() over IPC, which immediately wrote an empty thread row to SQLite even when the user never ended up sending a message. Every fresh session leaked one (or more) empty threads into the DB, and the row was indistinguishable from a real conversation in the sidebar / on reload.

Generate the thread id in the renderer and only promote the draft to a real DB row when the user submits the first message. A new thread-id util produces ids with the same thread_<ts>_<rand> shape the main process uses, so drafts are visually identical to persisted ids in the URL and sidebar. playground.index.tsx's beforeLoad resolver now redirects to a locally-generated id instead of calling createChatThread() when no DB threads exist.

usePlaygroundThreads tracks drafts in renderer state with a pending: true flag so the sidebar still renders them as normal items. createThread() reuses an existing empty draft instead of piling up new ones on repeated + New chat clicks, and deleteThread short-circuits the IPC fo... (continued)

4713 of 7479 branches covered (63.02%)

49 of 51 new or added lines in 6 files covered. (96.08%)

3 existing lines in 2 files now uncovered.

7033 of 10349 relevant lines covered (67.96%)

120.71 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
89.19
0.55% renderer/src/features/chat/hooks/use-playground-threads.ts

Coverage Regressions

Lines Coverage ∆ File
2
89.19
0.55% renderer/src/features/chat/hooks/use-playground-threads.ts
1
81.25
-8.22% renderer/src/routes/playground.index.tsx
Jobs
ID Job ID Ran Files Coverage
1 25510592722.1 07 May 2026 05:11PM UTC 505
67.96
GitHub Action Run
Source Files on build 25510592722
  • Tree
  • List 505
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25510592722
  • e0f54754 on github
  • Prev Build on main (#25496320513)
  • Next Build on main (#25658128140)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc