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

Function taskRoleCreateOpts

internal/daemon/task_role_runtime.go:346–371  ·  view source on GitHub ↗
(activation taskRoleActivation)

Source from the content-addressed store, hash-verified

344}
345
346func 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
373func (r *taskRoleRuntime) createRoleSession(
374 ctx context.Context,

Callers 2

startRoleSessionMethod · 0.85

Calls 4

taskRoleSessionNameFunction · 0.85
taskRolePromptOverlayFunction · 0.85

Tested by

no test coverage detected