MCPcopy Create free account
hub / github.com/github/gh-aw / ensureDefaultAgentWritePath

Function ensureDefaultAgentWritePath

pkg/workflow/sandbox.go:221–238  ·  view source on GitHub ↗
(sandboxConfig *SandboxConfig)

Source from the content-addressed store, hash-verified

219}
220
221func ensureDefaultAgentWritePath(sandboxConfig *SandboxConfig) {
222 if sandboxConfig == nil || sandboxConfig.Agent == nil {
223 return
224 }
225 if sandboxConfig.Agent.Config == nil {
226 sandboxConfig.Agent.Config = &SandboxRuntimeConfig{}
227 }
228 if sandboxConfig.Agent.Config.Filesystem == nil {
229 sandboxConfig.Agent.Config.Filesystem = &SRTFilesystemConfig{}
230 }
231 if slices.Contains(sandboxConfig.Agent.Config.Filesystem.AllowWrite, defaultAgentWorkspaceWritePath) {
232 return
233 }
234 sandboxConfig.Agent.Config.Filesystem.AllowWrite = append(
235 sandboxConfig.Agent.Config.Filesystem.AllowWrite,
236 defaultAgentWorkspaceWritePath,
237 )
238}
239
240// isSandboxEnabled checks if the sandbox is enabled (either explicitly or auto-enabled)
241// Returns true when:

Callers 1

applySandboxDefaultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected