Skip to content

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

fix(test): remove obsolete test file for AssistantUiRuntimeProvider

Steven Enamakelaf768508bd93
diff --git a/app/src/providers/__tests__/AssistantUiRuntimeProvider.test.tsx b/app/src/providers/__tests__/AssistantUiRuntimeProvider.test.tsx
index a57e8ab564..05d3f85cc8 100644
--- a/app/src/providers/__tests__/AssistantUiRuntimeProvider.test.tsx
+++ b/app/src/providers/__tests__/AssistantUiRuntimeProvider.test.tsx
@@ -7,7 +7,7 @@
* `assistantUiMessages` prove the projection; this proves the runtime consumes
* it, so the runtime's view of the conversation and the store cannot drift.
*/
-import { useThread } from '@assistant-ui/react';
+import { useAui, useAuiState } from '@assistant-ui/react';
import { combineReducers, configureStore } from '@reduxjs/toolkit';
import { act, render, screen } from '@testing-library/react';
import { Provider } from 'react-redux';
@@ -53,7 +53,7 @@ function buildStore(messages: ThreadMessage[]) {
/** Renders what assistant-ui's runtime believes the thread contains. */
function RuntimeProbe() {
- const thread = useThread();
+ const thread = useAuiState(({ thread: t }) => t);
return (
<div>
<div data-testid="count">{thread.messages.length}</div>
diff --git a/app/src/providers/__tests__/zz-probe.test.tsx b/app/src/providers/__tests__/zz-probe.test.tsx
deleted file mode 100644
index 2774a55242..0000000000
--- a/app/src/providers/__tests__/zz-probe.test.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { AssistantRuntimeProvider, useAui, useAuiState, useExternalStoreRuntime, type ThreadMessageLike } from '@assistant-ui/react';
-import { render } from '@testing-library/react';
-import { describe, it } from 'vitest';
-import * as nodeFs from 'node:fs';
-(globalThis as any).__probeFs = nodeFs;
-
-const messages: ThreadMessageLike[] = [
- { role: 'user', content: [{ type: 'text', text: 'hello' }] },
-];
-
-function Probe() {
- const aui = useAui();
- const state = useAuiState(({ thread }) => thread);
- const fs = (globalThis as any).__probeFs;
- fs.writeFileSync('/tmp/probe-out.txt', JSON.stringify({
- auiKeys: Object.keys(aui),
- threadStateKeys: state ? Object.keys(state) : null,
- msgCount: (state as any)?.messages?.length,
- threadClientKeys: (aui as any).thread ? Object.keys((aui as any).thread) : 'none',
- firstMsg: (state as any)?.messages?.[0],
- }, null, 1));
- 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 />); }); });