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

Method handleTasksRunsStart

internal/extension/host_api_tasks.go:341–365  ·  view source on GitHub ↗
(ctx context.Context, raw json.RawMessage)

Source from the content-addressed store, hash-verified

339}
340
341func (h *HostAPIHandler) handleTasksRunsStart(ctx context.Context, raw json.RawMessage) (any, error) {
342 var params hostAPITaskRunStartParams
343 if err := decodeHostAPIParams(raw, &params); err != nil {
344 return nil, err
345 }
346 runID := strings.TrimSpace(params.ID)
347 if runID == "" {
348 return nil, invalidParamsRPCError(errors.New("id is required"))
349 }
350
351 manager, actor, err := h.taskManagerAndActor(ctx)
352 if err != nil {
353 return nil, err
354 }
355 startReq, err := startTaskRunFromRequest(params.StartTaskRunRequest)
356 if err != nil {
357 return nil, err
358 }
359
360 run, err := manager.StartRun(ctx, runID, startReq, actor)
361 if err != nil {
362 return nil, mapTaskRPCError(runID, err)
363 }
364 return taskRunPayloadFromRun(run), nil
365}
366
367func (h *HostAPIHandler) handleTasksRunsAttachSession(ctx context.Context, raw json.RawMessage) (any, error) {
368 var params hostAPITaskRunAttachSessionParams

Callers

nothing calls this directly

Calls 7

taskManagerAndActorMethod · 0.95
decodeHostAPIParamsFunction · 0.85
invalidParamsRPCErrorFunction · 0.85
mapTaskRPCErrorFunction · 0.85
taskRunPayloadFromRunFunction · 0.85
startTaskRunFromRequestFunction · 0.70
StartRunMethod · 0.65

Tested by

no test coverage detected