Repository navigation
fix(openai): attribute Novita chat requests to their provider - #397
Merged
Merged
Conversation
Keep the shared OpenAI instrumentor and exact-host fallback behavior. Verify sync/async success, streams, usage and errors over local OTLP HTTP. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Keep Novita adjacent to Mistral in the explicit host map and cover port/scheme normalization, look-alike fallbacks, and hidden content. Co-Authored-By: Claude Code <noreply@anthropic.com>
nik13
added a commit
that referenced
this pull request
Nov 10, 2026
… traceAI-langchain 0.2.2, Java 1.0.3 (#636) * chore(release): bump core, OpenAI, LangChain and Java patch versions Synchronize runtime versions, reactor parent references and release changelogs for #155, #348, #397, #393 and #425. Dependency floors are unchanged. Co-Authored-By: Claude Code <noreply@anthropic.com> * chore(release): list every change shipping in core 1.3.1, OpenAI 0.1.14 and Java 1.0.3 Core 1.3.1 also ships the PII-redaction scoping fixes (#195/#244) that sat under Unreleased, and the 1.3.0 heading gets its release date. OpenAI 0.1.14 also ships the Azure metadata (#154), Baseten (#541), Azure Government (#502), OpenRouter host (#547), full multi-message input (#245) and exhausted-stream changes. Java 1.0.3 also ships #543 and #605. Notes the remaining blank OTEL-env Authorization limitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.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.
Summary
Fix Novita attribution in the existing Python
traceAI-openaipackage by adding the exact documented hostapi.novita.ai->novitato the shared provider map. Novita's Quickstart useshttps://api.novita.ai/openai/v1/chat/completions.OpenAIInstrumentor, the shared OpenAI-compatible route, and existing privacy defaults. No new wrapper, package, dependency, public API, or release/version change.openai. Host normalization remains case-insensitive and accepts trailing dots.gen_ai.provider.name, absence of legacygen_ai.system, requested/served model behavior, usage, error status, exactly one span, hidden prompt/output behavior, and absence of the synthetic vendor key from exported payloads.Current base and head
525919ead43c29f7184263eec0ba6c51a3b87dcf(dev).454fc2da277ecd675e35136118cd208247d3a1ee.Independent qualification — 2026-11-09
All installs and tests for this qualification ran in E2B, not on the local machine. Python 3.12.16, candidate source core 1.3.0, and the exact pushed source were used. OpenAI has a declared minimum of 1.69.0 and no upper cap; 3.48.0 was the latest PyPI release checked for this run.
The four skips common to both versions are unsupported legacy-instrumentor Responses cases. The floor's additional 24 skips are unavailable callable credentials (8) and
AsyncStream.aclose(16). None of the new Novita cases were skipped.For the base control, only
_providers.pywas replaced by its exact version from the base SHA above, leaving the candidate tests and other source unchanged. Every one of the 82 failures at each bound was exactlyopenaiinstead ofnovita(80 wire cases and two direct-host cases); fallback cases stayed green. This demonstrates the regression without replaying unrelated historical changes.Vendor HTTP uses
httpx.MockTransportand synthetic credentials; telemetry crosses an actual localhost OTLP/HTTP protobuf receiver. Pytest ran with socket restrictions permitting only loopback and Unix sockets. No real Novita request, provider credential, live Future AGI ingestion, or live cost-parity claim is involved.Reproduce in E2B or CI
From the repository root at the qualified head, use a separate environment for each SDK:
Run with
SDK=1.69.0andSDK=3.48.0. To reproduce the negative control in a disposable checkout, replacepython/frameworks/openai/traceai_openai/_providers.pyusinggit show 525919ead43c29f7184263eec0ba6c51a3b87dcf:python/frameworks/openai/traceai_openai/_providers.py, then run the same pytest command targeting onlypython/frameworks/openai/tests/test_novita_provider.py; restore the head file afterwards.E2B receipt label:
qw-traceai-397-bounds-454fc2da; exit 0; sandbox termination verified. The receipt includes exact revisions, per-bound dependency freezes, full logs and JUnit XML.git diff --checkis clean.GitHub CI and review
On
454fc2da277ecd675e35136118cd208247d3a1ee, 55 checks succeeded, three unrelated language-matrix checks were skipped, and none remained pending or failed.Reviewed the actual final diff against the internal minimal-code, contract, failure-mode, testing, security and PR standards. No introduced blocking code findings. The applicable mechanical gate was the new test suite; no Ruff configuration applies to these package files, and there are no migration or frontend-contract changes. The existing PR has no linked ticket; no ticket or closing reference has been invented.
The PR is non-draft/ready for review. The normal independent-human-review requirement remains in place; this qualification is not an approval or a merge override.
Release and scope
Release the shared
traceAI-openaipackage through the normal release-please process after merge. No publication was performed here, and no separate Novita package is introduced. Customer documentation should name the released wheel only after that wheel has been qualified. Reverting the single map entry restores the previous attribution without changing request routing or privacy behavior.E2E coverage
not applicable (no e2e/ harness) · flows hit: n/a · marker: n/a · verdict: not applicable
🤖 Generated with Claude Code