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

Method startStarvationSession

internal/daemon/task_role_runtime.go:502–522  ·  view source on GitHub ↗
(
	ctx context.Context,
	activation taskRoleActivation,
)

Source from the content-addressed store, hash-verified

500}
501
502func (r *taskRoleRuntime) startStarvationSession(
503 ctx context.Context,
504 activation taskRoleActivation,
505) (*session.Info, error) {
506 opts, err := taskRoleCreateOpts(activation)
507 if err != nil {
508 return nil, err
509 }
510 ttlExpiresAt := r.now().UTC().Add(defaultStarvationWorkerTTL)
511 opts.Lineage = &store.SessionLineage{
512 SpawnRole: session.DefaultSpawnRole,
513 TTLExpiresAt: &ttlExpiresAt,
514 SpawnBudget: store.SessionSpawnBudget{
515 MaxChildren: session.DefaultSpawnMaxChildren,
516 MaxDepth: session.DefaultSpawnMaxDepth,
517 TTLSeconds: int64(defaultStarvationWorkerTTL / time.Second),
518 MaxActivePerWorkspace: defaultStarvationMaxActivePerWorkspace,
519 },
520 }
521 return r.createRoleSession(ctx, opts)
522}
523
524func taskRoleSessionMatches(info *session.Info, activation taskRoleActivation) bool {
525 if info == nil {

Callers 1

activateForStarvationMethod · 0.95

Calls 4

createRoleSessionMethod · 0.95
taskRoleCreateOptsFunction · 0.85
AddMethod · 0.45
nowMethod · 0.45

Tested by

no test coverage detected