fix(usage): remove finished pending request by id instead of oldest-first - #14797
Merged
diegosouzapw merged 1 commit intoSep 25, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
maxmad64bis
force-pushed
the
fix/pending-request-by-id
branch
from
September 24, 2026 18:58
641fdf5 to
3326bea
Compare
maxmad64bis
marked this pull request as ready for review
September 24, 2026 19:05
maxmad64bis
force-pushed
the
fix/pending-request-by-id
branch
from
September 24, 2026 19:35
3326bea to
c79bb23
Compare
maxmad64bis
marked this pull request as draft
September 24, 2026 23:42
maxmad64bis
force-pushed
the
fix/pending-request-by-id
branch
from
September 25, 2026 00:23
c79bb23 to
e0b5b16
Compare
maxmad64bis
marked this pull request as ready for review
September 25, 2026 01:01
diegosouzapw
merged commit Sep 25, 2026
dda0448
into
diegosouzapw:release/v3.8.51
19 of 25 checks passed
fouadSalkini
added a commit
to fouadSalkini/OmniRoute
that referenced
this pull request
Sep 26, 2026
Slice 2/3 rewrote open-sse/handlers/chatCore.ts from an older snapshot, silently undoing four merged fixes. Rebuild the file as the base version plus only this PR's own hunks: stripNonStreamingForwardedHeaders on the non-streaming path and apiKeyInfo on the streaming headers meta. Restored: - handleChatCore -> withResilienceActionsContext -> handleChatCoreInner wrapper, previousResponseResumed handling, notePreviousResponseResumed and the three noteBufferedVerdictOutcome calls (diegosouzapw#14810) - pendingRequestId in every trackPendingRequest call, the pipeline options and finalizeToolLoopError (diegosouzapw#14797) - the full-UUID traceId and its collision comment (diegosouzapw#14474) - correlationId on buildContinuationLogHooks (diegosouzapw#14793)
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
The in-progress request list removes the oldest entry for an account and model when any request for that pair finishes, so a still-running request can vanish from the list while finished ones stay. This change removes the entry that actually finished, by its tracking id, on both the disconnect and the normal streaming-completion paths, so the dashboard keeps showing the request that's still running. An unknown id removes nothing instead of taking another entry.
Related Issues
Related to #12650 (pending-tracking id shared across combo target retries, which this change preserves) and #12910 (finalize-by-exact-id precedent in the same family).
Validation
npm run lintTests Added Or Updated
tests/unit/usage-pending-removal-by-id.test.ts(new, 5 cases: out-of-order finish keeps the survivor, id-less finish keeps oldest-first fallback, unknown id removes nothing, controller-disconnect by id, lone-request double-removal no-op with counter guard — 5/5 green on the head).Coverage Notes
Reviewer Notes
chatCore.tsstreaming paths pass the finishing id (onStreamComplete→finalizeStreamRequestLogby id); callers without an id in scope keep oldest-first behavior.stream.tsstays within its frozen cap via the extracted 21-line helper.