@@ -3,11 +3,6 @@ import {
33 type InboxCloudTaskInputContext ,
44 useInboxCloudTaskRunner ,
55} from "@posthog/ui/features/inbox/hooks/useInboxCloudTaskRunner" ;
6- import { useUserRepositoryIntegration } from "@posthog/ui/features/integrations/useIntegrations" ;
7- import {
8- resolveDefaultCloudRepository ,
9- useSettingsStore ,
10- } from "@posthog/ui/features/settings/settingsStore" ;
116import { useCallback , useMemo , useRef } from "react" ;
127import { buildLoopBuilderPrompt } from "../loopBuilderPrompt" ;
138
@@ -32,15 +27,6 @@ export function useLoopBuilderTask(context?: {
3227 const instructionsRef = useRef ( "" ) ;
3328 const contextRef = useRef ( context ) ;
3429 contextRef . current = context ;
35- const { repositories } = useUserRepositoryIntegration ( ) ;
36- const lastUsedCloudRepository = useSettingsStore (
37- ( state ) => state . lastUsedCloudRepository ,
38- ) ;
39-
40- const cloudRepository = useMemo (
41- ( ) => resolveDefaultCloudRepository ( repositories , lastUsedCloudRepository ) ,
42- [ lastUsedCloudRepository , repositories ] ,
43- ) ;
4430
4531 const buildInput = useCallback (
4632 ( ctx : InboxCloudTaskInputContext ) : TaskCreationInput => {
@@ -51,8 +37,11 @@ export function useLoopBuilderTask(context?: {
5137 return {
5238 content : prompt ,
5339 taskDescription : prompt ,
54- repository : ctx . cloudRepository ,
55- githubUserIntegrationId : ctx . githubUserIntegrationId ?? undefined ,
40+ // Building a loop is pure PostHog-MCP work (loops-list, integrations-list,
41+ // loops-create); it never touches a working tree. Run repo-less so the
42+ // sandbox skips the clone and isn't tied to some arbitrary default repo.
43+ repository : undefined ,
44+ githubUserIntegrationId : undefined ,
5645 workspaceMode : "cloud" ,
5746 executionMode : "acceptEdits" ,
5847 adapter : ctx . adapter ,
@@ -77,8 +66,9 @@ export function useLoopBuilderTask(context?: {
7766 ) ;
7867
7968 const { run, isRunning } = useInboxCloudTaskRunner ( {
80- cloudRepository,
81- // Loop creation is pure PostHog-MCP work; a missing repo must not block it.
69+ // The loop builder never needs a repo: run repo-less so the sandbox does no
70+ // clone and no GitHub identity is attached.
71+ cloudRepository : null ,
8272 allowMissingRepository : true ,
8373 loggerScope : "loop-builder" ,
8474 copy,
0 commit comments