fix(api): cap OpenTelemetry settings at JavaScript's safe integer limit #6286
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.50) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 563 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.379
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #6286"
general
weight: 0.35
Jackmeson1
Fixes #6285
What happens
The OpenTelemetry form resubmits all six integer fields when a user edits only the sampling rate. At the maximum accepted by #6239, JavaScript sends
18446744073709552000for a value saved as18446744073709551615. The API rejects the save.| Operation | Before | After |
|---|---|---|
| PUT
9007199254740991| 200 | 200 || PUT
9007199254740992| 200 | Field-level 422, previous settings preserved || GET the maximum accepted by that version, edit only the sampling rate, then PUT | 422 after rounding | 200, all six integers preserved |
Cause
#6239 bounded the integers at orjson’s serialization limit. The #6274 review showed that the settings form also needs an integer range that survives JavaScript’s JSON round trip.
Change
The six OpenTelemetry integer settings now share the download settings’ existing maximum of
9007199254740991(253 - 1), so the Web UI can read and save every accepted integer exactly.Cap the six OpenTelemetry integers at
9007199254740991(253 - 1) in request validation, direct saves and settings-store startup parsing. OpenAPI publishes the exact numeric maximum.The #6274 P2 also applies to OpenTelemetry. Returning the whole startup section can put an empty startup API key into the form, and the next unrelated save clears the saved key. Reading a saved section or an older Host response now repairs only oversized fields, preserving the masked key, endpoints and protocol. API and Supervisor workers apply the same bound to older Host payloads. If an oversized queue has a valid batch larger than the default queue, the replacement queue grows to fit that batch.
Tests
Cover all six boundaries and OpenAPI fields, rejected PUTs, a sampling-rate-only browser round trip, nested and legacy-flat settings, and older Host GET, reset and worker startup. The hosted save checks that the original API key survives. The worker regression checks that the runtime queue and batch match the values returned by GET.
On Windows Python 3.10.20 and 3.14.6 at
2992db5d(rebased onto82598b1bafter #6274), the OpenTelemetry and system settings API and store tests,test_api_host.pyandtest_supervisor_host.pypass (96 each, two POSIX-only skips). Before the rebase, 19 of the new or changed cases failed oneb7411b4, and the extended API worker case failed there because the batch size dropped to 512. A Node.js check confirmed that the old maximum comes back as18446744073709552000and the new one round-trips unchanged. On Ubuntu 24.04 at2992db5d, the changed test files passed on Python 3.12 with Transformers 5.25.0 and 4.57.6 and on Python 3.10 (59 each); with the production files from82598b1bthey fail. Pre-commit and mypy over the repository passed; the consumer suite had only failures that also occur on the base.Supervisor startup with a legacy Host
With a startup queue of
8192, an older Host could save queue2**53and batch4096. GET returned(8192, 4096), but a replacement Supervisor ran(4096, 4096)and stayed inrestart_components.Hosted reads and Supervisor startup now use the same field-level repair and queue/batch ordering. A new Host passes its original startup settings. A legacy Host supplies the environment captured for its first child, so recovery on that path depends on the original queue still being present. When the Supervisor repairs an oversized integer, it reports the saved snapshot’s revision for the legacy Host’s restart check. Ordinary snapshots retain the running settings’ revision.
The mixed-version regression compares GET with a real replacement Supervisor and checks that only
apiremains pending. It covers the legacy payload and an explicit startup baseline with an inherited queue of16384. Both cases failed on2992db5dat the effective queue comparison.The follow-up commit
636b62afpassed on Ubuntu 24.04:test_supervisor_host.pyon Python 3.12 with Transformers 5.25.1 and 4.57.6 and on Python 3.10 (16 each); with the production files from2992db5dthe new cases fail. Pre-commit and mypy over the repository passed; the consumer suite had only failures that also occur on the base. On Windows Python 3.10.20 and 3.14.6,test_supervisor_host.pyand the observability settings API and store tests passed (47 each).AI disclosure: this was prepared with AI assistance (Claude Code with Claude Opus 5.5, and OpenAI Codex with GPT-6.2).
🤖 Generated with Claude Code