Skip to content

fix(usage): route usage readings through the assigned connection proxy - #16773

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/usage-readers-connection-proxy
Oct 16, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/usage-readers-connection-proxy

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #15306

Summary

Quota reads leave the server directly even when the connection has a proxy assigned, because the dispatcher doesn't pass the connection id down to the readers. The nine covered readers now send their vendor requests through the assigned proxy, while connections without one keep the same direct reads.

Related Issues

Target Branch

  • Base is the active release/v3.8.x branch (the highest open release/v*), not main
  • New feature? From 3.8.55 on it is held with the v4-feature label for the v4 channel

Validation

  • Change type: provider
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/usage-connection-proxy.test.ts — conol reads through an assigned proxy, unchanged direct reads without one, proxied failure surfacing as the existing message, and a static guard that fails on any reintroduced bare fetch.

Coverage Notes

  • open-sse/services/usage.ts — tests/unit/usage-connection-proxy.test.ts (conol path through the dispatcher).
  • open-sse/services/connectionProxyFetch.ts — tests/unit/usage-connection-proxy.test.ts (proxy, no-proxy, and failure cases).
  • open-sse/services/conolUsage.ts — tests/unit/usage-connection-proxy.test.ts (proxy, direct, and failure cases).
  • open-sse/services/usage/github.ts — tests/unit/usage-connection-proxy.test.ts (static guard).
  • open-sse/services/usage/claude.ts — tests/unit/usage-connection-proxy.test.ts (static guard).
  • open-sse/services/usage/codex.ts — tests/unit/usage-connection-proxy.test.ts (static guard).
  • open-sse/services/usage/cursor.ts — tests/unit/usage-connection-proxy.test.ts (static guard).
  • open-sse/services/usage/syntx.ts — tests/unit/usage-connection-proxy.test.ts (static guard).
  • open-sse/services/usage/devinCli.ts — tests/unit/usage-connection-proxy.test.ts (static guard).
  • open-sse/services/usage/chatplayground.ts — tests/unit/usage-connection-proxy.test.ts (static guard).
  • open-sse/services/usage/command-code.ts — tests/unit/usage-connection-proxy.test.ts (static guard).

Reviewer Notes

@maxmad64bis
maxmad64bis force-pushed the fix/usage-readers-connection-proxy branch from ec69b37 to 1f25d6f Compare October 15, 2026 21:00
@maxmad64bis
maxmad64bis marked this pull request as ready for review October 15, 2026 21:18
diegosouzapw pushed a commit that referenced this pull request Oct 16, 2026
Local board on origin/release/v3.8.52 (ad37e8f) in `.claude/worktrees/maxmad-wave2`, together with #16759, #16760, #16769, #16773, #16786, and #16793. The combined tree passed `check-file-size` and `check-changelog-integrity`.

The health matrix leaves idle models out of the default payload and still counts them in `omittedIdleModelCount`. `includeIdleModels=true` brings the lines back. Focused file: `provider-health-matrix.test.ts`.

⚠️ base-red inherited: #15306

Thank you @maxmad64bis.
@diegosouzapw
diegosouzapw merged commit 17019c4 into diegosouzapw:release/v3.8.52 Oct 16, 2026
42 of 58 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.

2 participants