Skip to content

fix(proxy): make account admission opt-in - #1265

Merged
murdore merged 1 commit into
releasefrom
fix/proxy-unlimited-admission
Aug 4, 2026
Merged

murdore merged 1 commit into
releasefrom
fix/proxy-unlimited-admission

Conversation

@murdore

@murdore murdore commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • remove the implicit per-account admission cap of two
  • bypass admission queues when routing.max-inflight-per-account is omitted
  • retain explicit bounded admission for values 1 through 20
  • document and test unlimited-by-default semantics

Verification

  • pnpm exec vitest run test/proxyReliabilityHardening.test.ts test/proxyConfigHotReload.test.ts
  • pnpm exec tsc --noEmit --strict --project tsconfig.cli.json
  • pnpm run build:cli
  • pnpm run test:bugfixes
  • pnpm exec prettier --check ...
  • git diff --check

The pre-commit hook could not complete because the repository is missing the unrelated optional package landing/@sveltejs/adapter-vercel; the listed targeted and build checks passed.

Summary by CodeRabbit

  • New Features
    • Account admission limits are now optional. When omitted, requests proceed without an inflight limit.
    • Valid limits from 1–20 are supported for controlled request concurrency.
  • Bug Fixes
    • Invalid admission-limit values no longer get clamped unexpectedly; they are treated as unlimited and reported with a warning.
    • Routed requests no longer queue when no valid account limit is configured.
  • Documentation
    • Updated proxy configuration references to describe the new optional limit behavior and validation rules.

Copilot AI review requested due to automatic review settings August 3, 2026 06:02
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 149ba8c5-2ff8-44f0-b8e9-e6339420f22c

📥 Commits

Reviewing files that changed from the base of the PR and between 7739f15 and c4bcb75.

📒 Files selected for processing (7)
  • docs/features/claude-proxy-config-reference.md
  • src/lib/proxy/modelRouter.ts
  • src/lib/server/routes/claudeProxyRoutes.ts
  • src/lib/types/proxy.ts
  • src/lib/types/subscription.ts
  • test/continuous-test-suite-bugfixes.ts
  • test/proxyConfigHotReload.test.ts

📝 Walkthrough

Walkthrough

This PR changes per-account admission capacity handling in the Claude proxy. maxInflightPerAccount is now optional. Omitted or invalid values (non-integer, or outside 1–20) normalize to undefined and result in unlimited admission instead of a default of 2. Admission logic, routing, docs, and tests are updated to match.

Changes

Optional account admission capacity

Layer / File(s) Summary
Optional capacity contract
src/lib/proxy/modelRouter.ts, src/lib/types/proxy.ts, src/lib/types/subscription.ts, docs/features/claude-proxy-config-reference.md, test/proxyConfigHotReload.test.ts
Adds exported normalizeMaxInflightPerAccount that accepts only integers from 1–20, converting other values to undefined. Removes the DEFAULT_MAX_INFLIGHT_PER_ACCOUNT constant. getMaxInflightPerAccount and the interface now return number | undefined. Documentation and hot-reload test assertions are updated to describe unlimited admission when the cap is omitted.
Uncapped admission handling
src/lib/server/routes/claudeProxyRoutes.ts, test/continuous-test-suite-bugfixes.ts
Admission acquisition and availability checks return an unlimited no-op lease when capacity is absent or invalid. Queued admission throws before creating state when capacity is invalid. Test hooks expose enqueueAccountAdmission and hasAccountAdmissionState. New regression tests cover unlimited defaults, invalid-cap normalization, valid caps, and cleanup after rejected capacity.
Routed request capacity wiring
src/lib/server/routes/claudeProxyRoutes.ts
Routed requests no longer apply an implicit default capacity; queueing occurs only when the model router supplies an explicit capacity.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ModelRouter
  participant claudeProxyRoutes
  participant AccountAdmission
  ModelRouter->>claudeProxyRoutes: provide optional maxInflightPerAccount
  claudeProxyRoutes->>AccountAdmission: acquire admission
  AccountAdmission-->>claudeProxyRoutes: return unlimited lease or capped lease
Loading

Possibly related PRs

  • juspay/neurolink#1252: Modifies the same ModelRouter admission-limit logic, proxy route admission handling, and related tests that this PR refines.

Suggested reviewers: tara-ag

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: making proxy account admission opt-in.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/proxy-unlimited-admission

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/lib/proxy/modelRouter.ts

Parsing error: Unable to parse the specified 'tsconfig' file. Ensure it's correct and has valid syntax.

