Skip to content

Commit 8eeaa45

Browse files
authored
refactor: route model catalog imports to core package
Route internal model catalog imports to the extracted @openclaw/model-catalog-core package and delete obsolete internal facades. Keep public SDK declarations self-contained by wrapping core helpers at public boundaries instead of leaking private package imports. Verification: - pnpm test src/plugins/contracts/model-catalog-core-imports.test.ts src/plugins/sdk-alias.test.ts packages/model-catalog-core/src/configured-model-refs.test.ts packages/model-catalog-core/src/provider-model-id-normalize.test.ts packages/model-catalog-core/src/provider-model-id-normalization.test.ts src/config/config.model-ref-validation.test.ts src/agents/model-selection.test.ts src/plugin-sdk/provider-model-shared.test.ts -- --reporter=verbose - pnpm check:test-types - pnpm test:extensions:package-boundary:compile - pnpm build - rg "@openclaw/model-catalog-core" dist/plugin-sdk packages/plugin-sdk/dist -n --glob '*.d.ts' || true - git diff --check - autoreview clean after fix CI note: merged with admin override because checks-node-agentic-commands-doctor and checks-node-core-runtime-infra-state failed twice with exit 143/no-output watchdog termination after prior passing test output, while relevant local proof and the rest of CI were green.
1 parent 4d13055 commit 8eeaa45

119 files changed

Lines changed: 293 additions & 178 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/agents/agent-auth-credentials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
12
import { coerceSecretRef } from "../config/types.secrets.js";
23
import { normalizeOptionalString } from "../shared/string-coerce.js";
34
import type { AuthProfileCredential, AuthProfileStore } from "./auth-profiles.js";
4-
import { normalizeProviderId } from "./provider-id.js";
55

66
type AgentApiKeyCredential = { type: "api_key"; key: string };
77
type AgentOAuthCredential = {

src/agents/agent-model-discovery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from "node:path";
2+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
23
import type { OpenClawConfig } from "../config/types.openclaw.js";
34
import type { Model } from "../llm/types.js";
45
import { normalizeModelCompat } from "../plugins/provider-model-compat.js";
@@ -14,7 +15,6 @@ import {
1415
} from "./agent-auth-discovery.js";
1516
import { resolveModelPluginMetadataSnapshot } from "./model-discovery-context.js";
1617
import type { PluginModelCatalogMetadataSnapshot } from "./plugin-model-catalog.js";
17-
import { normalizeProviderId } from "./provider-id.js";
1818
import {
1919
AuthStorage,
2020
ModelRegistry,

src/agents/agent-settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
12
import type { AgentCompactionMode } from "../config/types.agent-defaults.js";
23
import type { OpenClawConfig } from "../config/types.openclaw.js";
34
import type { ContextEngineInfo } from "../context-engine/types.js";
45
import { MIN_PROMPT_BUDGET_RATIO, MIN_PROMPT_BUDGET_TOKENS } from "./agent-compaction-constants.js";
56
import { resolveProviderEndpoint } from "./provider-attribution.js";
6-
import { normalizeProviderId } from "./provider-id.js";
77

88
export const DEFAULT_AGENT_COMPACTION_RESERVE_TOKENS_FLOOR = 20_000;
99

src/agents/agent-tools.policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
12
import { getLoadedChannelPlugin } from "../channels/plugins/index.js";
23
import { resolveSessionConversation } from "../channels/plugins/session-conversation.js";
34
import { DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH } from "../config/agent-limits.js";
@@ -21,7 +22,6 @@ import {
2122
import { normalizeMessageChannel } from "../utils/message-channel.js";
2223
import { resolveAgentConfig, resolveAgentIdFromSessionKey } from "./agent-scope.js";
2324
import type { AnyAgentTool } from "./agent-tools.types.js";
24-
import { normalizeProviderId } from "./provider-id.js";
2525
import { pickSandboxToolPolicy } from "./sandbox-tool-policy.js";
2626
import type { SandboxToolPolicy } from "./sandbox.js";
2727
import {

src/agents/auth-health.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import {
2+
findNormalizedProviderValue,
3+
normalizeProviderId,
4+
} from "@openclaw/model-catalog-core/provider-id";
15
import type { OpenClawConfig } from "../config/types.openclaw.js";
26
import { normalizeUniqueStringEntries } from "../shared/string-normalization.js";
37
import {
@@ -11,7 +15,6 @@ import { resolveEffectiveOAuthCredential } from "./auth-profiles/effective-oauth
1115
import { resolveAuthProfileOrder } from "./auth-profiles/order.js";
1216
import type { AuthProfileCredential, AuthProfileStore } from "./auth-profiles/types.js";
1317
import { resolveProviderIdForAuth } from "./provider-auth-aliases.js";
14-
import { findNormalizedProviderValue, normalizeProviderId } from "./provider-id.js";
1518

1619
type AuthProfileSource = "store";
1720

src/agents/auth-profiles/doctor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
12
import type { OpenClawConfig } from "../../config/types.openclaw.js";
23
import { buildProviderAuthDoctorHintWithPlugin } from "../../plugins/provider-runtime.runtime.js";
3-
import { normalizeProviderId } from "../provider-id.js";
44
import type { AuthProfileStore } from "./types.js";
55

66
const QWEN_PORTAL_OAUTH_MIGRATION_HINT =

src/agents/auth-profiles/external-cli-auth-selection.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import {
2+
findNormalizedProviderValue,
3+
normalizeProviderId,
4+
} from "@openclaw/model-catalog-core/provider-id";
15
import type { OpenClawConfig } from "../../config/types.openclaw.js";
26
import { resolveCliRuntimeExecutionProvider } from "../model-runtime-aliases.js";
37
import { resolveProviderIdForAuth } from "../provider-auth-aliases.js";
4-
import { findNormalizedProviderValue, normalizeProviderId } from "../provider-id.js";
58
import { CLAUDE_CLI_PROFILE_ID } from "./constants.js";
69
import type { AuthProfileStore } from "./types.js";
710

src/agents/auth-profiles/external-cli-scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
12
import {
23
resolveAgentModelFallbackValues,
34
resolveAgentModelPrimaryValue,
45
} from "../../config/model-input.js";
56
import type { AgentModelConfig } from "../../config/types.agents-shared.js";
67
import type { OpenClawConfig } from "../../config/types.openclaw.js";
7-
import { normalizeProviderId } from "../provider-id.js";
88

99
export type ExternalCliAuthScope = {
1010
providerIds: string[];

src/agents/auth-profiles/external-cli-sync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
12
import {
23
readClaudeCliCredentialsCached,
34
readCodexCliCredentialsCached,
45
readMiniMaxCliCredentialsCached,
56
} from "../cli-credentials.js";
6-
import { normalizeProviderId } from "../provider-id.js";
77
import {
88
CLAUDE_CLI_PROFILE_ID,
99
EXTERNAL_CLI_SYNC_TTL_MS,

src/agents/auth-profiles/oauth-refresh-failure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
12
import { sanitizeForLog } from "../../../packages/terminal-core/src/ansi.js";
23
import { formatCliCommand } from "../../cli/command-format.js";
3-
import { normalizeProviderId } from "../provider-id.js";
44

55
export type OAuthRefreshFailureReason =
66
| "refresh_token_reused"

0 commit comments

Comments
 (0)