fix(openrouter): reuse shared replay hooks

This commit is contained in:
Vincent Koc
2026-04-14 16:15:22 +01:00
parent 3487e7f8e2
commit 3f8c6dd341

View File

@@ -9,7 +9,6 @@ import {
DEFAULT_CONTEXT_TOKENS,
} from "openclaw/plugin-sdk/provider-model-shared";
import {
buildProviderStreamFamilyHooks,
getOpenRouterModelCapabilities,
loadOpenRouterModelCapabilities,
} from "openclaw/plugin-sdk/provider-stream-family";
@@ -27,16 +26,15 @@ const OPENROUTER_CACHE_TTL_MODEL_PREFIXES = [
"moonshotai/",
"zai/",
] as const;
const PASSTHROUGH_GEMINI_REPLAY_HOOKS = buildProviderReplayFamilyHooks({
family: "passthrough-gemini",
});
export default definePluginEntry({
id: "openrouter",
name: "OpenRouter Provider",
description: "Bundled OpenRouter provider plugin",
register(api) {
const PASSTHROUGH_GEMINI_REPLAY_HOOKS = buildProviderReplayFamilyHooks({
family: "passthrough-gemini",
});
const _OPENROUTER_THINKING_STREAM_HOOKS = buildProviderStreamFamilyHooks("openrouter-thinking");
function buildDynamicOpenRouterModel(
ctx: ProviderResolveDynamicModelContext,
): ProviderRuntimeModel {