@@ -138,6 +138,7 @@ export interface AgentPodOpts {
138138 timeoutMs : number ;
139139 pollMs : number ;
140140 } ;
141+ skipWorkspaceBootstrap ?: boolean ;
141142 resources ?: {
142143 agent ?: k8s . V1ResourceRequirements ;
143144 editor ?: k8s . V1ResourceRequirements ;
@@ -251,6 +252,7 @@ export function buildAgentPodSpec(opts: AgentPodOpts): k8s.V1Pod {
251252 claudePrAttribution,
252253 useGvisor,
253254 userIdentity,
255+ skipWorkspaceBootstrap,
254256 } = opts ;
255257
256258 const initScriptOpts : InitScriptOpts = {
@@ -319,65 +321,69 @@ export function buildAgentPodSpec(opts: AgentPodOpts): k8s.V1Pod {
319321 type : 'RuntimeDefault' ,
320322 } ,
321323 } ,
322- initContainers : [
323- {
324- name : 'prepare-workspace' ,
325- image,
326- imagePullPolicy : 'IfNotPresent' ,
327- command : [ 'sh' , '-c' , `mkdir -p "${ AGENT_WORKSPACE_VOLUME_ROOT } /${ AGENT_WORKSPACE_SUBPATH } "` ] ,
328- resources,
329- securityContext : {
330- ...securityContext ,
331- readOnlyRootFilesystem : false ,
332- } ,
333- volumeMounts : [
334- {
335- name : 'workspace' ,
336- mountPath : AGENT_WORKSPACE_VOLUME_ROOT ,
337- } ,
338- {
339- name : 'tmp' ,
340- mountPath : '/tmp' ,
341- } ,
342- ] ,
343- env : [
344- { name : 'TMPDIR' , value : '/tmp' } ,
345- { name : 'TMP' , value : '/tmp' } ,
346- { name : 'TEMP' , value : '/tmp' } ,
347- ] ,
348- } ,
349- {
350- name : 'init-workspace' ,
351- image,
352- imagePullPolicy : 'IfNotPresent' ,
353- command : [ 'sh' , '-c' , initScript ] ,
354- resources,
355- securityContext : {
356- ...securityContext ,
357- readOnlyRootFilesystem : false ,
358- } ,
359- volumeMounts : [
360- workspaceVolumeMount ,
361- {
362- name : 'claude-config' ,
363- mountPath : '/home/claude/.claude' ,
364- } ,
365- {
366- name : 'tmp' ,
367- mountPath : '/tmp' ,
368- } ,
369- ] ,
370- env : [
371- { name : 'HOME' , value : '/home/claude/.claude' } ,
372- { name : 'TMPDIR' , value : '/tmp' } ,
373- { name : 'TMP' , value : '/tmp' } ,
374- { name : 'TEMP' , value : '/tmp' } ,
375- ...forwardedAgentSecretEnv ,
376- ...githubTokenEnv ,
377- ...userEnv ,
378- ] ,
379- } ,
380- ] ,
324+ ...( skipWorkspaceBootstrap
325+ ? { }
326+ : {
327+ initContainers : [
328+ {
329+ name : 'prepare-workspace' ,
330+ image,
331+ imagePullPolicy : 'IfNotPresent' ,
332+ command : [ 'sh' , '-c' , `mkdir -p "${ AGENT_WORKSPACE_VOLUME_ROOT } /${ AGENT_WORKSPACE_SUBPATH } "` ] ,
333+ resources,
334+ securityContext : {
335+ ...securityContext ,
336+ readOnlyRootFilesystem : false ,
337+ } ,
338+ volumeMounts : [
339+ {
340+ name : 'workspace' ,
341+ mountPath : AGENT_WORKSPACE_VOLUME_ROOT ,
342+ } ,
343+ {
344+ name : 'tmp' ,
345+ mountPath : '/tmp' ,
346+ } ,
347+ ] ,
348+ env : [
349+ { name : 'TMPDIR' , value : '/tmp' } ,
350+ { name : 'TMP' , value : '/tmp' } ,
351+ { name : 'TEMP' , value : '/tmp' } ,
352+ ] ,
353+ } ,
354+ {
355+ name : 'init-workspace' ,
356+ image,
357+ imagePullPolicy : 'IfNotPresent' ,
358+ command : [ 'sh' , '-c' , initScript ] ,
359+ resources,
360+ securityContext : {
361+ ...securityContext ,
362+ readOnlyRootFilesystem : false ,
363+ } ,
364+ volumeMounts : [
365+ workspaceVolumeMount ,
366+ {
367+ name : 'claude-config' ,
368+ mountPath : '/home/claude/.claude' ,
369+ } ,
370+ {
371+ name : 'tmp' ,
372+ mountPath : '/tmp' ,
373+ } ,
374+ ] ,
375+ env : [
376+ { name : 'HOME' , value : '/home/claude/.claude' } ,
377+ { name : 'TMPDIR' , value : '/tmp' } ,
378+ { name : 'TMP' , value : '/tmp' } ,
379+ { name : 'TEMP' , value : '/tmp' } ,
380+ ...forwardedAgentSecretEnv ,
381+ ...githubTokenEnv ,
382+ ...userEnv ,
383+ ] ,
384+ } ,
385+ ] ,
386+ } ) ,
381387 containers : [
382388 {
383389 name : 'agent' ,
0 commit comments