fix: remove ineffective dynamic imports

This commit is contained in:
Tak Hoffman 2026-03-12 15:54:24 -05:00
parent 7603c30377
commit 685f6c5132
2 changed files with 2 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import { consumeRootOptionToken, FLAG_TERMINATOR } from "../infra/cli-root-optio
import { resolveOpenClawAgentDir } from "./agent-paths.js";
import { normalizeProviderId } from "./model-selection.js";
import { ensureOpenClawModelsJson } from "./models-config.js";
import { discoverAuthStorage, discoverModels } from "./pi-model-discovery-runtime.js";
type ModelEntry = { id: string; contextWindow?: number };
type ModelRegistryLike = {
@ -157,8 +158,6 @@ function ensureContextWindowCacheLoaded(): Promise<void> {
}
try {
const { discoverAuthStorage, discoverModels } =
await import("./pi-model-discovery-runtime.js");
const agentDir = resolveOpenClawAgentDir();
const authStorage = discoverAuthStorage(agentDir);
const modelRegistry = discoverModels(authStorage, agentDir) as unknown as ModelRegistryLike;

View File

@ -1,3 +1,4 @@
import { ensureAuthProfileStore } from "../../agents/auth-profiles.runtime.js";
import { clearSessionAuthProfileOverride } from "../../agents/auth-profiles/session-override.js";
import { lookupContextTokens } from "../../agents/context.js";
import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js";
@ -365,7 +366,6 @@ export async function createModelSelectionState(params: {
}
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
const { ensureAuthProfileStore } = await import("../../agents/auth-profiles.runtime.js");
const store = ensureAuthProfileStore(undefined, {
allowKeychainPrompt: false,
});