An open-source, faster Devin alternative
TypeScript
Computer page: the Slack install brings the computer to life, not a visit
Slack U06GFN8DJ7Pccaed74b0612
diff --git a/web/src/api/mock.ts b/web/src/api/mock.tsindex c31b1f73..d8b0ce57 100644--- a/web/src/api/mock.ts+++ b/web/src/api/mock.ts@@ -1268,8 +1268,9 @@ const previewServiceConnection = {// The organization's computer (work 052 contract). Onboarded by default with// one live and two recent sessions; `?computer=setup` shows the page before-// Slack and GitHub are connected, `?computer=quiet` nothing live and-// `?computer=parked` a sleeping computer.+// Slack and GitHub are connected (no computer yet: it comes with the Slack+// install), `?computer=quiet` nothing live and `?computer=parked` a sleeping+// computer.function previewComputerMode() {return new URLSearchParams(window.location.search).get('computer')}@@ -1279,16 +1280,18 @@ function previewComputer() {const setup = mode === 'setup'const parked = mode === 'parked'return {- computer: {- state: parked ? 'parked' : 'ready',- connected: !parked,- vcpus: 2,- memoryGiB: 8,- diskGiB: 128,- lastError: null,- createdAt: new Date(BASE).toISOString(),- updatedAt: new Date(BASE).toISOString(),- },+ computer: setup+ ? null+ : {+ state: parked ? 'parked' : 'ready',+ connected: !parked,+ vcpus: 2,+ memoryGiB: 8,+ diskGiB: 128,+ lastError: null,+ createdAt: new Date(BASE).toISOString(),+ updatedAt: new Date(BASE).toISOString(),+ },slack: setup? { installed: false }: { installed: true, teamId: 'T0PREVIEW', teamName: 'Acme' },diff --git a/web/src/managed-agents/Computer.test.tsx b/web/src/managed-agents/Computer.test.tsxindex c233942f..466be8d3 100644--- a/web/src/managed-agents/Computer.test.tsx+++ b/web/src/managed-agents/Computer.test.tsx@@ -172,25 +172,65 @@ describe('Computer page', () => {const location = () =>container.querySelector('[data-testid="location"]')?.textContent- it('creates the computer on the first visit and shows it setting up', async () => {+ it('does not create the computer on a visit: installing Slack brings it to life', async () => {computerApi.getComputer.mockResolvedValue(empty)computerApi.createComputer.mockResolvedValue(provisioning)+ computerApi.startComputerSlackInstall.mockReturnValue(new Promise(() => {}))render('/computer')await settle(- () => container.textContent?.includes('coming to life') === true,- 'provisioning computer',+ () => container.textContent?.includes('one click away') === true,+ 'not set up hero',)- expect(computerApi.createComputer).toHaveBeenCalledTimes(1)- expect(container.textContent).toContain('Setting up')- expect(container.textContent).toContain('Install Slack app')- expect(container.textContent).not.toMatch(/vCPU|GiB/)- expect(container.textContent).toContain('Connect GitHub')+ expect(container.textContent).toContain('Your computer is one click away.')expect(container.textContent).toContain(- 'Mention @OpenComputer in any channel, or DM it.',+ 'Invite OpenComputer to your Slack and it wakes up as part of your team — ready in seconds.',)+ expect(container.textContent).toContain('Not set up yet')+ expect(container.textContent).not.toContain('Setting up')+ // The hero's call to action and the checklist's step 1, both the install.+ const hero = container.querySelector('section')!+ const invite = [...hero.querySelectorAll('button')].find(+ (button) => button.textContent === 'Invite it to Slack',+ )+ expect(invite).toBeDefined()+ expect(container.textContent).toContain('Install Slack app')+ // GitHub can be connected anytime.+ expect(container.textContent).toContain('Connect GitHub')+ expect(container.textContent).not.toMatch(/vCPU|GiB/)expect(container.textContent).not.toMatch(/azure|region|instance/i)++ // Nothing is created however long the page stays open.+ await act(async () => {+ await new Promise((resolve) => setTimeout(resolve, 20))+ })+ expect(computerApi.createComputer).not.toHaveBeenCalled()++ act(() => invite!.click())+ await settle(+ () => computerApi.startComputerSlackInstall.mock.calls.length === 1,+ 'Slack install started',+ )+ })++ it('creates the computer when Slack is installed but it is still missing', async () => {+ computerApi.getComputer.mockResolvedValue({+ ...empty,+ slack: { installed: true, teamId: 'T1', teamName: 'Acme' },+ })+ computerApi.createComputer.mockResolvedValue({+ ...provisioning,+ slack: { installed: true, teamId: 'T1', teamName: 'Acme' },+ })++ render('/computer')+ await settle(+ () => container.textContent?.includes('coming to life') === true,+ 'provisioning computer',+ )+ expect(computerApi.createComputer).toHaveBeenCalledTimes(1)+ expect(container.textContent).toContain('Setting up')})it('does not create a computer the organization already has', async () => {diff --git a/web/src/managed-agents/Computer.tsx b/web/src/managed-agents/Computer.tsxindex c54fb852..36377781 100644--- a/web/src/managed-agents/Computer.tsx+++ b/web/src/managed-agents/Computer.tsx@@ -102,19 +102,25 @@ function ComputerPageContent() {refetchInterval: (query) => sessionPollInterval(query.state.data),})- // The first visit creates the organization's computer. The call is- // idempotent, so a second tab or a reload racing this one is harmless.+ // The computer comes alive when the organization installs the Slack app+ // (the install's callback claims or creates it; work 052, Mohamed+ // 2026-10-13), never on a visit: most organizations only look, and each+ // computer is a VM. A visit only creates one when Slack is already+ // installed and the computer is still missing (the install's claim+ // failed), and Try again retries a failed one. The call is idempotent.const create = useMutation({mutationFn: createComputer,onSuccess: (next) => queryClient.setQueryData(computerQueryKey, next),})const { mutate: createNow } = createconst createStarted = useRef(false)+ const missingAfterInstall =+ status.data?.computer === null && status.data.slack.installeduseEffect(() => {- if (status.data?.computer !== null || createStarted.current) return+ if (!missingAfterInstall || createStarted.current) returncreateStarted.current = truecreateNow()- }, [status.data?.computer, createNow])+ }, [missingAfterInstall, createNow])// Slack's install redirect lands here with ?slack=connected|error. A// workspace that is another organization's gets a panel, not a toast: the@@ -307,6 +313,8 @@ function computerDot(status: ComputerStatus, failedToCreate: boolean): DotTone {const { computer } = statusif (failedToCreate || computer?.state === 'failed') return 'failed'if (computer?.state === 'ready' && computer.connected) return 'alive'+ // Not set up yet: nothing is happening until Slack is installed.+ if (!computer && !status.slack.installed) return 'quiet'if (!computer ||computer.state === 'provisioning' ||@@ -330,7 +338,11 @@ function StatusPill({<PulseDot tone={computerDot(status, failedToCreate)} />{failedToCreate? 'Failed'- : computerPresentation(status.computer, status.plan).label}+ : computerPresentation(+ status.computer,+ status.plan,+ status.slack.installed,+ ).label}</div>)}@@ -591,8 +603,9 @@ function Hero({const failedToCreate = !computer && createError !== nullconst copy = failedToCreate? { headline: 'Something went wrong.', subline: createError.message }- : heroCopy(computer, status.plan)+ : heroCopy(computer, status.plan, status.slack.installed)const canRetry = failedToCreate || computer?.state === 'failed'+ const notSetUp = !computer && !status.slack.installedreturn (<section className="from-primary/10 via-panel to-panel relative overflow-hidden rounded-2xl border bg-linear-to-br px-8 py-12 sm:px-12 sm:py-16"><div@@ -610,6 +623,14 @@ function Hero({{canRetry ? (<RetryButton className="mt-8" creating={creating} onRetry={onRetry} />) : null}+ {notSetUp ? (+ <div className="mt-8 flex flex-wrap items-center gap-3">+ <SlackInstallButton size="lg" label="Invite it to Slack" />+ <span className="text-muted-foreground text-sm">+ One click. Connect GitHub anytime.+ </span>+ </div>+ ) : null}</div></section>)@@ -763,12 +784,18 @@ function Checklist({>{status.slack.installed? `It is in ${status.slack.teamName ?? 'your Slack workspace'}.`- : 'Where your team already talks. One click, no setup.'}+ : 'This is what brings it to life. One click, ready in seconds.'}</Step><Stepnumber={2}step={{ ...githubStep, title: 'Give it your code' }}- action={<GitHubAction connected={status.github.connected} />}+ action={+ <GitHubAction+ connected={status.github.connected}+ // Slack comes first: it is what starts the computer. GitHub works anytime.+ secondary={!status.slack.installed}+ />+ }>{githubSummary(status.github)}</Step>@@ -879,8 +906,12 @@ function SlackAction({function SlackInstallButton({variant = 'default',+ size = 'default',+ label = 'Install Slack app',}: {variant?: 'default' | 'outline'+ size?: 'default' | 'lg'+ label?: string}) {const install = useMutation({mutationFn: startComputerSlackInstall,@@ -890,6 +921,7 @@ function SlackInstallButton({return (<Buttonvariant={variant}+ size={size}// Stays pending through the navigation to Slack.disabled={install.isPending || install.isSuccess}onClick={() => install.mutate()}@@ -899,12 +931,18 @@ function SlackInstallButton({) : (<Send className="size-4" aria-hidden />)}- Install Slack app+ {label}</Button>)}-function GitHubAction({ connected }: { connected: boolean }) {+function GitHubAction({+ connected,+ secondary = false,+}: {+ connected: boolean+ secondary?: boolean+}) {const [starting, setStarting] = useState(false)if (connected) {return (@@ -915,6 +953,7 @@ function GitHubAction({ connected }: { connected: boolean }) {}return (<Button+ variant={secondary ? 'outline' : 'default'}disabled={starting}onClick={() => {setStarting(true)diff --git a/web/src/managed-agents/computer-state.test.ts b/web/src/managed-agents/computer-state.test.tsindex a08cb855..e2820cbe 100644--- a/web/src/managed-agents/computer-state.test.ts+++ b/web/src/managed-agents/computer-state.test.ts@@ -108,7 +108,7 @@ describe('computer contract schemas', () => {describe('computer state copy', () => {it.each([- [null, 'Setting up'],+ [null, 'Not set up yet'],[{ ...computer, state: 'provisioning' as const }, 'Setting up'],[computer, 'Online'],[{ ...computer, connected: false }, 'Offline'],@@ -122,6 +122,15 @@ describe('computer state copy', () => {expect(presentation.description).not.toMatch(FORBIDDEN)})+ it('is not set up before the Slack install, and setting up once Slack is in', () => {+ expect(computerPresentation(null, 'free')).toMatchObject({+ badge: 'not_deployed',+ label: 'Not set up yet',+ })+ expect(computerPresentation(null, 'free').description).toContain('Slack')+ expect(computerPresentation(null, 'free', true).label).toBe('Setting up')+ })+it('suggests an upgrade only to free organizations whose computer sleeps', () => {const parked = { ...computer, state: 'parked' as const }expect(computerPresentation(parked, 'free').description).toContain(@@ -159,7 +168,14 @@ describe('computer state copy', () => {)}}- expect(heroCopy(null, 'free').headline).toBe(+ // Before the Slack install: the install is what brings it to life.+ expect(heroCopy(null, 'free')).toEqual({+ headline: 'Your computer is one click away.',+ subline:+ 'Invite OpenComputer to your Slack and it wakes up as part of your team — ready in seconds.',+ })+ // Installed, the computer not there yet: on its way.+ expect(heroCopy(null, 'free', true).headline).toBe(heroCopy({ ...computer, state: 'provisioning' }, 'free').headline,)})@@ -174,7 +190,12 @@ describe('computer state copy', () => {describe('computer polling', () => {it('polls quickly while the computer is changing or not connected', () => {expect(computerPollInterval(undefined)).toBe(FAST_POLL_MS)- expect(computerPollInterval(status({ computer: null }))).toBe(FAST_POLL_MS)+ // Slack installed and the computer on its way.+ expect(+ computerPollInterval(+ status({ computer: null, slack: { installed: true, teamId: 'T1' } }),+ ),+ ).toBe(FAST_POLL_MS)for (const state of ['provisioning', 'waking', 'deleting'] as const) {expect(computerPollInterval(status({ computer: { ...computer, state } })),@@ -187,8 +208,9 @@ describe('computer polling', () => {).toBe(FAST_POLL_MS)})- it('polls slowly once online, asleep or failed', () => {+ it('polls slowly once online, asleep or failed, and before the Slack install', () => {expect(computerPollInterval(status())).toBe(SLOW_POLL_MS)+ expect(computerPollInterval(status({ computer: null }))).toBe(SLOW_POLL_MS)for (const state of ['parked', 'failed'] as const) {expect(computerPollInterval(diff --git a/web/src/managed-agents/computer-state.ts b/web/src/managed-agents/computer-state.tsindex dc7ab1e1..dff75a14 100644--- a/web/src/managed-agents/computer-state.ts+++ b/web/src/managed-agents/computer-state.ts@@ -20,10 +20,25 @@ export type ComputerPresentation = {description: string}+/**+ * `slackInstalled`: an organization's computer comes alive when it installs+ * the Slack app, not when someone opens the page (work 052, Mohamed+ * 2026-10-13). With no computer and no Slack yet it is "not set up"; with+ * Slack installed and no computer yet it is on its way.+ */export function computerPresentation(computer: Computer | null,plan: ComputerStatus['plan'],+ slackInstalled = false,): ComputerPresentation {+ if (!computer && !slackInstalled) {+ return {+ badge: 'not_deployed',+ label: 'Not set up yet',+ description:+ 'Invite OpenComputer to your Slack and your computer wakes up, ready in seconds.',+ }+ }if (!computer) {return {badge: 'starting',@@ -100,13 +115,16 @@ export const SLOW_POLL_MS = 30_000/*** Re-read quickly while something is about to change on its own (setting up,* waking, removing, or a running computer that has not connected yet), and- * slowly otherwise. A sleeping or failed computer changes only on request.+ * slowly otherwise. A sleeping or failed computer changes only on request,+ * and so does one not set up yet: it comes with the Slack install, whose+ * redirect reloads the page.*/export function computerPollInterval(status: ComputerStatus | undefined,): number {- const computer = status?.computer- if (!computer) return FAST_POLL_MS+ if (!status) return FAST_POLL_MS+ const computer = status.computer+ if (!computer) return status.slack.installed ? FAST_POLL_MS : SLOW_POLL_MSswitch (computer.state) {case 'provisioning':case 'waking':@@ -227,7 +245,17 @@ export type HeroCopy = { headline: string; subline: string }export function heroCopy(computer: Computer | null,plan: ComputerStatus['plan'],+ slackInstalled = false,): HeroCopy {+ // Before the Slack install there is no computer: the install is the moment+ // it comes alive, so that is what the page asks for.+ if (!computer && !slackInstalled) {+ return {+ headline: 'Your computer is one click away.',+ subline:+ 'Invite OpenComputer to your Slack and it wakes up as part of your team — ready in seconds.',+ }+ }switch (computer?.state ?? 'provisioning') {case 'provisioning':return {