(opts *session.CreateOpts, profile *taskpkg.ExecutionProfile)
| 222 | } |
| 223 | |
| 224 | func 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 | |
| 244 | func taskRuntimeEvidenceCanAutoApprove(profile *taskpkg.ExecutionProfile) bool { |
| 245 | if profile == nil { |
no test coverage detected