MCPcopy Create free account
hub / github.com/HKUDS/AgentSpace / recordRouterLifecycleEvent

Function recordRouterLifecycleEvent

packages/db/src/task-queue.ts:690–719  ·  view source on GitHub ↗
(
  task: QueuedTaskRecord,
  event: {
    type: string;
    actorType: Parameters<typeof recordAgentRouterEventSync>[0]["actorType"];
    actorId?: string;
    attemptId?: string;
    runtimeId?: string;
    provider?: Parameters<typeof recordAgentRouterEventSync>[0]["provider"];
    summary?: string;
    data?: Record<string, unknown>;
  },
)

Source from the content-addressed store, hash-verified

688}
689
690function recordRouterLifecycleEvent(
691 task: QueuedTaskRecord,
692 event: {
693 type: string;
694 actorType: Parameters<typeof recordAgentRouterEventSync>[0]["actorType"];
695 actorId?: string;
696 attemptId?: string;
697 runtimeId?: string;
698 provider?: Parameters<typeof recordAgentRouterEventSync>[0]["provider"];
699 summary?: string;
700 data?: Record<string, unknown>;
701 },
702): void {
703 if (!task.routerSessionId) {
704 return;
705 }
706 recordAgentRouterEventSync({
707 workspaceId: task.workspaceId,
708 routerSessionId: task.routerSessionId,
709 taskQueueId: task.id,
710 attemptId: event.attemptId,
711 type: event.type,
712 actorType: event.actorType,
713 actorId: event.actorId,
714 runtimeId: event.runtimeId ?? task.runtimeId,
715 provider: event.provider,
716 summary: event.summary,
717 data: event.data,
718 });
719}
720
721function recordArtifactEvents(task: QueuedTaskRecord, resultJson: Record<string, unknown> | undefined): void {
722 if (!resultJson) {

Callers 6

enqueueNativeTaskSyncFunction · 0.85
startQueuedTaskSyncFunction · 0.85
completeQueuedTaskSyncFunction · 0.85
failQueuedTaskSyncFunction · 0.85
cancelQueuedTaskSyncFunction · 0.85

Calls 1

Tested by

no test coverage detected