@@ -31,16 +31,15 @@ export class RunFinalizationRefreshError extends Schema.TaggedError<RunFinalizat
3131
3232export class RunFinalizationObserver extends Context . Reference < {
3333 readonly refreshAfterTurn : ( projectId : ProjectId ) => Effect . Effect < void > ;
34- /** Resolves to the branch checked out in `cwd`, or null when detached. */
3534 readonly refresh : ( input : {
3635 readonly cwd : string ;
3736 readonly threadId : ThreadId ;
3837 readonly runId : RunId ;
3938 readonly followBranch ?: ( branch : string ) => Effect . Effect < void > ;
40- } ) => Effect . Effect < string | null , RunFinalizationRefreshError > ;
39+ } ) => Effect . Effect < void , RunFinalizationRefreshError > ;
4140} > ( "t3/orchestration-v2/RunFinalizationObserver" , {
4241 defaultValue : ( ) => ( {
43- refresh : ( ) => Effect . succeed ( null ) ,
42+ refresh : ( ) => Effect . void ,
4443 refreshAfterTurn : ( ) => Effect . void ,
4544 } ) ,
4645} ) { }
@@ -148,7 +147,7 @@ const make = Effect.gen(function* () {
148147 Effect . logWarning ( "Failed to refresh workspace after checkpoint capture" , {
149148 ...input ,
150149 cause,
151- } ) . pipe ( Effect . as ( null ) ) ,
150+ } ) ,
152151 } ) ,
153152 ) ;
154153 }
@@ -174,12 +173,12 @@ export const layerObserver = Layer.effect(
174173 [ workspaceEntries . refresh ( cwd ) , vcsStatus . refreshLocalStatus ( cwd ) ] ,
175174 { concurrency : "unbounded" } ,
176175 ) ;
177- if ( local . refName === null ) return null ;
176+ if ( local . refName === null ) return ;
178177 if ( followBranch ) yield * followBranch ( local . refName ) ;
179- if ( local . isDefaultRef ) return local . refName ;
178+ if ( local . isDefaultRef ) return ;
180179 const thread = yield * projections . getThreadShell ( threadId ) ;
181- if ( ! thread || thread . branch !== local . refName ) return local . refName ;
182- if ( thread . activeRunId !== null && thread . activeRunId !== runId ) return local . refName ;
180+ if ( ! thread || thread . branch !== local . refName ) return ;
181+ if ( thread . activeRunId !== null && thread . activeRunId !== runId ) return ;
183182 // The forge CLI can take minutes, so the next turn must not wait for it. A newer
184183 // turn's lookup replaces a running one instead of queueing behind the cwd's lock.
185184 yield * vcsStatus . refreshPullRequestStatus ( cwd ) . pipe (
@@ -192,7 +191,6 @@ export const layerObserver = Layer.effect(
192191 ) ,
193192 FiberMap . run ( pullRequestLookups , cwd ) ,
194193 ) ;
195- return local . refName ;
196194 } ,
197195 ( effect , { cwd } ) =>
198196 effect . pipe ( Effect . mapError ( ( cause ) => new RunFinalizationRefreshError ( { cwd, cause } ) ) ) ,
0 commit comments