fix(cron): align runtime plugin preload mode · openclaw/openclaw@38e53a8
steipete
·
2026-05-15
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -28,6 +28,10 @@ vi.mock("../agents/subagent-announce.js", () => ({
|
28 | 28 | runSubagentAnnounceFlow: vi.fn(), |
29 | 29 | })); |
30 | 30 | |
| 31 | +vi.mock("./isolated-agent/run-runtime-plugins.runtime.js", () => ({ |
| 32 | +ensureRuntimePluginsLoaded: vi.fn(), |
| 33 | +})); |
| 34 | + |
31 | 35 | vi.mock("../gateway/call.js", () => ({ |
32 | 36 | callGateway: vi.fn(), |
33 | 37 | })); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,6 +3,8 @@ import { makeIsolatedAgentTurnParams, setupRunCronIsolatedAgentTurnSuite } from
|
3 | 3 | import { |
4 | 4 | loadRunCronIsolatedAgentTurn, |
5 | 5 | ensureRuntimePluginsLoadedMock, |
| 6 | +resolveConfiguredModelRefMock, |
| 7 | +resolveCronDeliveryPlanMock, |
6 | 8 | } from "./run.test-harness.js"; |
7 | 9 | |
8 | 10 | const runCronIsolatedAgentTurn = await loadRunCronIsolatedAgentTurn(); |
@@ -24,6 +26,13 @@ describe("runCronIsolatedAgentTurn runtime plugins loading", () => {
|
24 | 26 | }), |
25 | 27 | }), |
26 | 28 | workspaceDir: "/tmp/workspace", // matches resolveAgentWorkspaceDir mock |
| 29 | +allowGatewaySubagentBinding: true, |
27 | 30 | }); |
| 31 | +expect(ensureRuntimePluginsLoadedMock.mock.invocationCallOrder[0]).toBeLessThan( |
| 32 | +resolveConfiguredModelRefMock.mock.invocationCallOrder[0], |
| 33 | +); |
| 34 | +expect(ensureRuntimePluginsLoadedMock.mock.invocationCallOrder[0]).toBeLessThan( |
| 35 | +resolveCronDeliveryPlanMock.mock.invocationCallOrder[0], |
| 36 | +); |
28 | 37 | }); |
29 | 38 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -546,11 +546,12 @@ async function prepareCronRunContext(params: {
|
546 | 546 | }); |
547 | 547 | const workspaceDir = workspace.dir; |
548 | 548 | |
549 | | -// Ensure channel plugins and external model providers are loaded into the registry. |
550 | | -// Must happen before resolving models and delivery context to avoid multi-channel ambiguity |
551 | | -// and missing provider errors. |
552 | 549 | const { ensureRuntimePluginsLoaded } = await loadRuntimePlugins(); |
553 | | -ensureRuntimePluginsLoaded({ config: cfgWithAgentDefaults, workspaceDir }); |
| 550 | +ensureRuntimePluginsLoaded({ |
| 551 | +config: cfgWithAgentDefaults, |
| 552 | + workspaceDir, |
| 553 | +allowGatewaySubagentBinding: true, |
| 554 | +}); |
554 | 555 | |
555 | 556 | const isGmailHook = hookExternalContentSource === "gmail"; |
556 | 557 | const now = Date.now(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。