Merge PR #7473: fix(catalog): use live Copilot default-tier prices (@roboomp)

This commit is contained in:
can1357
2026-08-03 14:46:23 +02:00
3 changed files with 28 additions and 0 deletions
+1
View File
@@ -5,6 +5,7 @@
### Fixed
- Fixed `deepseek-v4` family models (e.g. `deepseek-v4-flash-0731`) discovered dynamically by `alibaba-token-plan` missing reasoning configuration and the `max` thinking effort.
- Fixed GitHub Copilot dynamic discovery retaining stale bundled prices for default-context models instead of using the provider's reported default-tier prices ([#7471](https://github.com/can1357/oh-my-pi/issues/7471)).
## [17.2.5] - 2026-08-03
@@ -5183,6 +5183,11 @@ export function githubCopilotModelManagerOptions(config?: GithubCopilotModelMana
}
: {}),
};
const defaultCost = copilotTierCost(tokenPrices.defaultTier);
if (defaultCost) {
// Cache writes are not reported per tier; retain the bundled provider rate.
base.cost = { ...defaultCost, cacheWrite: base.cost.cacheWrite };
}
const variant = createCopilotLongContextVariant(
base,
contextWindow,
@@ -545,6 +545,28 @@ describe("github copilot tiered context windows", () => {
expect(variant?.cost).toEqual({ input: 4, output: 18, cacheRead: 0.4, cacheWrite: 0 });
});
it("prices the base model from its default tier", async () => {
const { models } = await discoverCopilotModels({
data: [
tieredCopilotEntry({
id: "gpt-5.6-luna",
name: "GPT-5.6 Luna",
window: 1_050_000,
maxOutput: 50_000,
defaultContextMax: 200_000,
longContextMax: 1_000_000,
defaultPrices: { input: 20, output: 120, cache: 2 },
longPrices: { input: 40, output: 180, cache: 4 },
}),
],
});
const base = models.find(candidate => candidate.id === "gpt-5.6-luna");
expect(base?.cost).toMatchObject({ input: 0.2, output: 1.2, cacheRead: 0.02 });
const variant = models.find(candidate => candidate.id === "gpt-5.6-luna-1m");
expect(variant?.cost).toMatchObject({ input: 0.4, output: 1.8, cacheRead: 0.04 });
});
it("keeps legacy tier-capped responses unchanged and synthesizes no variant", async () => {
const { models } = await discoverCopilotModels({
data: [