MCPcopy Create free account
hub / github.com/compozy/agh / applyTaskSessionRuntimeProfile

Function applyTaskSessionRuntimeProfile

internal/daemon/task_runtime.go:224–242  ·  view source on GitHub ↗
(opts *session.CreateOpts, profile *taskpkg.ExecutionProfile)

Source from the content-addressed store, hash-verified

222}
223
224func applyTaskSessionRuntimeProfile(opts *session.CreateOpts, profile *taskpkg.ExecutionProfile) {
225 if opts == nil || profile == nil {
226 return
227 }
228 if profile.Runtime.Mode.Normalize() != taskpkg.RuntimeModeEvidence {
229 return
230 }
231 guidance := "Runtime evidence mode is enabled for this task. You may boot local app runtimes, " +
232 "run browser or simulator validation, and capture runtime evidence artifacts required by the task."
233 if taskRuntimeEvidenceCanAutoApprove(profile) {
234 opts.Permissions = aghconfig.PermissionModeApproveAll
235 } else {
236 guidance += " AGH keeps the configured permission mode because the task profile did not select a sandbox."
237 }
238 opts.PromptOverlay = joinPromptOverlays(
239 opts.PromptOverlay,
240 guidance,
241 )
242}
243
244func taskRuntimeEvidenceCanAutoApprove(profile *taskpkg.ExecutionProfile) bool {
245 if profile == nil {

Callers 2

taskRoleCreateOptsFunction · 0.85
StartTaskSessionMethod · 0.85

Calls 3

joinPromptOverlaysFunction · 0.85
NormalizeMethod · 0.45

Tested by

no test coverage detected