refactor(agents): remove stale facade exports · openclaw/openclaw@345ad98
vincentkoc
·
2026-06-23
·
via Recent Commits to openclaw:main
File tree
embedded-agent-runner/run
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,5 @@ describe("agent-model-discovery internal runtime", () => {
|
6 | 6 | const module = await import("./agent-model-discovery.js"); |
7 | 7 | expect(typeof module.discoverAuthStorage).toBe("function"); |
8 | 8 | expect(typeof module.discoverModels).toBe("function"); |
9 | | -expect(typeof module.AuthStorage.inMemory).toBe("function"); |
10 | | -expect(typeof module.ModelRegistry.create).toBe("function"); |
11 | 9 | }); |
12 | 10 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -22,8 +22,6 @@ import {
|
22 | 22 | type ModelRegistry as AgentModelRegistry, |
23 | 23 | } from "./sessions/index.js"; |
24 | 24 | |
25 | | -export { AuthStorage, ModelRegistry }; |
26 | | - |
27 | 25 | type ProviderRuntimeModelLike = Model & { |
28 | 26 | contextTokens?: number; |
29 | 27 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,6 @@ import {
|
23 | 23 | DEFAULT_BOOTSTRAP_FILENAME, |
24 | 24 | filterBootstrapFilesForSession, |
25 | 25 | isWorkspaceSetupCompleted, |
26 | | -isWorkspaceBootstrapPending, |
27 | 26 | loadWorkspaceBootstrapFiles, |
28 | 27 | type WorkspaceBootstrapFile, |
29 | 28 | } from "./workspace.js"; |
@@ -371,5 +370,3 @@ export function buildBootstrapContextForFiles(
|
371 | 370 | }); |
372 | 371 | return contextFiles; |
373 | 372 | } |
374 | | - |
375 | | -export { isWorkspaceBootstrapPending }; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -392,6 +392,14 @@ vi.mock("../../bootstrap-files.js", async () => {
|
392 | 392 | }; |
393 | 393 | }); |
394 | 394 | |
| 395 | +vi.mock("../../workspace.js", async () => { |
| 396 | +const actual = await vi.importActual<typeof import("../../workspace.js")>("../../workspace.js"); |
| 397 | +return { |
| 398 | + ...actual, |
| 399 | +isWorkspaceBootstrapPending: hoisted.isWorkspaceBootstrapPendingMock, |
| 400 | +}; |
| 401 | +}); |
| 402 | + |
395 | 403 | vi.mock("../../../skills/runtime/env-overrides.js", () => ({ |
396 | 404 | applySkillEnvOverrides: () => () => {}, |
397 | 405 | applySkillEnvOverridesFromSnapshot: () => () => {}, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -131,7 +131,6 @@ import {
|
131 | 131 | FULL_BOOTSTRAP_COMPLETED_CUSTOM_TYPE, |
132 | 132 | buildBootstrapContextForFiles, |
133 | 133 | hasCompletedBootstrapTurn, |
134 | | -isWorkspaceBootstrapPending, |
135 | 134 | makeBootstrapWarn, |
136 | 135 | resolveBootstrapFilesForRun, |
137 | 136 | resolveContextInjectionMode, |
@@ -253,7 +252,11 @@ import {
|
253 | 252 | } from "../../tools/cron-tool.js"; |
254 | 253 | import { shouldAllowProviderOwnedThinkingReplay } from "../../transcript-policy.js"; |
255 | 254 | import { normalizeUsage, type NormalizedUsage } from "../../usage.js"; |
256 | | -import { DEFAULT_BOOTSTRAP_FILENAME, type WorkspaceBootstrapFile } from "../../workspace.js"; |
| 255 | +import { |
| 256 | +DEFAULT_BOOTSTRAP_FILENAME, |
| 257 | +isWorkspaceBootstrapPending, |
| 258 | +type WorkspaceBootstrapFile, |
| 259 | +} from "../../workspace.js"; |
257 | 260 | import { isRunnerAbortError } from "../abort.js"; |
258 | 261 | import { isCacheTtlEligibleProvider, readLastCacheTtlTimestamp } from "../cache-ttl.js"; |
259 | 262 | import { resolveCompactionTimeoutMs } from "../compaction-safety-timeout.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -563,8 +563,6 @@ function isTranscriptOnlyOpenClawAssistantMessage(message: AgentMessage): boolea
|
563 | 563 | return isTranscriptOnlyOpenClawAssistantModel(provider, model); |
564 | 564 | } |
565 | 565 | |
566 | | -export { getRawSessionAppendMessage }; |
567 | | - |
568 | 566 | export function installSessionToolResultGuard( |
569 | 567 | sessionManager: SessionManager, |
570 | 568 | opts?: { |
@@ -728,7 +726,9 @@ export function installSessionToolResultGuard(
|
728 | 726 | capToolResultForPersistence(flushed.message, maxToolResultChars, redactionConfig), |
729 | 727 | { |
730 | 728 | invalidateSerializedPrefixCache: |
731 | | -persistedSynthetic !== synthetic || toolResultTransformerMayMutate || flushed.changed, |
| 729 | +persistedSynthetic !== synthetic || |
| 730 | +toolResultTransformerMayMutate || |
| 731 | +flushed.changed, |
732 | 732 | }, |
733 | 733 | ); |
734 | 734 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -99,10 +99,13 @@ vi.mock("../agents/agent-model-discovery.js", async () => {
|
99 | 99 | const actual = await vi.importActual<typeof import("../agents/agent-model-discovery.js")>( |
100 | 100 | "../agents/agent-model-discovery.js", |
101 | 101 | ); |
| 102 | +const modelSessions = await vi.importActual<typeof import("../agents/sessions/index.js")>( |
| 103 | +"../agents/sessions/index.js", |
| 104 | +); |
102 | 105 | |
103 | 106 | const createActualRegistry = (...args: Parameters<typeof actual.discoverModels>) => { |
104 | 107 | const modelsFile = path.join(args[1], "models.json"); |
105 | | -const Registry = actual.ModelRegistry as unknown as { |
| 108 | +const Registry = modelSessions.ModelRegistry as unknown as { |
106 | 109 | create?: ( |
107 | 110 | authStorage: unknown, |
108 | 111 | modelsFile: string, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。