@@ -4379,41 +4379,43 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
43794379 const usageLimitSources = yield * Effect . serviceOption ( UsageLimitSources . UsageLimitSources ) ;
43804380 const workingDirectory = yield * HostProcess . WorkingDirectory ;
43814381 const { attachmentsDir, fileSystem, path, crypto, idAllocator, queryRunner } = adapterOptions ;
4382- const proxyResetAt = Effect . fn ( "ClaudeAdapterV2.proxyResetAt" ) ( function * (
4383- context : ActiveClaudeTurnContext ,
4384- ) {
4385- if ( Option . isNone ( usageLimitSources ) ) return null ;
4386- const cwd = context . input . runtimePolicy . cwd ?? workingDirectory ;
4387- const localDirectory = yield * localSettingsDirectory ( cwd ) ;
4388- let endpoint = adapterOptions . environment . ANTHROPIC_BASE_URL ;
4389- const settingsPaths = [
4390- path . join ( homePath , "settings.json" ) ,
4391- path . join ( cwd , ".claude" , "settings.json" ) ,
4392- path . join ( cwd , ".claude" , "settings.local.json" ) ,
4393- ...( localDirectory === cwd
4394- ? [ ]
4395- : [ path . join ( localDirectory , ".claude" , "settings.local.json" ) ] ) ,
4396- ] ;
4397- for ( const settingsPath of settingsPaths ) {
4398- const settings = yield * fileSystem . readFileString ( settingsPath ) . pipe (
4399- Effect . flatMap ( decodeClaudeEndpointSettings ) ,
4400- Effect . orElseSucceed ( ( ) => undefined ) ,
4401- ) ;
4402- endpoint = settings ?. env ?. ANTHROPIC_BASE_URL ?? endpoint ;
4403- }
4404- const launchSettings = yield * readClaudeLaunchArgSettings ( {
4405- settings : adapterOptions . settings ,
4406- cwd,
4407- fileSystem,
4408- path,
4409- } ) . pipe ( Effect . orElseSucceed ( ( ) => undefined ) ) ;
4410- endpoint = launchSettings ?. env ?. ANTHROPIC_BASE_URL ?? endpoint ;
4411- if ( ! endpoint ) return null ;
4412- return yield * usageLimitSources . value . resolveResetAt ( {
4413- endpoint,
4414- model : compileClaudeModelSelection ( context . input . modelSelection ) . apiModelId ,
4415- } ) ;
4416- } ) ;
4382+ const proxyResetAt = Effect . fn ( "ClaudeAdapterV2.proxyResetAt" ) (
4383+ function * ( context : ActiveClaudeTurnContext ) {
4384+ if ( Option . isNone ( usageLimitSources ) ) return null ;
4385+ const cwd = context . input . runtimePolicy . cwd ?? workingDirectory ;
4386+ const localDirectory = yield * localSettingsDirectory ( cwd ) ;
4387+ let endpoint = adapterOptions . environment . ANTHROPIC_BASE_URL ;
4388+ const settingsPaths = [
4389+ path . join ( homePath , "settings.json" ) ,
4390+ path . join ( cwd , ".claude" , "settings.json" ) ,
4391+ path . join ( cwd , ".claude" , "settings.local.json" ) ,
4392+ ...( localDirectory === cwd
4393+ ? [ ]
4394+ : [ path . join ( localDirectory , ".claude" , "settings.local.json" ) ] ) ,
4395+ ] ;
4396+ for ( const settingsPath of settingsPaths ) {
4397+ const settings = yield * fileSystem . readFileString ( settingsPath ) . pipe (
4398+ Effect . flatMap ( decodeClaudeEndpointSettings ) ,
4399+ Effect . orElseSucceed ( ( ) => undefined ) ,
4400+ ) ;
4401+ endpoint = settings ?. env ?. ANTHROPIC_BASE_URL ?? endpoint ;
4402+ }
4403+ const launchSettings = yield * readClaudeLaunchArgSettings ( {
4404+ settings : adapterOptions . settings ,
4405+ cwd,
4406+ fileSystem,
4407+ path,
4408+ } ) . pipe ( Effect . orElseSucceed ( ( ) => undefined ) ) ;
4409+ endpoint = launchSettings ?. env ?. ANTHROPIC_BASE_URL ?? endpoint ;
4410+ if ( ! endpoint ) return null ;
4411+ return yield * usageLimitSources . value . resolveResetAt ( {
4412+ endpoint,
4413+ model : compileClaudeModelSelection ( context . input . modelSelection ) . apiModelId ,
4414+ } ) ;
4415+ } ,
4416+ Effect . timeout ( "15 seconds" ) ,
4417+ Effect . orElseSucceed ( ( ) => null ) ,
4418+ ) ;
44174419
44184420 const subagentModelCatalog = scopeClaudeModelCatalog (
44194421 BUNDLED_CLAUDE_MODEL_CATALOG ,
0 commit comments