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

Method handleTasksRunsGet

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

Source from the content-addressed store, hash-verified

265}
266
267func (h *HostAPIHandler) handleTasksRunsGet(ctx context.Context, raw json.RawMessage) (any, error) {
268 var params hostAPITaskRunGetParams
269 if err := decodeHostAPIParams(raw, &params); err != nil {
270 return nil, err
271 }
272 runID := strings.TrimSpace(params.ID)
273 if runID == "" {
274 return nil, invalidParamsRPCError(errors.New("id is required"))
275 }
276
277 manager, actor, err := h.taskManagerAndActor(ctx)
278 if err != nil {
279 return nil, err
280 }
281
282 view, err := manager.RunDetail(ctx, runID, actor)
283 if err != nil {
284 return nil, mapTaskRPCError(runID, err)
285 }
286 return taskRunDetailPayloadFromView(view), nil
287}
288
289func (h *HostAPIHandler) handleTasksRunsEnqueue(ctx context.Context, raw json.RawMessage) (any, error) {
290 var params hostAPITaskRunEnqueueParams

Callers

nothing calls this directly

Calls 6

taskManagerAndActorMethod · 0.95
decodeHostAPIParamsFunction · 0.85
invalidParamsRPCErrorFunction · 0.85
mapTaskRPCErrorFunction · 0.85
RunDetailMethod · 0.65

Tested by

no test coverage detected