Skip to content

Fix stale Claude Sonnet 5 margin pricing; bump posthog-node - #803

Merged
MikeyPetrillo merged 2 commits into
mainfrom
claude/sweet-brown-i99jl3
Aug 17, 2026
Merged

Fix stale Claude Sonnet 5 margin pricing; bump posthog-node#803
MikeyPetrillo merged 2 commits into
mainfrom
claude/sweet-brown-i99jl3

Conversation

@MikeyPetrillo

Copy link
Copy Markdown
Owner

Summary

  • Claude Sonnet 5 pricing fix: MODEL_COST priced claude-sonnet-5 at 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 clamping max_tokens more aggressively than necessary on every Sonnet 5 gateway call for an increase that's no longer coming.
  • posthog-node bump 5.48.1 → 5.49.1: picks up 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.

Test plan

  • test-llm-gateway.js 232/232 passing post-fix
  • test-pricing-margin.js 100/100 passing, margin table shows healthy +13% to +55% across every tier, with google/gemini-2.5-pro (not sonnet) now the pro-tier worst case — confirms sonnet is no longer the pricing bottleneck
  • test-posthog-funnel.js 53/53 passing on the new posthog-node version
  • CI green, merge

🤖 Generated with Claude Code

…-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>
@socket-security

socket-security Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​posthog-node@​5.48.1 ⏵ 5.49.192 +110079 +1100100

View full report

@MikeyPetrillo
MikeyPetrillo deployed to agent402 / production August 17, 2026 03:49 — with GitHub Actions Active
@railway-app
railway-app Bot temporarily deployed to agent402 / production August 17, 2026 03:49 Inactive
@MikeyPetrillo
MikeyPetrillo marked this pull request as ready for review August 17, 2026 04:23
@MikeyPetrillo
MikeyPetrillo merged commit b1c4aee into main Aug 17, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant