Skip to content

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

fix(thread-list): prevent crash when migration panel is missing

Steven Enamakelb41c99c9f50f
diff --git a/app/src/components/assistant-ui/thread-list.tsx b/app/src/components/assistant-ui/thread-list.tsx
index 1b54858d0b..55342ab089 100644
--- a/app/src/components/assistant-ui/thread-list.tsx
+++ b/app/src/components/assistant-ui/thread-list.tsx
@@ -331,7 +331,9 @@ const ThreadListItem: FC = () => {
<span data-slot="aui_thread-list-item-title" className="min-w-0 flex-1 truncate">
<ThreadListItemPrimitive.Title fallback="New Chat" />
</span>
- {isRunning && <span className="sr-only">Running</span>}
+ {isRunning && (
+ <span className="sr-only">{t('conversations.backgroundTasks.statusRunning', 'Running')}</span>
+ )}
</ThreadListItemPrimitive.Trigger>
)}
<ThreadListItemMore onRename={() => setIsRenaming(true)} />
diff --git a/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx b/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx
index 2161d36738..12687a4ebd 100644
--- a/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx
+++ b/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx
@@ -117,7 +117,7 @@ describe('MigrationPanel (#1440)', () => {
);
});
- it('requires window.confirm before Apply and calls the RPC with dry_run=false on yes', async () => {
+ it('requires confirmation dialog before Apply and calls the RPC with dry_run=false on confirm', async () => {
vi.mocked(openhumanMigrateOpenclaw)
.mockResolvedValueOnce({ result: makeReport(), logs: [] })
.mockResolvedValueOnce({
@@ -125,33 +125,36 @@ describe('MigrationPanel (#1440)', () => {
logs: [],
});
- const confirmSpy = vi.spyOn(window, 'confirm').mockReturnValueOnce(true);
renderWithProviders(<MigrationPanel />);
fireEvent.click(screen.getByTestId('migration-preview-button'));
await waitFor(() => expect(screen.getByTestId('migration-apply-button')).not.toBeDisabled());
+ // Clicking Apply only opens the confirmation dialog — it must not call
+ // the RPC by itself.
fireEvent.click(screen.getByTestId('migration-apply-button'));
+ const confirmButton = await screen.findByTestId('migration-confirm-button');
+ expect(openhumanMigrateOpenclaw).toHaveBeenCalledTimes(1);
+
+ fireEvent.click(confirmButton);
await waitFor(() =>
expect(openhumanMigrateOpenclaw).toHaveBeenNthCalledWith(2, undefined, false)
);
- expect(confirmSpy).toHaveBeenCalledTimes(1);
await waitFor(() => expect(screen.getByTestId('migration-report-applied')).toBeInTheDocument());
- confirmSpy.mockRestore();
});
it('skips Apply when the user cancels the confirm dialog', async () => {
vi.mocked(openhumanMigrateOpenclaw).mockResolvedValueOnce({ result: makeReport(), logs: [] });
- const confirmSpy = vi.spyOn(window, 'confirm').mockReturnValueOnce(false);
renderWithProviders(<MigrationPanel />);
fireEvent.click(screen.getByTestId('migration-preview-button'));
await waitFor(() => expect(screen.getByTestId('migration-apply-button')).not.toBeDisabled());
fireEvent.click(screen.getByTestId('migration-apply-button'));
+ const cancelButton = await screen.findByRole('button', { name: /cancel/i });
+ fireEvent.click(cancelButton);
// Only the Preview call should have fired — Apply must not call the RPC
- // when the operator says no.
+ // when the operator cancels the confirmation dialog.
expect(openhumanMigrateOpenclaw).toHaveBeenCalledTimes(1);
expect(screen.queryByTestId('migration-report-applied')).toBeNull();
- confirmSpy.mockRestore();
});
it('re-disables Apply when the source path is edited after a preview', async () => {