feat(chat): add direct Live badge and harden Live monitor backend (#138)

* feat(chat): add direct live badge to session rows

* fix(live): use session DB for conversations monitor

* docs: add chat vs live monitor direction plan

* fix(search): avoid numeric session search 500 without FTS table
This commit is contained in:
Zhicheng Han
2026-04-23 04:49:00 +02:00
committed by GitHub
parent 32dc084b66
commit 5f40ae6258
12 changed files with 1435 additions and 24 deletions
+24
View File
@@ -169,6 +169,30 @@ describe('Chat Store', () => {
expect(window.localStorage.getItem(legacySessionMessagesKey('legacy-1'))).toBeNull()
})
it('marks recently active server sessions as live even when this tab did not start the run', async () => {
vi.useFakeTimers()
vi.setSystemTime(new Date('2026-04-22T19:00:00.000Z'))
mockSessionsApi.fetchSessions.mockResolvedValue([
{
...makeSummary('remote-live', 'Remote Live'),
ended_at: null,
last_active: Math.floor(Date.now() / 1000) - 60,
},
{
...makeSummary('remote-idle', 'Remote Idle'),
ended_at: Math.floor(Date.now() / 1000) - 600,
last_active: Math.floor(Date.now() / 1000) - 600,
},
])
const store = useChatStore()
await store.loadSessions()
expect(store.isSessionLive('remote-live')).toBe(true)
expect(store.isSessionLive('remote-idle')).toBe(false)
})
it('silently refreshes from server on SSE error instead of appending a fake error bubble', async () => {
vi.useFakeTimers()