(activation taskRoleActivation)
| 344 | } |
| 345 | |
| 346 | func taskRoleCreateOpts(activation taskRoleActivation) (session.CreateOpts, error) { |
| 347 | opts := session.CreateOpts{ |
| 348 | AgentName: activation.AgentName, |
| 349 | Provider: activation.Provider, |
| 350 | Model: activation.Model, |
| 351 | Name: taskRoleSessionName(activation), |
| 352 | Channel: activation.Channel, |
| 353 | PromptOverlay: taskRolePromptOverlay(activation), |
| 354 | Type: session.SessionTypeSystem, |
| 355 | } |
| 356 | applyTaskSessionSandboxProfile(&opts, activation.Profile) |
| 357 | applyTaskSessionRuntimeProfile(&opts, activation.Profile) |
| 358 | switch activation.Scope { |
| 359 | case taskpkg.ScopeWorkspace: |
| 360 | opts.Workspace = activation.WorkspaceID |
| 361 | case taskpkg.ScopeGlobal: |
| 362 | opts.WorkspacePath = activation.WorkspacePath |
| 363 | default: |
| 364 | return session.CreateOpts{}, fmt.Errorf( |
| 365 | "%w: unsupported task scope %q for role session start", |
| 366 | taskpkg.ErrValidation, |
| 367 | activation.Scope, |
| 368 | ) |
| 369 | } |
| 370 | return opts, nil |
| 371 | } |
| 372 | |
| 373 | func (r *taskRoleRuntime) createRoleSession( |
| 374 | ctx context.Context, |
no test coverage detected