( ctx context.Context, opts session.CreateOpts, )
| 371 | } |
| 372 | |
| 373 | func (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 |
no test coverage detected