• 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

91.67
/main/src/chat/runtime/test-runtime.ts
1
import { beforeEach, afterEach } from 'vitest'
2
import { disposeChatRuntime, initializeChatRuntime } from './managed-runtime'
3
import {
4
  markChatRuntimeInitializing,
5
  markChatRuntimeReady,
6
  markChatRuntimeUnavailable,
7
} from './health'
8
import { _resetActiveStreamsForTests } from '../streaming/stream-registry-service'
9

10
async function ensureChatTestRuntime(): Promise<void> {
11
  await disposeChatRuntime()
119✔
12
  markChatRuntimeInitializing()
119✔
13
  try {
119✔
14
    await initializeChatRuntime()
119✔
15
    markChatRuntimeReady()
119✔
16
  } catch {
NEW
17
    markChatRuntimeUnavailable('test_runtime_init_failed')
×
18
  }
19
}
20

21
export function installChatTestRuntimeHooks(): void {
22
  beforeEach(async () => {
8✔
23
    await ensureChatTestRuntime()
119✔
24
  })
25

26
  afterEach(async () => {
8✔
27
    _resetActiveStreamsForTests()
119✔
28
    await disposeChatRuntime()
119✔
29
    markChatRuntimeUnavailable('test_runtime_disposed')
119✔
30
  })
31
}
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