File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed
Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
416416 const {
417417 taskId,
418418 taskRunId,
419- repoPath,
419+ repoPath : rawRepoPath ,
420420 credentials,
421421 logUrl,
422422 sessionId : existingSessionId ,
@@ -425,6 +425,9 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
425425 permissionMode,
426426 } = config ;
427427
428+ // Preview sessions don't need a real repo — use a temp directory
429+ const repoPath = taskId === "__preview__" ? tmpdir ( ) : rawRepoPath ;
430+
428431 if ( ! isRetry ) {
429432 const existing = this . sessions . get ( taskRunId ) ;
430433 if ( existing ) {
Original file line number Diff line number Diff line change @@ -480,7 +480,6 @@ export class SessionService {
480480
481481 async startPreviewSession ( params : {
482482 adapter : "claude" | "codex" ;
483- repoPath ?: string ;
484483 } ) : Promise < void > {
485484 this . previewAbort ?. abort ( ) ;
486485 const abort = new AbortController ( ) ;
@@ -508,7 +507,7 @@ export class SessionService {
508507 const result = await trpcVanilla . agent . start . mutate ( {
509508 taskId : PREVIEW_TASK_ID ,
510509 taskRunId,
511- repoPath : params . repoPath || "~ ",
510+ repoPath : "__preview__ ",
512511 apiKey : auth . apiKey ,
513512 apiHost : auth . apiHost ,
514513 projectId : auth . projectId ,
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export function TaskInput() {
6060 thoughtOption,
6161 previewTaskId,
6262 isConnecting,
63- } = usePreviewSession ( adapter , selectedDirectory || undefined ) ;
63+ } = usePreviewSession ( adapter ) ;
6464
6565 useEffect ( ( ) => {
6666 if ( view . folderId ) {
Original file line number Diff line number Diff line change @@ -24,21 +24,20 @@ interface PreviewSessionResult {
2424 * Manages a lightweight preview session that provides adapter-specific
2525 * config options (models, modes, reasoning levels) for the task input page.
2626 *
27- * Starts a new preview session when adapter or repoPath change ,
27+ * Starts a new preview session when adapter changes ,
2828 * and cleans up on unmount or when inputs change.
2929 */
3030export function usePreviewSession (
3131 adapter : "claude" | "codex" ,
32- repoPath : string | undefined ,
3332) : PreviewSessionResult {
3433 useEffect ( ( ) => {
3534 const service = getSessionService ( ) ;
36- service . startPreviewSession ( { adapter, repoPath } ) ;
35+ service . startPreviewSession ( { adapter } ) ;
3736
3837 return ( ) => {
3938 service . cancelPreviewSession ( ) ;
4039 } ;
41- } , [ adapter , repoPath ] ) ;
40+ } , [ adapter ] ) ;
4241
4342 const session = useSessionForTask ( PREVIEW_TASK_ID ) ;
4443 const modeOption = useModeConfigOptionForTask ( PREVIEW_TASK_ID ) ;
You can’t perform that action at this time.
0 commit comments