fix(desktop): align tool settlement test and sort imports
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { buildToolView } from '@/components/assistant-ui/tool/fallback-model'
|
||||
import { createClientSessionState } from '@/lib/chat-runtime'
|
||||
import { $activeSessionId, $selectedStoredSessionId, $unreadFinishedSessionIds } from '@/store/session'
|
||||
import {
|
||||
@@ -111,10 +112,20 @@ describe('rehydrateLiveSessionStatuses — reaping vanished runtimes', () => {
|
||||
rehydrateLiveSessionStatuses({ sessions: [] })
|
||||
|
||||
const state = $sessionStates.get()['runtime-tools']
|
||||
const part = state.messages[0].parts[0]
|
||||
|
||||
expect(state.busy).toBe(false)
|
||||
expect(state.awaitingResponse).toBe(false)
|
||||
expect((state.messages[0].parts[0] as { result?: unknown }).result).toBeDefined()
|
||||
expect(part.type).toBe('tool-call')
|
||||
|
||||
if (part.type !== 'tool-call') {
|
||||
throw new Error('Missing tool call')
|
||||
}
|
||||
|
||||
// Reaping ends liveness without inventing evidence of a successful result.
|
||||
expect(part.completedAt).toBeDefined()
|
||||
expect(part.result).toBeUndefined()
|
||||
expect(buildToolView(part, '').status).toBe('warning')
|
||||
})
|
||||
|
||||
it('clears a session stuck awaiting a response without the busy flag', () => {
|
||||
|
||||
@@ -9,8 +9,7 @@ import {
|
||||
isFileEditTool,
|
||||
parseMaybeObject
|
||||
} from '@/components/assistant-ui/tool/fallback-model'
|
||||
|
||||
import { toolResultRecord, type ToolResultMetadata } from '@/lib/tool-result-metadata'
|
||||
import { type ToolResultMetadata, toolResultRecord } from '@/lib/tool-result-metadata'
|
||||
|
||||
export interface ChangedFile {
|
||||
added: number
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { upsertToolPart } from '@/lib/chat-messages'
|
||||
|
||||
import { summarizeToolRun } from '@/components/assistant-ui/tool/run-summary'
|
||||
import { upsertToolPart } from '@/lib/chat-messages'
|
||||
|
||||
describe('D1 competing implementation contracts', () => {
|
||||
it('retains JSON object text as the canonical received value', () => {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { fromThreadMessageLike, getAutoStatus } from '@assistant-ui/core/internal'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { buildToolView } from '@/components/assistant-ui/tool/fallback-model'
|
||||
|
||||
import { deriveChangedFiles } from '@/components/assistant-ui/thread/changed-files'
|
||||
import { toRuntimeMessage } from '@/lib/chat-runtime'
|
||||
import { buildToolView } from '@/components/assistant-ui/tool/fallback-model'
|
||||
import { sealOpenToolParts, upsertToolPart } from '@/lib/chat-messages'
|
||||
import { toRuntimeMessage } from '@/lib/chat-runtime'
|
||||
import { todosFromMessageContent } from '@/lib/todos'
|
||||
|
||||
const normalize = (parts: ReturnType<typeof upsertToolPart>) => fromThreadMessageLike(toRuntimeMessage({ id: 'd1', role: 'assistant', parts }), 'd1', getAutoStatus(false, false, false, false, undefined)).content
|
||||
|
||||
Reference in New Issue
Block a user