Repository navigation
fix(sdk): align TypeScript confidence contract with HTTP responses - #1072
Conversation
|
Short answer: yours is the only open pull request whose What I measured across the 65 currently open PRs:
One point worth keeping straight, because the job names are close: I also read main's own failing job (run The practical consequence for maintainers is why I am posting instead of staying quiet. All ten of my open PRs -- #1092 #1093 #1095 #1096 #1098 #1086 #1085 #1084 #1083 #1074 -- carry head commits dated 2026-10-10, i.e. after |
Reverts 5e7a88b ("test(sdk): include x_jev_confidence in test server expected fixture"), carried on #1113's branch. #1072 and that commit are two mutually exclusive fixes for the same red lane, and they were each green in isolation. Together they are not: #1072's assertPredictionParity strips x_jev_confidence from the HTTP answer before comparing, so an `expected` that also carries it leaves the field only on the expected side and deepStrictEqual fails on all three choice/score answers. Keeping #1072's side on purpose. It derives the extension from the direct model's probabilities and checks the server's four-decimal rounding against that, so the test fails if _add_jev_confidence is wrong. Building `expected` by calling _add_jev_confidence puts the same helper on both sides of the assertion, where any error in it cancels out. #1113's own subject, the bare "questions" question id in laya/cli.py, is untouched by this revert. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
35 pull requests from 11 contributors. Headline #1072: sdk/typescript's response validation rejected the x_jev_confidence that 0.4.2's #1066 started sending, so the TypeScript SDK lane has been red on main since that release. Also #1073 (LAYA_TOURNAMENT_GROUP), #1083 (laya.jev_confidence), #1105 (model: null across all four MCP tools), #1104, #1109, #1112, #1113, #1108 and #1117 (laya-ts), #1090 (Java floors remeasured on the merged tree), and 20 documentation and test-gate corrections. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Merged in 0.4.3. This was the one that mattered most this pass, because the lane it fixes had been red on main for two days and was hiding everything else. What I measured on the merged tree,
Your One thing you should know, because it affected your PR without anything being wrong in it. #1113 carried a second fix for this same lane on its branch, commit Rest of the gate on the merged tree: 87 of 87 Python suites pass, |
What
Align the TypeScript SDK with the existing HTTP
x_jev_confidenceextension:[0, 1]when present. Older responses that omit the extension remain accepted;noulhas no Jev confidence.No production Python inference behavior, confidence formulas, model weights, or dependencies change.
Why
The server now enriches HTTP answers with
x_jev_confidence, while directAgent.predict()results do not include this HTTP-layer field. The SDK integration test compared the complete objects and therefore failed despite identical underlying predictions.This reproduces on upstream
mainat6880462and is independent of the residual-adapter feature:The fix does not disable response equality or use the server's enrichment helper as its own expected-value oracle. Regression cases ensure that changed probabilities, decisions, usage, unexpected fields, and incorrect or missing extensions still fail.
Verification
Local CPU validation on Node 22.23.2 and 24.21.0, each:
Before: the live HTTP integration test failed on the extra confidence fields. After: 29 SDK tests and 2 integration tests passed, with no skips, on each Node version. TypeScript build/type checking and package dry-run passed on both versions. The integration fixture uses a tiny offline checkpoint, not downloaded weights.
Repository-root checks also passed:
griffe:diagnostics.These are local results; GitHub CI on the submitted commit is separate.
Scope
One maintenance fix based on upstream
6880462(0.4.2). No architecture features, private reports, datasets, checkpoint artifacts, or unrelated formatting changes are included. The three feature PRs can rebase after this fix lands.