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

Method handleTasksRunsEnqueue

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

Source from the content-addressed store, hash-verified

287}
288
289func (h *HostAPIHandler) handleTasksRunsEnqueue(ctx context.Context, raw json.RawMessage) (any, error) {
290 var params hostAPITaskRunEnqueueParams
291 if err := decodeHostAPIParams(raw, &params); err != nil {
292 return nil, err
293 }
294 taskID := strings.TrimSpace(params.TaskID)
295 if taskID == "" {
296 return nil, invalidParamsRPCError(errors.New("task_id is required"))
297 }
298
299 manager, actor, err := h.taskManagerAndActor(ctx)
300 if err != nil {
301 return nil, err
302 }
303 spec, err := enqueueTaskRunFromRequest(taskID, params.EnqueueTaskRunRequest)
304 if err != nil {
305 return nil, err
306 }
307
308 run, err := manager.EnqueueRun(ctx, spec, actor)
309 if err != nil {
310 return nil, mapTaskRPCError(taskID, err)
311 }
312 return taskRunPayloadFromRun(run), nil
313}
314
315func (h *HostAPIHandler) handleTasksRunsClaim(ctx context.Context, raw json.RawMessage) (any, error) {
316 var params hostAPITaskRunClaimParams

Callers

nothing calls this directly

Calls 7

taskManagerAndActorMethod · 0.95
decodeHostAPIParamsFunction · 0.85
invalidParamsRPCErrorFunction · 0.85
mapTaskRPCErrorFunction · 0.85
taskRunPayloadFromRunFunction · 0.85
EnqueueRunMethod · 0.65

Tested by

no test coverage detected