Repository navigation
Conversation
Bottleneck's doExpire has a typo that leaves expired jobs stuck in RUNNING state, leaking _running capacity until the limiter reports "all accounts inactive" despite available reservoir. Patch job.doExpire before the timer fires, and add a diagnostic that evicts limiters matching the leak pattern. Signed-off-by: Minxi Hou <houminxi@gmail.com>
Contributor
Author
diegosouzapw
added a commit
that referenced
this pull request
Aug 8, 2026
…tion (#9615) * fix(docker): complete partially traced packages in standalone co-location Publish-to-Docker-Hub has failed on every release/v3.8.50 push since #9151 enabled publishing from active release branches: the post-build guard dies with "Cannot find module .../@atjsh/llmlingua-2/dist/index.js" while the co-location step right above it reports 100 packages copied. Root cause: Next's file tracing materializes @atjsh/llmlingua-2 PARTIALLY in the standalone (package.json lands, the dist/ payload its main points at does not). colocateOptionals' no-clobber checked existsSync on the package DIRECTORY, so the partial shell counted as present and the one package that mattered was skipped forever (#9185 added the closure walk but kept the directory-level check). Fix: presence is now judged by entrypoint integrity — the package resolves from inside the target tree (same contract as the Dockerfile guard). Partial directories are completed with a file-level no-clobber merge (cpSync force:false), so files the trace did materialize are never overwritten and pinned instances (dist transformers 3.5.2) keep their protection. Validation (TDD): 2 new tests in docker-llmlingua-optionals-9166.test.ts reproduce the CI failure (partial package skipped; closure-wide early-exit firing while a member is partial) — red on the old code, 5/5 green after. * fix: update colocate test mock packages to match isPackageIntact entrypoint resolution The PR's isPackageIntact check uses require.resolve to validate that co-located packages have a usable entrypoint inside the target tree. The pre-existing test's mock packages lacked main fields and index files, so require.resolve failed and the idempotency assertion broke. Update buildRoot() to give every closure package a resolvable entry (main + index.js), mirroring what real npm packages ship. Refs #9615 * docs(changelog): fragment for #9615 * fix(yuanbao-web): accept content field in SSE text events (upstream format change) (#8739) Closes #8739 * fix(errorClassifier): classify ChatGPT Web SENTINEL_BLOCKED 403 as FORBIDDEN, enabling combo fallback (#8813) Closes #8813 * fix(vertex): route Claude models to native rawPredict and respect targetFormat overrides (#8994) Closes #8994 * fix(cursor): preserve tool context across multi-turn conversations when client lacks conversation_id (#9029) Closes #9029 * fix(sse): move Antigravity client system content to first user message to avoid upstream 429 (#9030) Closes #9030 * fix(combo): distinguish pre-dispatch skips from genuine failures to prevent false 503 ALL_ACCOUNTS_INACTIVE (#9630) Closes #9630 * fix: repair stray brace in combo.ts and fix no-explicit-any types in repro-9630 test --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…tion (cheaper-inference#9615) * fix(docker): complete partially traced packages in standalone co-location Publish-to-Docker-Hub has failed on every release/v3.8.50 push since cheaper-inference#9151 enabled publishing from active release branches: the post-build guard dies with "Cannot find module .../@atjsh/llmlingua-2/dist/index.js" while the co-location step right above it reports 100 packages copied. Root cause: Next's file tracing materializes @atjsh/llmlingua-2 PARTIALLY in the standalone (package.json lands, the dist/ payload its main points at does not). colocateOptionals' no-clobber checked existsSync on the package DIRECTORY, so the partial shell counted as present and the one package that mattered was skipped forever (cheaper-inference#9185 added the closure walk but kept the directory-level check). Fix: presence is now judged by entrypoint integrity — the package resolves from inside the target tree (same contract as the Dockerfile guard). Partial directories are completed with a file-level no-clobber merge (cpSync force:false), so files the trace did materialize are never overwritten and pinned instances (dist transformers 3.5.2) keep their protection. Validation (TDD): 2 new tests in docker-llmlingua-optionals-9166.test.ts reproduce the CI failure (partial package skipped; closure-wide early-exit firing while a member is partial) — red on the old code, 5/5 green after. * fix: update colocate test mock packages to match isPackageIntact entrypoint resolution The PR's isPackageIntact check uses require.resolve to validate that co-located packages have a usable entrypoint inside the target tree. The pre-existing test's mock packages lacked main fields and index files, so require.resolve failed and the idempotency assertion broke. Update buildRoot() to give every closure package a resolvable entry (main + index.js), mirroring what real npm packages ship. Refs cheaper-inference#9615 * docs(changelog): fragment for cheaper-inference#9615 * fix(yuanbao-web): accept content field in SSE text events (upstream format change) (cheaper-inference#8739) Closes cheaper-inference#8739 * fix(errorClassifier): classify ChatGPT Web SENTINEL_BLOCKED 403 as FORBIDDEN, enabling combo fallback (cheaper-inference#8813) Closes cheaper-inference#8813 * fix(vertex): route Claude models to native rawPredict and respect targetFormat overrides (cheaper-inference#8994) Closes cheaper-inference#8994 * fix(cursor): preserve tool context across multi-turn conversations when client lacks conversation_id (cheaper-inference#9029) Closes cheaper-inference#9029 * fix(sse): move Antigravity client system content to first user message to avoid upstream 429 (cheaper-inference#9030) Closes cheaper-inference#9030 * fix(combo): distinguish pre-dispatch skips from genuine failures to prevent false 503 ALL_ACCOUNTS_INACTIVE (cheaper-inference#9630) Closes cheaper-inference#9630 * fix: repair stray brace in combo.ts and fix no-explicit-any types in repro-9630 test --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
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.
Problem
Bottleneck v2.19.5's
doExpire(Job.js:162) has a typo that compares the job ID to the string"RUNNING"instead of checking the job's actual status. When a job's execution time exceeds theexpirationtimeout,doExpirefires but fails to advance the job from RUNNING to EXECUTING. The resulting exception is swallowed bysetTimeout, leaving the job permanently stuck in RUNNING state and Bottleneck's internal_runningcounter permanently incremented -- a capacity leak that eventually causes "all accounts inactive" even with available reservoir.The bug is unfixed upstream (v2.19.5 is the latest release; master branch still has it).
Fix
Monkey-patch
Bottleneck.prototype._runto correctjob.doExpirebefore the expiration timeout fires. The patch usesjob.id(notjob.options.id) for status lookup, includes a_doExpirePatchedguard against recursive wrapping, and adds optional chaining onstates.next.Diagnostic fallback in
withRateLimit: when a queue timeout fires and the limiter showsrunning > 0, executing = 0, reservoir > 0(the leak pattern) with no recent dispatch, evict the limiter and retry.Files changed
open-sse/services/bottleneckPatch.ts-- new, 80 linesopen-sse/services/rateLimitManager.ts-- +20 lines (import, patch call, diagnostic)tests/unit/bottleneck-doexpire-patch.test.ts-- new, 148 lines (5 tests)Testing
5/5 unit tests pass. Forge review: 6 rounds, PASS (R6 0 new findings).