diff --git a/site/src/pages/TaskPage/TaskApps.tsx b/site/src/pages/TaskPage/TaskApps.tsx index 9cb49946c7618..316d7b91dd633 100644 --- a/site/src/pages/TaskPage/TaskApps.tsx +++ b/site/src/pages/TaskPage/TaskApps.tsx @@ -32,8 +32,11 @@ export const TaskApps: FC = ({ task }) => { .flatMap((a) => a?.apps) .filter((a) => !!a && a.slug !== AI_APP_CHAT_SLUG); + const embeddedApps = apps.filter((app) => !app.external); + const externalApps = apps.filter((app) => app.external); + const [activeAppId, setActiveAppId] = useState(() => { - const appId = apps[0]?.id; + const appId = embeddedApps[0]?.id; if (!appId) { throw new Error("No apps found in task"); } @@ -52,9 +55,6 @@ export const TaskApps: FC = ({ task }) => { throw new Error(`Agent for app ${activeAppId} not found in task workspace`); } - const embeddedApps = apps.filter((app) => !app.external); - const externalApps = apps.filter((app) => app.external); - return (