mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
Repairs a batch of narrow model/provider edge cases:
- honor OpenAI and Anthropic base URL environment overrides when provider config does not set an explicit base URL
- preserve OpenRouter Anthropic cache retention while stripping unsupported transport options
- allow apply_patch for non-OpenAI providers when the tool config otherwise permits it
- prune stale same-provider model selections from configure/model picker state
- expose GitHub Copilot bundled thinking policy metadata to offline/provider-policy lookups
- repair additive SQLite shared-state upgrades for existing databases
- keep same-size rotated log readers from reusing stale content in CI tooling
Proof:
- GitHub PR checks green on exact head 46514909b0
- Crabbox delegated Blacksmith Testbox tbx_01kt3em5r9vd7g0bnykrff6jdk exited 0
- Focused local Vitest/oxlint/format proof recorded in PR body and land-ready comment
Fixes #80347.
Fixes #88357.
Fixes #45269.
Supersedes #74427, #74432, #79370, #79894, #80366, and #88359.
63 lines
1.9 KiB
TypeScript
63 lines
1.9 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveThinkingProfile } from "./provider-policy-api.js";
|
|
|
|
describe("github-copilot provider-policy-api", () => {
|
|
it("returns the base level set for non-xhigh GitHub Copilot models", () => {
|
|
expect(
|
|
resolveThinkingProfile({
|
|
provider: "github-copilot",
|
|
modelId: "claude-opus-4.6",
|
|
})?.levels.map((level) => level.id),
|
|
).toEqual(["off", "minimal", "low", "medium", "high"]);
|
|
});
|
|
|
|
it("appends xhigh for current static GPT Copilot xhigh ids", () => {
|
|
for (const modelId of ["gpt-5.4", "gpt-5.3-codex"]) {
|
|
expect(
|
|
resolveThinkingProfile({
|
|
provider: "github-copilot",
|
|
modelId,
|
|
})?.levels.map((level) => level.id),
|
|
`model=${modelId}`,
|
|
).toContain("xhigh");
|
|
}
|
|
});
|
|
|
|
it("appends xhigh when catalog compat advertises it", () => {
|
|
expect(
|
|
resolveThinkingProfile({
|
|
provider: "github-copilot",
|
|
modelId: "future-copilot-model",
|
|
compat: { supportedReasoningEfforts: ["low", "medium", "high", "xhigh"] },
|
|
})?.levels.map((level) => level.id),
|
|
).toContain("xhigh");
|
|
});
|
|
|
|
it("appends xhigh for static Copilot metadata overrides", () => {
|
|
expect(
|
|
resolveThinkingProfile({
|
|
provider: "github-copilot",
|
|
modelId: "claude-opus-4.7-1m-internal",
|
|
})?.levels.map((level) => level.id),
|
|
).toContain("xhigh");
|
|
});
|
|
|
|
it("normalizes the model id casing before xhigh membership checks", () => {
|
|
expect(
|
|
resolveThinkingProfile({
|
|
provider: "github-copilot",
|
|
modelId: "GPT-5.4",
|
|
})?.levels.map((level) => level.id),
|
|
).toContain("xhigh");
|
|
});
|
|
|
|
it("returns null for non-GitHub Copilot providers", () => {
|
|
expect(
|
|
resolveThinkingProfile({
|
|
provider: "openai",
|
|
modelId: "gpt-5.4",
|
|
}),
|
|
).toBeNull();
|
|
});
|
|
});
|