Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
Merge branch 'dev' of https://github.com/evenfire-ai/evenfire into feat/agent-ux-polish
Miguelon Peluchon734cbcf78395
diff --cc channel-reader/src/__tests__/main.test.tsindex bb2f52286,c69b13483..826a7a478--- a/channel-reader/src/__tests__/main.test.ts+++ b/channel-reader/src/__tests__/main.test.ts@@@ -394,24 -397,24 +397,22 @@@ describe('ChannelReader Teams handoff'it('turns an exact-run Teams download action into a personal-chat file consent card', async () => {const workflowRunId = '11111111-2222-4333-8444-555555555555'const rpc = rpcClient()-- rpc.downloadWorkflowResultByRun = vi.fn(-- async (): Promise<MessageResponse> => ({-- success: true,-- status: 'completed',-- response: 'Result ready.',-- attachments: [-- {-- id: 'artifact-1',-- kind: 'file',-- mimeType: 'application/pdf',-- encoding: 'base64',-- dataBase64: Buffer.from('pdf bytes').toString('base64'),-- filename: 'result.pdf',-- sourceTool: 'workflow_result',-- },-- ],-- })-- )++ rpc.downloadWorkflowResultByRun = vi.fn(async (): Promise<MessageResponse> => ({++ success: true,++ status: 'completed',++ response: 'Result ready.',++ attachments: [++ {++ id: 'artifact-1',++ kind: 'file',++ mimeType: 'application/pdf',++ encoding: 'base64',++ dataBase64: Buffer.from('pdf bytes').toString('base64'),++ filename: 'result.pdf',++ sourceTool: 'workflow_result',++ },++ ],++ }))const adapter = new TeamsAdapter()const sendFileConsent = vi.spyOn(adapter, 'sendFileConsent').mockResolvedValue('consent-1')const reader = new ChannelReader({@@@ -461,24 -464,24 +462,22 @@@it('uploads the exact artifact after Teams file consent is accepted', async () => {const workflowRunId = '11111111-2222-4333-8444-555555555555'const rpc = rpcClient()-- rpc.downloadWorkflowResultByRun = vi.fn(-- async (): Promise<MessageResponse> => ({-- success: true,-- status: 'completed',-- response: 'Result ready.',-- attachments: [-- {-- id: 'artifact-1',-- kind: 'file',-- mimeType: 'application/pdf',-- encoding: 'base64',-- dataBase64: Buffer.from('pdf bytes').toString('base64'),-- filename: 'result.pdf',-- sourceTool: 'workflow_result',-- },-- ],-- })-- )++ rpc.downloadWorkflowResultByRun = vi.fn(async (): Promise<MessageResponse> => ({++ success: true,++ status: 'completed',++ response: 'Result ready.',++ attachments: [++ {++ id: 'artifact-1',++ kind: 'file',++ mimeType: 'application/pdf',++ encoding: 'base64',++ dataBase64: Buffer.from('pdf bytes').toString('base64'),++ filename: 'result.pdf',++ sourceTool: 'workflow_result',++ },++ ],++ }))const adapter = new TeamsAdapter()const uploadConsentedFile = vi.spyOn(adapter, 'uploadConsentedFile')diff --cc desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsxindex 80cd2a135,387503f4c..080b3c4e8--- a/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx+++ b/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx@@@ -345,8 -421,8 +421,7 @@@ describe('useAgentChatController — chexpect(spies.pushToast).toHaveBeenCalledWith('Message to agent-x failed: LLM down', 'error')const appended = clerum.chat.appendMessages.mock.calls.at(-1)?.[2] as-- | Array<{ isError?: boolean; errorCode?: string }>-- | undefined++ Array<{ isError?: boolean; errorCode?: string }> | undefinedexpect(appended?.[0]?.isError).toBe(true)expect(appended?.[0]?.errorCode).toBe('provider_error')})@@@ -484,8 -560,8 +559,7 @@@await sendPromiseconst appended = clerum.chat.appendMessages.mock.calls.at(-1)?.[2] as-- | Array<{ isError?: boolean; content?: string }>-- | undefined++ Array<{ isError?: boolean; content?: string }> | undefinedexpect(appended?.[0]?.isError).toBe(true)expect(appended?.[0]?.content).toContain('Failed to retrieve task result')expect(spies.pushToast).toHaveBeenCalledWith(@@@ -863,13 -939,13 +937,11 @@@// once its message is the error bubble.await waitFor(() => {const last = clerum.chat.appendMessages.mock.calls.at(-1)?.[2]?.[0] as-- | { isError?: boolean }-- | undefined++ { isError?: boolean } | undefinedexpect(last?.isError).toBe(true)})const appended = clerum.chat.appendMessages.mock.calls.at(-1)?.[2] as-- | Array<{ isError?: boolean; errorCode?: string; content?: string }>-- | undefined++ Array<{ isError?: boolean; errorCode?: string; content?: string }> | undefinedexpect(appended?.[0]?.isError).toBe(true)expect(appended?.[0]?.errorCode).toBe('BUDGET_EXCEEDED')expect(appended?.[0]?.content).toContain('Token budget exceeded')@@@ -925,13 -1001,13 +997,11 @@@// first; the recovery's reply lands after the `getTaskResult` await).await waitFor(() => {const last = clerum.chat.appendMessages.mock.calls.at(-1)?.[2]?.[0] as-- | { role?: string }-- | undefined++ { role?: string } | undefinedexpect(last?.role).toBe('assistant')})const appended = clerum.chat.appendMessages.mock.calls.at(-1)?.[2] as-- | Array<{ role?: string; content?: string; isError?: boolean }>-- | undefined++ Array<{ role?: string; content?: string; isError?: boolean }> | undefinedexpect(appended?.[0]?.role).toBe('assistant')expect(appended?.[0]?.content).toBe('here is your report')expect(appended?.[0]?.isError).toBeUndefined()diff --cc desktop-app/ui/src/hooks/domain/useAgentChatController.tsindex 2fe14f469,a817dac4e..e476db2b6--- a/desktop-app/ui/src/hooks/domain/useAgentChatController.ts+++ b/desktop-app/ui/src/hooks/domain/useAgentChatController.ts@@@ -2565,8 -2567,8 +2567,7 @@@ export function useAgentChatController(if (!taskId) {// Synchronous (non-async) response — a direct reply or a structured error.const errorRecord = responseRecord.error as-- | { message?: string; code?: string; provider?: string }-- | undefined++ { message?: string; code?: string; provider?: string } | undefinedconst content =typeof errorRecord?.message === 'string'? errorRecord.message