feat: add app-owned Copilot and Grok subscription connections
This commit is contained in:
@@ -2,6 +2,7 @@ import { Agent, type AgentEvent, type AgentMessage, type AgentTool } from "@eare
|
||||
import type { AssistantMessage, ToolResultMessage, Usage } from "@earendil-works/pi-ai";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { APP_IDENTITY, piEngineFor, type PiEngine } from "../models.ts";
|
||||
import { usageWasAdmitted } from "../subscription-request-cycle.ts";
|
||||
import { providerEventObserver } from "../provider-events.ts";
|
||||
import type { ModelRole } from "../../../config.ts";
|
||||
|
||||
@@ -107,6 +108,7 @@ export async function runSubagent(tools: AgentTool<any, any>[], opts: SubagentRu
|
||||
aborted = true;
|
||||
break;
|
||||
}
|
||||
if (!usageWasAdmitted(m.usage)) { if (m.stopReason === "error") errorMessage = m.errorMessage; break; }
|
||||
step++;
|
||||
opts.onUsage?.(m.usage);
|
||||
opts.onAssistantMessage?.(m, step);
|
||||
|
||||
Reference in New Issue
Block a user