mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 02:40:18 +00:00
Tests: cover explicit Anthropic service tiers
This commit is contained in:
@@ -1734,6 +1734,63 @@ describe("applyExtraParamsToAgent", () => {
|
|||||||
expect(payload.service_tier).toBe("standard_only");
|
expect(payload.service_tier).toBe("standard_only");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("injects configured Anthropic service_tier into direct Anthropic payloads", () => {
|
||||||
|
const payload = runResponsesPayloadMutationCase({
|
||||||
|
applyProvider: "anthropic",
|
||||||
|
applyModelId: "claude-sonnet-4-5",
|
||||||
|
cfg: {
|
||||||
|
agents: {
|
||||||
|
defaults: {
|
||||||
|
models: {
|
||||||
|
"anthropic/claude-sonnet-4-5": {
|
||||||
|
params: {
|
||||||
|
serviceTier: "standard_only",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
model: {
|
||||||
|
api: "anthropic-messages",
|
||||||
|
provider: "anthropic",
|
||||||
|
id: "claude-sonnet-4-5",
|
||||||
|
baseUrl: "https://api.anthropic.com",
|
||||||
|
} as unknown as Model<"anthropic-messages">,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
expect(payload.service_tier).toBe("standard_only");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("lets explicit Anthropic service_tier override fast mode defaults", () => {
|
||||||
|
const payload = runResponsesPayloadMutationCase({
|
||||||
|
applyProvider: "anthropic",
|
||||||
|
applyModelId: "claude-sonnet-4-5",
|
||||||
|
cfg: {
|
||||||
|
agents: {
|
||||||
|
defaults: {
|
||||||
|
models: {
|
||||||
|
"anthropic/claude-sonnet-4-5": {
|
||||||
|
params: {
|
||||||
|
fastMode: true,
|
||||||
|
serviceTier: "standard_only",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
model: {
|
||||||
|
api: "anthropic-messages",
|
||||||
|
provider: "anthropic",
|
||||||
|
id: "claude-sonnet-4-5",
|
||||||
|
baseUrl: "https://api.anthropic.com",
|
||||||
|
} as unknown as Model<"anthropic-messages">,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
expect(payload.service_tier).toBe("standard_only");
|
||||||
|
});
|
||||||
|
|
||||||
it("does not inject Anthropic fast mode service_tier for OAuth auth", () => {
|
it("does not inject Anthropic fast mode service_tier for OAuth auth", () => {
|
||||||
const payload = runResponsesPayloadMutationCase({
|
const payload = runResponsesPayloadMutationCase({
|
||||||
applyProvider: "anthropic",
|
applyProvider: "anthropic",
|
||||||
|
|||||||
Reference in New Issue
Block a user