Skip to content

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

chore: files changed app/src/pages/__tests__/Conversations.auiComposerSurfaces.test.tsx

Steven Enamakel92b52d64d633
diff --git a/app/src/pages/__tests__/Conversations.auiComposerSurfaces.test.tsx b/app/src/pages/__tests__/Conversations.auiComposerSurfaces.test.tsx
index 66a2796a2e..35a57dc5c8 100644
--- a/app/src/pages/__tests__/Conversations.auiComposerSurfaces.test.tsx
+++ b/app/src/pages/__tests__/Conversations.auiComposerSurfaces.test.tsx
@@ -29,6 +29,7 @@ import { SidebarSlotOutlet, SidebarSlotProvider } from '../../components/layout/
// Type-only: erased at runtime, so it does not defeat `vi.hoisted`.
import type { FlowApprovalRequest } from '../../hooks/useFlowApprovalRequests';
import { chatSend } from '../../services/chatService';
+import { callCoreRpc } from '../../services/coreRpcClient';
import chatRuntimeReducer, {
type ArtifactSnapshot,
setToolTimelineForThread,
@@ -398,6 +399,31 @@ describe('assistant-ui chat surface — composer-adjacent cards', () => {
);
});
+ it('switches the run mode for a typed /plan instead of sending it to the model', async () => {
+ const store = await renderChat();
+
+ const input = await screen.findByRole('textbox', { name: 'Message input' });
+ await act(async () => {
+ input.textContent = '/plan';
+ fireEvent.input(input, { data: '/plan', inputType: 'insertText' });
+ });
+ await waitFor(() =>
+ expect(screen.getByRole('button', { name: 'Send message' })).not.toBeDisabled()
+ );
+ await act(async () => {
+ fireEvent.click(screen.getByRole('button', { name: 'Send message' }));
+ });
+
+ await waitFor(() =>
+ expect(callCoreRpc).toHaveBeenCalledWith({
+ method: 'openhuman.agent_set_run_mode',
+ params: { thread_id: THREAD_ID, mode: 'plan' },
+ })
+ );
+ expect(store.getState().runMode.byThread[THREAD_ID]).toBe('plan');
+ expect(chatSend).not.toHaveBeenCalled();
+ });
+
it('lists the thread files chip beside the model pill', async () => {
await renderChat({ chatRuntime: { artifactsByThread: { [THREAD_ID]: [readyArtifact()] } } });