test(tools): fix error code assertions for collapsed call tests

The error code lives on ToolFailure.info.code, not ToolFailure.code.
This commit is contained in:
Chinesezjc
2026-08-11 22:40:36 +08:00
parent 6d0a7c12e1
commit 610dc74ea8
+2 -2
View File
@@ -1574,7 +1574,7 @@ describe('the run_code dispatch bridge', () => {
})
expect(result.isError).toBe(true)
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- error is a union type
expect((result.error as any).code).toBe('UNKNOWN_TOOL')
expect((result.error as any).info.code).toBe('UNKNOWN_TOOL')
})
it('routes a pre-aborted collapsed call through ABORTED_BEFORE_DISPATCH', async () => {
@@ -1592,7 +1592,7 @@ describe('the run_code dispatch bridge', () => {
})
expect(result.isError).toBe(true)
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- error is a union type
expect((result.error as any).code).toBe(TOOL_ABORTED_BEFORE_DISPATCH)
expect((result.error as any).info.code).toBe(TOOL_ABORTED_BEFORE_DISPATCH)
})
})