error TS5012: Cannot read file '/.svelte-kit/tsconfig.json': ENOENT: no such file or directory, open '/.svelte-kit/tsconfig.json'.

src/lib/server/routes/claudeProxyRoutes.ts

Parsing error: Unable to parse the specified 'tsconfig' file. Ensure it's correct and has valid syntax.

error TS5012: Cannot read file '/.svelte-kit/tsconfig.json': ENOENT: no such file or directory, open '/.svelte-kit/tsconfig.json'.

src/lib/types/proxy.ts

Parsing error: Unable to parse the specified 'tsconfig' file. Ensure it's correct and has valid syntax.

error TS5012: Cannot read file '/.svelte-kit/tsconfig.json': ENOENT: no such file or directory, open '/.svelte-kit/tsconfig.json'.

  • 1 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Single Commit Policy - COMPLIANT

Status: Policy requirements met • 1 commit • Valid format • Ready for merge

📊 View validation details

📝 Commit Details

  • Hash: c4bcb75c3335f0802dbd554368beb45ea0ed6060
  • Message: fix(proxy): make account admission opt-in
  • Author: Sachin Sharma

✅ Validation Results

  • Single commit requirement met
  • No merge commits in branch
  • Semantic commit message format verified
  • Ready for squash merge to release branch

🤖 Automated validation by NeuroLink Single Commit Enforcement

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@github-actions

github-actions Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Validation Results

🚀 Documentation validation passed!

Check Status Result
Frontmatter Validation ✅ Passed
TypeScript Check ✅ Passed
Build ✅ Passed
Link Validation ✅ Passed

📦 Build artifact uploaded successfully. Ready for deployment preview.

Commit: 904a195fa6600ac84c04c028400c2ecf7890d16f | Workflow: View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes per-account admission limiting in the Claude proxy explicitly opt-in by removing the implicit default cap of 2 in-flight requests per OAuth account. It updates routing/config behavior so that omitting routing.max-inflight-per-account results in unlimited admission (no queue), while still supporting bounded admission for explicit values 1..20, with corresponding docs and tests.

Changes:

  • Remove the implicit default per-account admission cap (2) and treat an omitted cap as unlimited admission.
  • Update Claude proxy routing logic to only enqueue/wait when an explicit cap is configured.
  • Add/adjust tests and documentation to cover and describe the new “unlimited-by-default when omitted” behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/proxyReliabilityHardening.test.ts Adds a regression test asserting no admission queue/state is created when no cap is configured.
test/proxyConfigHotReload.test.ts Adds/updates tests to confirm the router reports undefined when the cap is omitted and hot reload preserves the new semantics.
src/lib/types/subscription.ts Updates routing config type docs to describe opt-in admission caps and unlimited-by-default when omitted.
src/lib/types/proxy.ts Widens ModelRouterInterface.getMaxInflightPerAccount return type to include undefined for unlimited admission.
src/lib/server/routes/claudeProxyRoutes.ts Implements unlimited admission when cap is omitted and gates queueing behavior on explicit capacity presence.
src/lib/proxy/modelRouter.ts Removes the default cap and stores maxInflightPerAccount as `number
docs/features/claude-proxy-config-reference.md Updates documentation and defaults table to reflect that max-inflight-per-account is optional and unlimited when omitted.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/proxy/modelRouter.ts`:
- Around line 17-24: Normalize config.maxInflightPerAccount in the ModelRouter
constructor using the same valid-capacity contract as
normalizeAccountAdmissionCapacity, mapping non-integer and out-of-range values
such as 0, 21, and 1.5 to undefined. Store the normalized result in
maxInflightPerAccount so getMaxInflightPerAccount and downstream admission logic
expose and reuse consistent behavior.

In `@src/lib/server/routes/claudeProxyRoutes.ts`:
- Around line 326-330: In the admission setup flow, normalize and validate
capacity before calling getAccountAdmissionState(accountKey), so invalid
capacity throws without creating a state entry. Keep the existing
explicit-capacity error and use the validated normalizedCapacity when
initializing the admission state.

In `@src/lib/types/subscription.ts`:
- Around line 1121-1122: Define invalid-capacity semantics consistently: update
maxInflightPerAccount in src/lib/types/subscription.ts (lines 1121-1122) to
state that out-of-range and non-integer values mean unlimited admission; update
the YAML example comments in docs/features/claude-proxy-config-reference.md
(lines 429-432) and the field reference (lines 553-561) with the same behavior.

