@@ -154,6 +154,7 @@ import { spawnClaudeProcess } from "../../provider/Drivers/ClaudeProcess.ts";
154154import {
155155 claudeSignedOutMessage ,
156156 claudeAccountSettings ,
157+ parseClaudeAccountDir ,
157158 resolveClaudeHomePath ,
158159 type ClaudeRuntime ,
159160} from "../../provider/Drivers/ClaudeHome.ts" ;
@@ -1519,7 +1520,10 @@ export function makeClaudeQueryOptions(input: {
15191520 ...( typeof querySettings === "object" && querySettings !== null ? querySettings : { } ) ,
15201521 autoCompactWindow : Number ( input . settings . autoCompactWindow ) ,
15211522 } as ClaudeSdkSettings ) ;
1522- const accountSettings = input . settings ? claudeAccountSettings ( input . settings ) : undefined ;
1523+ const accountSettings =
1524+ input . settings ?. setupMode === "cli"
1525+ ? claudeAccountSettings ( parseClaudeAccountDir ( input . settings . homePath ) )
1526+ : undefined ;
15231527 // A settings file path cannot take extra keys, so it goes through unchanged.
15241528 const effectiveQuerySettings =
15251529 input . toolSearchOverride === undefined || typeof compactQuerySettings === "string"
@@ -1578,7 +1582,11 @@ export function makeClaudeQueryOptions(input: {
15781582 } ,
15791583 } ,
15801584 spawnClaudeCodeProcess : ( options ) =>
1581- spawnClaudeProcess ( options , input . platform , input . settings ! . homePath ) ,
1585+ spawnClaudeProcess (
1586+ options ,
1587+ input . platform ,
1588+ parseClaudeAccountDir ( input . settings ! . homePath ) ,
1589+ ) ,
15821590 } ) ,
15831591 ...( input . onUserDialog === undefined ? { } : { onUserDialog : input . onUserDialog } ) ,
15841592 ...( input . supportedDialogKinds === undefined
@@ -11291,8 +11299,6 @@ export const createClaudeAdapterV2 = Effect.fn("ClaudeAdapterV2Driver.create")(
1129111299 const queryRunner = yield * ClaudeAgentSdkQueryRunner ;
1129211300 const serverConfig = yield * ServerConfig . ServerConfig ;
1129311301 const continuationRequests = yield * ProviderContinuationRequests . ProviderContinuationRequests ;
11294- if ( runtime . mode === "cli" )
11295- yield * fileSystem . makeDirectory ( runtime . configDir , { recursive : true , mode : 0o700 } ) ;
1129611302 const path = yield * Path . Path ;
1129711303 const crypto = yield * Crypto . Crypto ;
1129811304 const binaryPath = yield * resolveClaudeSdkExecutablePath (
0 commit comments