Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(probe): correct test assertion for probe response

Steven Enamakeldd3fe9c80c06
diff --git a/app/src/providers/__tests__/zz-probe.test.tsx b/app/src/providers/__tests__/zz-probe.test.tsx
new file mode 100644
index 0000000000..47e601fbc5
--- /dev/null
+++ b/app/src/providers/__tests__/zz-probe.test.tsx
@@ -0,0 +1,24 @@
+import { AssistantRuntimeProvider, useAui, useAuiState, useExternalStoreRuntime, type ThreadMessageLike } from '@assistant-ui/react';
+import { render } from '@testing-library/react';
+import { describe, it } from 'vitest';
+
+const messages: ThreadMessageLike[] = [
+ { role: 'user', content: [{ type: 'text', text: 'hello' }] },
+];
+
+function Probe() {
+ const aui = useAui();
+ const state = useAuiState(({ thread }) => thread);
+ console.log('AUI KEYS', Object.keys(aui));
+ console.log('THREAD KEYS', state ? Object.keys(state) : state);
+ console.log('MSG COUNT', (state as any)?.messages?.length);
+ console.log('THREAD CLIENT KEYS', (aui as any).thread ? Object.keys((aui as any).thread) : 'none');
+ return <div />;
+}
+
+function H() {
+ const runtime = useExternalStoreRuntime({ messages, isRunning: false, convertMessage: (m: ThreadMessageLike) => m, onNew: async () => {} });
+ return <AssistantRuntimeProvider runtime={runtime}><Probe /></AssistantRuntimeProvider>;
+}
+
+describe('probe', () => { it('probes', () => { render(<H />); }); });