Expose Claude Sonnet 5 in Pi catalog#118
Open
nodnarbnitram wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Confidence score: 5/5
- Safe to merge after the addressed issues were fixed.
Architecture diagram
sequenceDiagram
participant Ext as Extension Entrypoint
participant Pi as Pi ExtensionAPI
participant Catalog as Provider Catalog
participant User as Pi CLI / User
Note over Ext,User: NEW: Sonnet 5 registration flow
Pi->>Ext: load extension (cortexKitPiAnthropicAuth)
Ext->>Pi: registerProvider('anthropic', { models, oauth, ... })
Note over Ext,Pi: models array now includes claude-sonnet-5 entry
Pi->>Catalog: store provider config with model list
Catalog-->>Pi: acknowledged
Note over User,Catalog: Model discoverability (after registration)
User->>Pi: --list-models or model lookup
Pi->>Catalog: query anthropic models
Catalog-->>Pi: models including claude-sonnet-5
Pi-->>User: claude-sonnet-5 listed with 1M context, 128K max
alt Previously (without PR addition)
Note over Ext,Pi: Models array omitted claude-sonnet-5
User->>Pi: --list-models
Pi-->>User: claude-sonnet-5 not visible (hidden by native catalog replacement)
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
8a973c1 to
ea16ed6
Compare
Author
|
Your extension is drawing from overage and not quota on Pi. so I guess this work I did was for nothing. Best of luck. I hope it at least helps you some how 🤷♂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude-sonnet-5to the Pi provider catalog registered by@cortexkit/pi-anthropic-authWhy
PR #100 added Sonnet 5 request shaping and noted that
claude-sonnet-5is in Pi's native model catalog. The Pi package currently passes amodelsarray topi.registerProvider('anthropic', ...), which replaces Pi's native Anthropic catalog, so the native Sonnet 5 entry is hidden after this extension loads.I checked whether omitting
modelswhile keeping the CortexKit providerapiwould preserve native models and still route through the CortexKit transport. A local dummy provider test showed native models keep theiranthropic-messagesAPI and bypass the replacementstreamSimple, so this PR uses the smaller catalog fix instead of changing the provider override architecture.Testing
bun run --cwd packages/core build && bun run --cwd packages/pi test && bun run test && bun run typecheckbunx biome check .pi --no-extensions -e packages/pi/dist/index.js --list-models claude-sonnet-5Local Pi output includes:
Greptile Summary
This PR makes
claude-sonnet-5discoverable in the Pi provider catalog. Because the extension passes an explicitmodelsarray topi.registerProvider, Pi's native Anthropic catalog is replaced entirely, hiding any native Sonnet 5 entry — this change adds it back. The underlying request-shaping support (isClaudeSonnet5Model,CLAUDE_SONNET_5_ADAPTIVE_THINKING,output_configeffort routing) was already wired inconvert.tsfrom PR #100.packages/pi/src/index.ts: Adds aclaude-sonnet-5catalog entry with a 1M-token context window, 128K max output,reasoning: true, and introductory pricing ($2/$10 input/output through August 31, 2026). Cache and spec values match Anthropic's published figures.packages/pi/src/tests/index.test.ts: New regression test that mounts a minimalExtensionAPImock, calls the extension, and asserts every field on the Sonnet 5 catalog entry — ensuring future model additions cannot silently drop discoverability.packages/pi/README.md: Catalog sentence updated to list Sonnet 5 alongside the existing models.Confidence Score: 5/5
Safe to merge — the change is a targeted catalog addition backed by request-shaping logic that was already in place, and a regression test validates all catalog fields.
The diff is minimal and focused: one model entry in the catalog, one README sentence, and one new test. The convert.ts layer that handles Sonnet 5 adaptive thinking and output_config routing was already merged; this PR only makes the model visible. All pricing and spec values match Anthropic's published figures.
No files require special attention. The introductory pricing expiration in packages/pi/src/index.ts (and the mirrored assertion in the test) is worth tracking for a follow-up update before September 1, 2026.
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Pi as Pi Agent participant Ext as cortexKitPiAnthropicAuth participant Core as @cortexkit/anthropic-auth-core participant API as Anthropic API Pi->>Ext: load extension (ExtensionAPI) Ext->>Pi: "registerProvider('anthropic', { models: [..., claude-sonnet-5], api, oauth, streamSimple })" Note over Pi: Pi catalog now includes claude-sonnet-5 Pi->>Ext: "streamSimple(model=claude-sonnet-5, context, options)" Ext->>Core: isClaudeSonnet5Model(modelId) → true Core-->>Ext: "body.thinking = CLAUDE_SONNET_5_ADAPTIVE_THINKING" Core-->>Ext: "body.output_config = { effort: options.reasoning }" Ext->>API: POST /v1/messages (signed, with adaptive thinking) API-->>Ext: SSE stream Ext-->>Pi: AssistantMessageEventStream%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Pi as Pi Agent participant Ext as cortexKitPiAnthropicAuth participant Core as @cortexkit/anthropic-auth-core participant API as Anthropic API Pi->>Ext: load extension (ExtensionAPI) Ext->>Pi: "registerProvider('anthropic', { models: [..., claude-sonnet-5], api, oauth, streamSimple })" Note over Pi: Pi catalog now includes claude-sonnet-5 Pi->>Ext: "streamSimple(model=claude-sonnet-5, context, options)" Ext->>Core: isClaudeSonnet5Model(modelId) → true Core-->>Ext: "body.thinking = CLAUDE_SONNET_5_ADAPTIVE_THINKING" Core-->>Ext: "body.output_config = { effort: options.reasoning }" Ext->>API: POST /v1/messages (signed, with adaptive thinking) API-->>Ext: SSE stream Ext-->>Pi: AssistantMessageEventStreamReviews (3): Last reviewed commit: "Assert Sonnet 5 pricing in Pi catalog te..." | Re-trigger Greptile