File tree Expand file tree Collapse file tree
apps/server/src/orchestration-v2/Adapters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9122,13 +9122,19 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
91229122 const configuredDir = adapterOptions . environment . CLAUDE_CONFIG_DIR ?. trim ( ) ?? "" ;
91239123 const projectsDir = path . join (
91249124 configuredDir . length > 0
9125- ? path . resolve ( configuredDir )
9125+ ? path . resolve ( session . cwd , configuredDir )
91269126 : path . join ( yield * HostProcess . HomeDirectory , ".claude" ) ,
91279127 "projects" ,
91289128 ) ;
9129+ // Empty only when every copy of the id is empty; any message means
9130+ // the CLI may still resume it.
9131+ let found = false ;
91299132 for ( const project of yield * fileSystem . readDirectory ( projectsDir ) ) {
91309133 const transcriptPath = path . join ( projectsDir , project , `${ nativeThreadId } .jsonl` ) ;
9131- if ( ! ( yield * fileSystem . exists ( transcriptPath ) ) ) {
9134+ // Stray files beside the project dirs fail with ENOTDIR.
9135+ if (
9136+ ! ( yield * fileSystem . exists ( transcriptPath ) . pipe ( Effect . orElseSucceed ( ( ) => false ) ) )
9137+ ) {
91329138 continue ;
91339139 }
91349140 const conversationLine = yield * fileSystem
@@ -9139,9 +9145,12 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
91399145 Stream . filter ( isClaudeConversationLine ) ,
91409146 Stream . runHead ,
91419147 ) ;
9142- return Option . isNone ( conversationLine ) ;
9148+ if ( Option . isSome ( conversationLine ) ) {
9149+ return false ;
9150+ }
9151+ found = true ;
91439152 }
9144- return false ;
9153+ return found ;
91459154 } ,
91469155 ) ;
91479156
You can’t perform that action at this time.
0 commit comments