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

Method createRoleSession

internal/daemon/task_role_runtime.go:373–389  ·  view source on GitHub ↗
(
	ctx context.Context,
	opts session.CreateOpts,
)

Source from the content-addressed store, hash-verified

371}
372
373func (r *taskRoleRuntime) createRoleSession(
374 ctx context.Context,
375 opts session.CreateOpts,
376) (*session.Info, error) {
377 created, err := r.sessions.Create(ctx, opts)
378 if err != nil {
379 return nil, fmt.Errorf("daemon: create task role session: %w", err)
380 }
381 if created == nil {
382 return nil, errors.New("daemon: task role session create returned nil")
383 }
384 info := created.Info()
385 if info == nil {
386 return nil, errors.New("daemon: task role session create returned nil info")
387 }
388 return info, nil
389}
390
391// activateForStarvation spawns a capability-matched worker for a starved run that no agent has
392// claimed. The worker self-claims via `agh task next`; the scheduler never claims. It carries a

Callers 2

startRoleSessionMethod · 0.95

Calls 2

CreateMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected