style: normalize provider formatting

This commit is contained in:
Peter Steinberger
2026-04-04 23:25:20 +09:00
parent 1ca1ce85ee
commit a4fc1200de
5 changed files with 9 additions and 9 deletions

View File

@@ -23,9 +23,7 @@ import {
normalizeAnthropicProviderConfig,
} from "./config-defaults.js";
import { buildAnthropicReplayPolicy } from "./replay-policy.js";
import {
wrapAnthropicProviderStream,
} from "./stream-wrappers.js";
import { wrapAnthropicProviderStream } from "./stream-wrappers.js";
const PROVIDER_ID = "anthropic";
const DEFAULT_ANTHROPIC_MODEL = "anthropic/claude-sonnet-4-6";

View File

@@ -210,7 +210,9 @@ export function resolveAnthropicServiceTier(
return normalized;
}
export function wrapAnthropicProviderStream(ctx: ProviderWrapStreamFnContext): StreamFn | undefined {
export function wrapAnthropicProviderStream(
ctx: ProviderWrapStreamFnContext,
): StreamFn | undefined {
const anthropicBetas = resolveAnthropicBetas(ctx.extraParams, ctx.modelId);
const serviceTier = resolveAnthropicServiceTier(ctx.extraParams);
const fastMode = resolveAnthropicFastMode(ctx.extraParams);

View File

@@ -1,12 +1,12 @@
import type { StreamFn } from "@mariozechner/pi-agent-core";
import { streamSimple } from "@mariozechner/pi-ai";
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
import {
applyAnthropicEphemeralCacheControlMarkers,
buildCopilotDynamicHeaders,
hasCopilotVisionInput,
streamWithPayloadPatch,
} from "openclaw/plugin-sdk/provider-stream";
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
type StreamContext = Parameters<StreamFn>[1];

View File

@@ -15,9 +15,7 @@ import { buildXaiProvider } from "./provider-catalog.js";
import { isModernXaiModel, resolveXaiForwardCompatModel } from "./provider-models.js";
import { resolveFallbackXaiAuth } from "./src/tool-auth-shared.js";
import { resolveEffectiveXSearchConfig } from "./src/x-search-config.js";
import {
wrapXaiProviderStream,
} from "./stream.js";
import { wrapXaiProviderStream } from "./stream.js";
import { createXaiWebSearchProvider } from "./web-search.js";
const PROVIDER_ID = "xai";

View File

@@ -97,7 +97,9 @@ describe("buildProviderReplayFamilyHooks", () => {
expect(hooks.buildReplayPolicy?.(testCase.ctx as never)).toMatchObject(testCase.match);
expect(Boolean(hooks.sanitizeReplayHistory)).toBe(testCase.hasSanitizeReplayHistory);
expect(hooks.resolveReasoningOutputMode?.(testCase.ctx as never)).toBe(testCase.reasoningMode);
expect(hooks.resolveReasoningOutputMode?.(testCase.ctx as never)).toBe(
testCase.reasoningMode,
);
}
});