mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat: add multi-run fusion and session change walkthroughs
Fuse two to five completed multi-run entries into one synthesized session, and explain a session's diff as ordered walkthrough stops cached by diff hash. - Multi-run fusion service, persistence, routes and FuseRunDialog - Change walkthrough service, persistence, routes and ChangesWalkthroughDialog - Shared unified-diff parser plus bounded text generation, json-extract, text-truncate and service-error helpers
This commit is contained in:
1 parent
90c6ccf236
commit
b36d412ca2
66 files changed
+6228
-468
No files matched your search
@@ -6,6 +6,7 @@ import { MemoryRouter, useLocation } from 'react-router-dom'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { FormInfo, PermissionRequest } from '@opencode-manager/shared/opencode'
|
||||
import { useSessionStatus } from '@/stores/sessionStatusStore'
|
||||
import { changeWalkthroughQueryKey } from '@/hooks/useChangeWalkthrough'
|
||||
import { EventProvider, useEventContext, useForms, usePermissions, useSSEHealth } from './EventContext'
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
@@ -1014,6 +1015,31 @@ describe('EventProvider permissions and forms', () => {
|
||||
expect(useSessionStatus.getState().getStatus('session-9')).toEqual({ type: 'idle' })
|
||||
})
|
||||
|
||||
it.each([
|
||||
['session.execution.succeeded', { sessionID: 'session-9' }],
|
||||
['session.execution.failed', { sessionID: 'session-9', error: { message: 'boom' } }],
|
||||
['session.execution.interrupted', { sessionID: 'session-9', reason: 'user' }],
|
||||
] as const)('invalidates the change walkthrough query on %s', async (type, data) => {
|
||||
const queryClient = createTestQueryClient()
|
||||
const invalidateQueries = vi.spyOn(queryClient, 'invalidateQueries')
|
||||
|
||||
render(<Harness />, { wrapper: createWrapper(queryClient) })
|
||||
|
||||
await waitFor(() => expect(mocks.subscribeGlobalMonitor).toHaveBeenCalled())
|
||||
invalidateQueries.mockClear()
|
||||
|
||||
const lastSubscribeCall = mocks.subscribeGlobalMonitor.mock.calls[mocks.subscribeGlobalMonitor.mock.calls.length - 1]
|
||||
const onEvent = lastSubscribeCall[0].onEvent as (data: unknown) => void
|
||||
|
||||
act(() => {
|
||||
onEvent({ type, data, directory: '/repo' })
|
||||
})
|
||||
|
||||
await waitFor(() => {
|
||||
expect(invalidateQueries).toHaveBeenCalledWith({ queryKey: changeWalkthroughQueryKey('session-9') })
|
||||
})
|
||||
})
|
||||
|
||||
it('marks a child session as known from its execution lifecycle events', async () => {
|
||||
render(<Harness />, { wrapper: createWrapper() })
|
||||
|
||||
|
||||
Reference in new issue
Block a user