In `@test/proxyConfigHotReload.test.ts`:
- Around line 64-72: Move the omitted maxInflightPerAccount admission test from
test/proxyConfigHotReload.test.ts:64-72 and the no-queue admission test from
test/proxyReliabilityHardening.test.ts:1438-1452 into the nearest continuous
suite. Remove both cases from their current Vitest test files and ensure the
relocated coverage runs through the required tsx harness.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 26e5fd33-683b-479c-8b7c-957907fd0f0b

📥 Commits

Reviewing files that changed from the base of the PR and between 746787c and 7739f15.

📒 Files selected for processing (7)
  • docs/features/claude-proxy-config-reference.md
  • src/lib/proxy/modelRouter.ts
  • src/lib/server/routes/claudeProxyRoutes.ts
  • src/lib/types/proxy.ts
  • src/lib/types/subscription.ts
  • test/proxyConfigHotReload.test.ts
  • test/proxyReliabilityHardening.test.ts

Comment thread src/lib/proxy/modelRouter.ts Outdated
Comment thread src/lib/server/routes/claudeProxyRoutes.ts Outdated
Comment thread src/lib/types/subscription.ts Outdated
Comment thread test/proxyConfigHotReload.test.ts Outdated
@murdore
murdore force-pushed the fix/proxy-unlimited-admission branch from 7739f15 to eaa1b16 Compare August 3, 2026 11:15
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@Tara-ag

Tara-ag commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Summary

Decision: APPROVED ✅

This PR successfully implements optional per-account admission limits for the Claude proxy. When max-inflight-per-account is omitted or invalid, requests bypass admission queues entirely (unlimited admission).

Changes Overview:

  1. modelRouter.ts: Made maxInflightPerAccount optional (removed default of 2)
  2. claudeProxyRoutes.ts: Updated admission logic to handle undefined capacity gracefully
  3. Types: Updated to reflect optional capacity field
  4. Tests: Added comprehensive tests for unlimited admission and invalid capacity handling
  5. Documentation: Updated config reference docs

Key Implementation Details:

  • Invalid/omitted capacity → undefined → unlimited admission (no queuing)
  • Valid capacity (1-20) → behaves exactly as before
  • Pre-validation prevents "stranded" map entries when rejecting invalid input
  • Hot reload correctly reflects configuration changes

Impact Analysis:

  • Affected flows: ~11 execution paths (account admission, request routing, quota ordering)
  • Risk score: Medium (0.65) - primarily due to new behavior path
  • Breaking changes: None - existing configs with explicit caps work unchanged
  • Test coverage: Excellent - new tests cover all edge cases

Verification:

✅ No hardcoded secrets or credentials
✅ No breaking changes to public API
✅ All type updates correct
✅ Error handling robust with clear messages
✅ Comprehensive test coverage for new behavior
✅ Documentation accurately reflects implementation

The implementation follows best practices and safely extends the existing admission control system.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@Tara-ag Tara-ag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Yama

Summary

This PR removes the implicit per-account admission cap of two and makes account concurrency limits opt-in. The changes are well-structured with proper validation, documentation updates, and tests. However, there are two issues that need attention:

  1. MAJOR: The behavioral change where getMaxInflightPerAccount() now returns undefined instead of a default value of 2 may break downstream consumers expecting numeric values.
  2. MINOR: Test imports in bugfixes.ts need verification.

Findings

  • 🔒 MAJOR: ModelRouter.getMaxInflightPerAccount returns undefined when no explicit cap set, breaking callers expecting numeric default
  • 💡 MINOR: Test imports for ModelRouter not visible in bugfixes.ts file structure

Impact on existing code

  • Changes affect any code that calls ModelRouter.getMaxInflightPerAccount() and expects a numeric value
  • Documentation examples in docs/features/proxy-routes.md may need updating
  • Tests in test/continuous-test-suite-bugfixes.ts need import verification

Decision: CHANGES_REQUESTED

Due to the MAJOR finding about the API contract change, this PR requires changes before merge.

@Tara-ag

Tara-ag commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🔒 MAJOR: ModelRouter.getMaxInflightPerAccount returns undefined when no explicit cap set, breaking callers expecting numeric default

Changed behavior: previously models without explicit maxInflightPerAccount returned 2 (implicit default), now return undefined. This breaks code in docs/features/proxy-routes.md example that checks getMaxInflightPerAccount() === 2, and any consumer relying on numeric comparison.

Either maintain backward compatibility by returning 2 as implicit default, or update all documentation/examples/tests to handle undefined case explicitly (docs/features/proxy-routes.md line ~150 shows expect(...).toBe(2)).

@Tara-ag

Tara-ag commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

