Skip to content

Commit 4d20303

Browse files
committed
refactor(web): remove legacy verification event flow
# Conflicts: # web/src/stores/useRuntimeInsightStore.test.ts # web/src/utils/eventBridge.test.ts
1 parent ffa04d1 commit 4d20303

10 files changed

Lines changed: 80 additions & 423 deletions

web/src/api/protocol.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -417,25 +417,6 @@ export interface TodoEventPayload {
417417
export type ListSessionTodosResult = RPCResult<TodoSnapshot>;
418418
export type GetRuntimeSnapshotResult = RPCResult<RuntimeSnapshotPayload>;
419419

420-
export interface VerificationStartedPayload {
421-
completion_passed: boolean;
422-
completion_blocked_reason?: string;
423-
}
424-
425-
export interface VerificationStageFinishedPayload {
426-
name: string;
427-
status: string;
428-
summary?: string;
429-
reason?: string;
430-
error_class?: string;
431-
}
432-
433-
export interface VerificationFinishedPayload {
434-
acceptance_status: string;
435-
stop_reason?: string;
436-
error_class?: string;
437-
}
438-
439420
export interface VerificationCompletedPayload {
440421
stop_reason?: string;
441422
}

web/src/components/chat/MessageItem.test.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { fireEvent, render, screen } from '@testing-library/react'
33
import MessageItem from './MessageItem'
44

55
vi.mock('./ToolCallCard', () => ({ default: () => <div>tool-card</div> }))
6-
vi.mock('./VerificationMessage', () => ({ default: () => <div>verification-card</div> }))
76
vi.mock('./AcceptanceMessage', () => ({ default: () => <div>acceptance-card</div> }))
87
vi.mock('./CodeBlock', () => ({ default: ({ code }: { code: string }) => <pre>{code}</pre> }))
98
vi.mock('./MarkdownContent', () => ({ default: ({ content }: { content: string }) => <span>{content}</span> }))
@@ -30,11 +29,9 @@ describe('MessageItem', () => {
3029
expect(screen.getByText('reasoning')).toBeInTheDocument()
3130
})
3231

33-
it('renders tool/verification/acceptance delegates', () => {
32+
it('renders tool and acceptance delegates', () => {
3433
const { rerender } = render(<MessageItem message={{ id: 'm1', role: 'tool', type: 'tool_call', content: '', timestamp: 1 } as any} />)
3534
expect(screen.getByText('tool-card')).toBeInTheDocument()
36-
rerender(<MessageItem message={{ id: 'm2', role: 'assistant', type: 'verification', content: '', timestamp: 1 } as any} />)
37-
expect(screen.getByText('verification-card')).toBeInTheDocument()
3835
rerender(<MessageItem message={{ id: 'm3', role: 'assistant', type: 'acceptance', content: '', timestamp: 1 } as any} />)
3936
expect(screen.getByText('acceptance-card')).toBeInTheDocument()
4037
})

web/src/components/chat/MessageItem.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { memo, useState } from 'react'
22
import { type ChatMessage } from '@/stores/useChatStore'
33
import ToolCallCard from './ToolCallCard'
4-
import VerificationMessage from './VerificationMessage'
54
import AcceptanceMessage from './AcceptanceMessage'
65
import CodeBlock from './CodeBlock'
76
import MarkdownContent from './MarkdownContent'
@@ -32,10 +31,6 @@ const MessageItem = memo(function MessageItem({ message, isLast = false, grouped
3231
return <ToolCallCard message={message} groupedWithPrev={groupedWithPrev} />
3332
}
3433

35-
if (message.type === 'verification') {
36-
return <VerificationMessage message={message} groupedWithPrev={groupedWithPrev} />
37-
}
38-
3934
if (message.type === 'acceptance') {
4035
return <AcceptanceMessage message={message} groupedWithPrev={groupedWithPrev} />
4136
}

web/src/components/chat/VerificationMessage.test.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

web/src/components/chat/VerificationMessage.tsx

Lines changed: 0 additions & 185 deletions
This file was deleted.

web/src/stores/useChatStore.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
type AcceptanceDecidedPayload,
66
type PendingUserQuestionSnapshot,
77
} from '@/api/protocol'
8-
import { type VerificationRunRecord } from '@/stores/useRuntimeInsightStore'
98
import { resetEventBridgeCursors } from '@/utils/eventBridge'
109

1110
/** 聊天消息 */
@@ -14,7 +13,7 @@ export interface ChatMessage {
1413
/** 消息角色:user / assistant / tool */
1514
role: 'user' | 'assistant' | 'tool'
1615
/** 消息类型:text / thinking / tool_call / code / welcome / system / verification / acceptance */
17-
type: 'text' | 'thinking' | 'tool_call' | 'code' | 'welcome' | 'system' | 'verification' | 'acceptance'
16+
type: 'text' | 'thinking' | 'tool_call' | 'code' | 'welcome' | 'system' | 'acceptance'
1817
/** 文本内容 */
1918
content: string
2019
/** 工具调用信息 */
@@ -23,8 +22,6 @@ export interface ChatMessage {
2322
toolArgs?: string
2423
toolResult?: string
2524
toolStatus?: 'running' | 'done' | 'error'
26-
/** Verification 摘要数据(仅 type === 'verification' 使用) */
27-
verificationData?: VerificationRunRecord
2825
/** Acceptance 决策数据(仅 type === 'acceptance' 使用) */
2926
acceptanceData?: AcceptanceDecidedPayload
3027
/** Thinking 数据(仅 type === 'thinking' 使用) */
@@ -93,7 +90,6 @@ interface ChatState {
9390
/** 将所有运行中的工具条目标记为指定状态,用于终止事件兜底收敛 UI。 */
9491
finalizeRunningToolCalls: (status: 'done' | 'error') => void
9592
/** 更新一条 verification 消息的 data(verification 进行中持续更新同一条消息) */
96-
updateVerificationMessage: (messageId: string, data: VerificationRunRecord) => void
9793
setGenerating: (v: boolean) => void
9894
startCompacting: (mode?: string, message?: string) => void
9995
finishCompacting: () => void
@@ -314,15 +310,6 @@ export const useChatStore = create<ChatState>((set) => ({
314310
),
315311
})),
316312

317-
updateVerificationMessage: (messageId, data) =>
318-
set((s) => ({
319-
messages: s.messages.map((m) =>
320-
m.id === messageId && m.type === 'verification'
321-
? { ...m, verificationData: data }
322-
: m
323-
),
324-
})),
325-
326313
setGenerating: (isGenerating) => set({ isGenerating }),
327314
startCompacting: (compactMode = 'manual', compactMessage = 'Compacting context...') =>
328315
set({

0 commit comments

Comments
 (0)