Repository navigation
refactor(sse): declare the semantic-cache read path's parameters - #8646
Merged
diegosouzapw merged 1 commit intoJul 27, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
All five diagnostics in chatCore/semanticCache.ts come from its own parameter
list: five fields declared `unknown` that the body then reads through.
clientRawRequest: unknown -> .headers
reqLogger: unknown -> .logConvertedResponse(...)
log: unknown -> .debug?.(...)
effectiveServiceTier: unknown -> passed where a string is expected
body: Record<string, unknown> -> .temperature / .top_p into generateSignature,
whose defaults (= 0, = 1) infer number
Named only the fields this read path actually touches; the rest of the request
body stays `unknown` behind the index signature. No casts, no call sites
changed, nothing executable touched.
208 -> 203, zero new, on a line-number-agnostic diff of the full tsc error set.
No new tests: parameter declarations matching how the arguments were already
being used, with no control flow altered. 401/401 across the 47 cache suites;
typecheck:core, eslint and check:file-size clean.
backryun
force-pushed
the
chore/ts7-types-semantic-cache
branch
from
July 26, 2026 20:53
33e5ef3 to
4d5c0bb
Compare
Collaborator
|
Validated in local merge-train /tmp/train1d-20260727-090022-suite.log on .113 @ 029cdf4215cf465f0e1716ac9f84a84692b1e881 (full unit suite green on CI-equivalent host) |
diegosouzapw
merged commit Jul 27, 2026
c544c2c
into
cheaper-inference:release/v3.8.49
15 checks passed
Merged
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.
Part of #8484. All five diagnostics in
chatCore/semanticCache.ts, one cause — the function's own parameter list.Declared
unknown, then read throughThe last one is the least obvious: they go into
generateSignature(model, conversation, temperature = 0, topP = 1, …), whose defaults infernumber, sounknownfrom the index signature will not fit.Fix
Named only the fields this read path actually touches:
Everything else on the request body stays
unknownbehind the index signature — this is not an attempt to type the whole chat body, just to stop the parameters lying about what the function does with them.No casts added, no call site changed, nothing executable touched.
Verification
208 → 203, zero new errors, on a line-number-agnostic diff of the full
tscerror set.npm run typecheck:core— cleaneslint,check:file-size— cleanNo new tests
Parameter declarations matching how the arguments were already being used — no control flow altered, no runtime diff.
reqLogger.logConvertedResponseis called unconditionally so it is declared required;log.debugis called with?.so it stays optional, which is what the existing callers already pass.