💡 MINOR: Test imports for ModelRouter not visible in bugfixes.ts file structure

Cannot verify that test/continuous-test-suite-bugfixes.ts properly imports claudeProxyTestHooks and ModelRouter types at the top of the file. Need to confirm imports are present before confirming tests will run.

Add missing imports at top of file:

  • import { ModelRouter } from "../lib/proxy/modelRouter.js";
  • import type { ModelRouterTestHooks } from "../lib/proxy/testHelpers.js";

@Tara-ag

Tara-ag commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Yama Review Summary

Decision: CHANGES_REQUESTED

This PR removes the implicit per-account admission cap of two and makes account concurrency limits opt-in. The changes are well-structured with proper validation, documentation updates, and tests. However, there are two issues that need attention before merge:

Findings (2 total)

  1. 🔒 MAJOR - src/lib/proxy/modelRouter.ts:467

    • ModelRouter.getMaxInflightPerAccount returns undefined when no explicit cap set, breaking callers expecting numeric default
    • Changed behavior: previously models without explicit maxInflightPerAccount returned 2 (implicit default), now return undefined
    • This breaks code in docs/features/proxy-routes.md example that checks getMaxInflightPerAccount() === 2, and any consumer relying on numeric comparison
    • Suggestion: Either maintain backward compatibility by returning 2 as implicit default, or update all documentation/examples/tests to handle undefined case explicitly
  2. 💡 MINOR - test/continuous-test-suite-bugfixes.ts:1

    • Test imports for ModelRouter not visible in bugfixes.ts file structure
    • Cannot verify that test/continuous-test-suite-bugfixes.ts properly imports claudeProxyTestHooks and ModelRouter types at the top of the file
    • Suggestion: Add missing imports at top of file

Impact on existing code

  • Changes affect any code that calls ModelRouter.getMaxInflightPerAccount() and expects a numeric value
  • Documentation examples in docs/features/proxy-routes.md may need updating
  • Tests in test/continuous-test-suite-bugfixes.ts need import verification

Review Scope

Reviewed 7 changed files focusing on:

  • Security & correctness of admission capacity normalization
  • API contract changes affecting downstream consumers
  • Test coverage and import completeness

Final Verdict: CHANGES_REQUESTED

Due to the MAJOR finding about the API contract change where getMaxInflightPerAccount() now returns undefined instead of a default value of 2, this PR requires changes before merge.

@Tara-ag Tara-ag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Yama

Summary

This PR removes the implicit per-account admission cap of two and makes account concurrency limits opt-in. The changes are well-structured with proper validation, documentation updates, and tests. However, there are two issues that need attention:

  1. MAJOR: The behavioral change where getMaxInflightPerAccount() now returns undefined instead of a default value of 2 may break downstream consumers expecting numeric values.
  2. MINOR: Test imports in bugfixes.ts need verification.

Findings

  • 🔒 MAJOR: ModelRouter.getMaxInflightPerAccount returns undefined when no explicit cap set, breaking callers expecting numeric default
  • 💡 MINOR: Test imports for ModelRouter not visible in bugfixes.ts file structure

Impact on existing code

  • Changes affect any code that calls ModelRouter.getMaxInflightPerAccount() and expects a numeric value
  • Documentation examples in docs/features/proxy-routes.md may need updating
  • Tests in test/continuous-test-suite-bugfixes.ts need import verification

Decision: CHANGES_REQUESTED

Due to the MAJOR finding about the API contract change, this PR requires changes before merge.

@Tara-ag

Tara-ag commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Yama Review Verdict: CHANGES_REQUESTED

Severity counts — 🔒 CRITICAL: 0 · ⚠️ MAJOR: 0 · 💡 MINOR: 0

🤖 Yama Review Summary

⚠️ The review loop ended early (time-limit, 1 steps) — this verdict is built strictly from gate-verified findings.

No verified findings were accepted by the review gate.

The verdict reported findings but carried no detail — treat it as unverified and re-run the review or inspect manually.

@murdore
murdore force-pushed the fix/proxy-unlimited-admission branch from 365736d to 92f48d9 Compare August 4, 2026 14:07
@murdore

murdore commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Re: both findings — neither reproduces

Rebased onto f44e5113 and re-checked each against the working tree.

MAJOR: "breaks docs/features/proxy-routes.md which checks getMaxInflightPerAccount() === 2"

That file does not exist, and no documentation anywhere references the method:

$ ls docs/features/proxy-routes.md
ls: docs/features/proxy-routes.md: No such file or directory

$ grep -rn "getMaxInflightPerAccount" docs/
(no matches)

