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

stacklok / toolhive-studio / 29571051485

17 Jul 2026 09:44AM UTC coverage: 71.713% (+0.5%) from 71.204%
29571051485

Pull #2475

github

samuv
fix(chat): harden Effect runtime adapters after external review

Make readiness and runtime retrieval atomic, type adapter programs against
ChatServices, and tighten domain-error narrowing plus agent/settings edge cases.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pull Request #2475: refactor(chat): migrate main-process chat to Effect domain services

5476 of 8187 branches covered (66.89%)

871 of 1363 new or added lines in 42 files covered. (63.9%)

1 existing line in 1 file now uncovered.

8153 of 11369 relevant lines covered (71.71%)

137.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/main/src/chat/thread-integration.ts
1
import { Effect } from 'effect'
2
import { runChatSync, runChatPromise, runChatToResultSync } from './runtime'
3
import { ThreadsService } from './threads/threads-service'
4

5
export function createChatThread(title?: string): {
6
  success: boolean
7
  threadId?: string
8
  error?: string
9
} {
NEW
10
  return runChatToResultSync(
×
11
    ThreadsService.createThread(title).pipe(
NEW
12
      Effect.map(({ threadId }) => ({ threadId }))
×
13
    )
14
  )
15
}
16

17
export async function getThreadMessagesForTransport(threadId: string) {
NEW
18
  return runChatPromise(ThreadsService.getThreadMessagesForTransport(threadId))
×
19
}
20

21
export function getThreadInfo(threadId: string) {
NEW
22
  return runChatSync(ThreadsService.getThreadInfo(threadId))
×
23
}
24

25
export function ensureThreadExists(
26
  threadId?: string,
27
  title?: string
28
): { success: boolean; threadId?: string; error?: string; isNew?: boolean } {
29
  return runChatToResultSync(ThreadsService.ensureThreadExists(threadId, title))
4✔
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc