fix: align agent log guards with workflow types

This commit is contained in:
Yanli 盐粒 2026-03-18 18:18:36 +08:00
parent dea90b0ccd
commit f81e0c7c8d
3 changed files with 0 additions and 22 deletions

View File

@ -202,22 +202,6 @@ describe('useWorkflowAgentLog', () => {
expect(tracing[1].execution_metadata!.agent_log).toHaveLength(1)
expect(tracing[1].execution_metadata!.agent_log![0].message_id).toBe('m2')
})
it('should ignore agent logs when node_execution_id is missing', () => {
const { result, store } = renderWorkflowHook(() => useWorkflowAgentLog(), {
initialStoreState: {
workflowRunningData: baseRunningData({
tracing: [{ id: 'trace-1', node_id: 'n1', execution_metadata: {} }],
}),
},
})
result.current.handleWorkflowAgentLog({
data: { node_id: 'n1', message_id: 'm1' },
} as AgentLogResponse)
expect(store.getState().workflowRunningData!.tracing![0].execution_metadata!.agent_log).toBeUndefined()
})
})
describe('useWorkflowNodeHumanInputFormFilled', () => {

View File

@ -13,9 +13,6 @@ export const useWorkflowAgentLog = () => {
setWorkflowRunningData,
} = workflowStore.getState()
if (!data.node_execution_id)
return
setWorkflowRunningData(produce(workflowRunningData!, (draft) => {
const currentIndex = draft.tracing!.findIndex(item => item.id === data.node_execution_id)
if (currentIndex > -1) {

View File

@ -530,9 +530,6 @@ export const useChat = (
}
},
onAgentLog: ({ data }) => {
if (!data.node_execution_id)
return
const currentNodeIndex = responseItem.workflowProcess!.tracing!.findIndex(item => item.id === data.node_execution_id)
if (currentNodeIndex > -1) {
const current = responseItem.workflowProcess!.tracing![currentNodeIndex]