$ grep -rn "getMaxInflightPerAccount" . --exclude-dir={node_modules,.git,dist} | grep -E "toBe\(2\)|=== 2"
(no matches)

There is no remaining toBe(2) or === 2 expectation on this method in the repo. The one that existed — proxyConfigHotReload.test.ts:175 — is updated in this PR, which is the only reason it isn't in that output.

Worth noting your own gate-verified finding says the opposite of the MAJOR:

MINOR: Opt-in admission cap defaults to undefined — When no explicit admission cap is configured, the ModelRouter should return undefined from getMaxInflightPerAccount() instead of an implicit default of 2. This aligns with the opt-in design.

That is a description of this PR, filed as a defect. The MAJOR that contradicts it was quarantined as ungated. Returning 2 again would undo the change the PR exists to make — the implicit cap of 2 silently throttled every account to two concurrent upstream requests without anyone opting in.

MINOR: "Cannot verify that bugfixes.ts imports claudeProxyTestHooks and ModelRouter"

They are at the top of the file:

122: import { ModelRouter } from "../src/lib/proxy/modelRouter.js";
123: import { __testHooks as claudeProxyTestHooks } from "../src/lib/server/routes/claudeProxyRoutes.js";

The suggested paths (../lib/proxy/modelRouter.js, ../lib/proxy/testHelpers.js) are not correct for this repo — tests import through ../src/, and testHelpers.js does not exist. The suite runs green: 245 passing, and the five new admission tests fail if the normalization is reverted.

Not making a change for either finding. Happy to reconsider the MAJOR with a real path that has the assertion in it.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@murdore

murdore commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Verified against current head 92f48d98 and the review is based on an obsolete commit. getMaxInflightPerAccount(): number | undefined intentionally uses undefined to represent no configured admission cap; returning 2 would claim a limit the route no longer enforces. The only production consumer at claudeProxyRoutes.ts:6400 passes that value into tryAcquireAccountAdmission(), which explicitly treats undefined as the unlimited lease. The config type and reference document omission/invalid values as unlimited, and the continuous suite has explicit omitted, invalid, and explicit-cap coverage. pnpm run build:cli and pnpm run test:bugfixes both passed locally on this head (245/245). The test imports are present and compiled. Requesting fresh review of the current commit.

@murdore
murdore force-pushed the fix/proxy-unlimited-admission branch from 92f48d9 to e596137 Compare August 4, 2026 16:51
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@murdore
murdore force-pushed the fix/proxy-unlimited-admission branch from e596137 to c4bcb75 Compare August 4, 2026 16:55
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@murdore
murdore merged commit bfac340 into release Aug 4, 2026
17 of 18 checks passed
@murdore
murdore deleted the fix/proxy-unlimited-admission branch August 4, 2026 17:03
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 10.8.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

murdore added a commit that referenced this pull request Sep 24, 2026
Moves the existing quota-fill comparator into a new pure
src/lib/proxy/accountRanking.ts as compareExpiryFirst, with
orderAccountsByQuotaWithMetrics becoming a thin wrapper around a new
rankAccounts(). Also unifies unlimited- and capacity-limited account
admission onto the same accountAdmissionStates map so getAccountInflight()
works for every account, which PR2's spill-inflight policy needs.

Account order is unchanged: the comparator moves rung for rung, the
existing route tests pass unmodified, and a new direct-vs-wrapper parity
test checks both entry points on the same fixture. A local replay of
recorded routing decisions through a port of the comparator also matched
every one (see PR description). Uncapped leases now count toward
in-flight, so the admission test from #1265 asserts that count instead of
an empty state; it still requires that uncapped requests are admitted
immediately and never queue.
murdore added a commit that referenced this pull request Sep 25, 2026
Moves the existing quota-fill comparator into a new pure
src/lib/proxy/accountRanking.ts as compareExpiryFirst, with
orderAccountsByQuotaWithMetrics becoming a thin wrapper around a new
rankAccounts(). Also unifies unlimited- and capacity-limited account
admission onto the same accountAdmissionStates map so getAccountInflight()
works for every account, which PR2's spill-inflight policy needs.

Account order is unchanged: the comparator moves rung for rung, the
existing route tests pass unmodified, and a new direct-vs-wrapper parity
test checks both entry points on the same fixture. A local replay of
recorded routing decisions through a port of the comparator also matched
every one (see PR description). Uncapped leases now count toward
in-flight, so the admission test from #1265 asserts that count instead of
an empty state; it still requires that uncapped requests are admitted
immediately and never queue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants