|
1 | 1 | import { randomUUID } from "node:crypto"; |
2 | 2 | import path from "node:path"; |
3 | 3 | import { resolveAgentWorkspaceDir } from "../agents/agent-scope.js"; |
4 | | -import { runEmbeddedPiAgent, type EmbeddedPiRunResult } from "../agents/pi-embedded.js"; |
5 | 4 | import type { OpenClawConfig } from "../config/config.js"; |
6 | 5 | import { resolveStateDir } from "../config/paths.js"; |
7 | 6 | import { createSubsystemLogger } from "../logging/subsystem.js"; |
@@ -21,6 +20,7 @@ import type {
|
21 | 20 | |
22 | 21 | type TimerHandle = ReturnType<typeof setTimeout>; |
23 | 22 | type ModelRef = { provider: string; model: string }; |
| 23 | +type EmbeddedPiPayloadResult = { payloads?: Array<{ text?: string }> }; |
24 | 24 | |
25 | 25 | type CommitmentExtractionEnqueueInput = CommitmentScope & { |
26 | 26 | cfg?: OpenClawConfig; |
@@ -191,7 +191,7 @@ function resolveExtractionSessionFile(agentId: string, runId: string): string {
|
191 | 191 | ); |
192 | 192 | } |
193 | 193 | |
194 | | -function joinPayloadText(result: EmbeddedPiRunResult): string { |
| 194 | +function joinPayloadText(result: EmbeddedPiPayloadResult): string { |
195 | 195 | return ( |
196 | 196 | result.payloads |
197 | 197 | ?.map((payload) => payload.text) |
@@ -224,6 +224,7 @@ async function defaultExtractBatch(params: {
|
224 | 224 | const resolved = resolveCommitmentsConfig(cfg); |
225 | 225 | const runId = `commitments-${randomUUID()}`; |
226 | 226 | const modelRef = await resolveDefaultModel({ cfg, agentId: first.agentId }); |
| 227 | +const { runEmbeddedPiAgent } = await import("../agents/pi-embedded.js"); |
227 | 228 | const result = await runEmbeddedPiAgent({ |
228 | 229 | sessionId: runId, |
229 | 230 | sessionKey: `agent:${first.agentId}:commitments:${runId}`, |
|