@@ -14,7 +14,8 @@ export interface SandboxConfig {
1414 githubToken : string ;
1515 owner : string ;
1616 repo : string ;
17- anthropicApiKey : string ;
17+ anthropicApiKey ?: string ;
18+ claudeCodeOauthToken ?: string ;
1819 claudeModel : string ;
1920 commitAuthor : string ;
2021 commitEmail : string ;
@@ -61,7 +62,9 @@ export class SandboxManager {
6162 runtime : "node24" ,
6263 timeout : this . config . jobTimeoutMs ,
6364 env : {
64- ANTHROPIC_API_KEY : this . config . anthropicApiKey ,
65+ ...( this . config . claudeCodeOauthToken
66+ ? { CLAUDE_CODE_OAUTH_TOKEN : this . config . claudeCodeOauthToken }
67+ : { ANTHROPIC_API_KEY : this . config . anthropicApiKey ! } ) ,
6568 CLAUDE_MODEL : this . config . claudeModel ,
6669 } ,
6770 } ) ;
@@ -75,6 +78,14 @@ export class SandboxManager {
7578 // Install Claude Code
7679 await sandbox . runCommand ( "npm" , [ "install" , "-g" , "@anthropic-ai/claude-code" ] ) ;
7780
81+ // Skip interactive onboarding (required for headless OAuth token auth)
82+ if ( this . config . claudeCodeOauthToken ) {
83+ await sandbox . runCommand ( "bash" , [
84+ "-c" ,
85+ `mkdir -p ~/.claude && echo '{"hasCompletedOnboarding":true}' > ~/.claude.json` ,
86+ ] ) ;
87+ }
88+
7889 // Install skills globally (outside the client repo)
7990 await this . installGlobalSkills ( sandbox ) ;
8091
0 commit comments