Fix stale Claude Sonnet 5 margin pricing; bump posthog-node - #803
Merged
Conversation
…-node MODEL_COST priced claude-sonnet-5 at an anticipated STANDARD $3/$15, deliberately guarding against a scheduled 2026-09-01 price increase from the $2/$10 intro rate. Anthropic cancelled that increase on 2026-08-10 and made $2/$10 the permanent standard price (confirmed against Anthropic's own release notes, not just OpenRouter's current listing). The old pricing wasn't a margin-loss bug - it's the safe direction - but it was clamping max_tokens more aggressively than necessary on every Sonnet 5 call through the gateway, for a price increase that is no longer coming. posthog-node bumped 5.48.1 -> 5.49.1, picking up several backend- relevant fixes landed since our pinned version: a shutdown() fix (logs timeouts instead of throwing - relevant given the drain-window logic on Railway), a gzip payload compression memory-growth fix, an identify() correctness fix, and a raised default maxQueueSize tuned for backend workloads. Verified: test-llm-gateway.js (232/232) and test-pricing-margin.js (100/100) pass clean post-fix, margin table shows healthy +13% to +55% across every tier with google/gemini-2.5-pro (not sonnet) now the pro-tier worst case, confirming sonnet is no longer the pricing bottleneck. test-posthog-funnel.js (53/53) passes clean on the new posthog-node version. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
MikeyPetrillo
marked this pull request as ready for review
August 17, 2026 04:23
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
MODEL_COSTpricedclaude-sonnet-5at an anticipated STANDARD $3/$15, guarding against a scheduled 2026-09-01 price increase. Anthropic cancelled that increase on 2026-08-10 and made $2/$10 the permanent standard price — confirmed directly against Anthropic's own release notes (not just OpenRouter's current listing, which reads identically either way until 09-01). Not a margin-loss bug (the old price was the safe direction), but it was clampingmax_tokensmore aggressively than necessary on every Sonnet 5 gateway call for an increase that's no longer coming.shutdown()fix (logs timeouts instead of throwing — relevant given the drain-window logic on Railway), a gzip payload compression memory-growth fix, anidentify()correctness fix, and a raised defaultmaxQueueSizetuned for backend workloads.Test plan
test-llm-gateway.js232/232 passing post-fixtest-pricing-margin.js100/100 passing, margin table shows healthy +13% to +55% across every tier, withgoogle/gemini-2.5-pro(not sonnet) now the pro-tier worst case — confirms sonnet is no longer the pricing bottlenecktest-posthog-funnel.js53/53 passing on the new posthog-node version🤖 Generated with Claude Code