feat(claude-cli): add Claude Opus 4.7 to the provider model list
The pinned @mariozechner/pi-ai catalog tops out at Opus 4.6 / Sonnet 4.6 / Haiku 4.5. Append a Claude Opus 4.7 entry (1M ctx, 128k max out, $5/$25 per MTok) with id-dedupe so it becomes a no-op once the upstream catalog catches up. Sonnet 4.6 and Haiku 4.5 remain current per https://platform.claude.com/docs/en/about-claude/models/overview and are already in the catalog, so no other additions are needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,7 @@ export default function (pi: ExtensionAPI) {
|
||||
validateCliPresence(); // throws if CLI not on PATH
|
||||
validateCliAuth(); // warns if not authenticated
|
||||
|
||||
const models = getModels("anthropic").map((model) => ({
|
||||
const catalogModels = getModels("anthropic").map((model) => ({
|
||||
id: model.id,
|
||||
name: model.name,
|
||||
reasoning: model.reasoning,
|
||||
@@ -81,6 +81,28 @@ export default function (pi: ExtensionAPI) {
|
||||
maxTokens: model.maxTokens,
|
||||
}));
|
||||
|
||||
// Newer models released after the pinned @mariozechner/pi-ai catalog
|
||||
// was generated. Dedupe by id so this list is harmless once the upstream
|
||||
// catalog catches up.
|
||||
// https://platform.claude.com/docs/en/about-claude/models/overview
|
||||
const extraModels: typeof catalogModels = [
|
||||
{
|
||||
id: "claude-opus-4-7",
|
||||
name: "Claude Opus 4.7",
|
||||
reasoning: true,
|
||||
input: ["text", "image"],
|
||||
cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
|
||||
contextWindow: 1_000_000,
|
||||
maxTokens: 128_000,
|
||||
},
|
||||
];
|
||||
|
||||
const seen = new Set(catalogModels.map((m) => m.id));
|
||||
const models = [
|
||||
...catalogModels,
|
||||
...extraModels.filter((m) => !seen.has(m.id)),
|
||||
];
|
||||
|
||||
// Ensure all registered tools are active so pi can execute them.
|
||||
// Some tools (find, grep, ls) are registered but not activated by default.
|
||||
pi.on("session_start", async () => {
|
||||
|
||||
Reference in New Issue
Block a user