Skip to content

fix(fireworks): prefer a single OpenAI-compatible trace - #367

Merged
nik13 merged 2 commits into
devfrom
fix/fireworks-python-openai-route
Nov 1, 2026
Merged

nik13 merged 2 commits into
devfrom
fix/fireworks-python-openai-route

Conversation

@nik13

@nik13 nik13 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Use the shared OpenAI-compatible integration for Fireworks rather than two independently emitted model spans.

  • Attribute only the exact api.fireworks.ai host to fireworks; retain the existing fallback for custom proxies and look-alikes.
  • Deprecate FireworksInstrumentor without removing its public entry points or raising its OpenAI SDK floor. When both instrumentors are enabled, the shared instrumentor owns the request and its tracer provider/privacy configuration applies. Either initialization and teardown order is supported.
  • Restore streamed tool-call output in the shared OpenAI accumulator. Accumulate fragmented function names and arguments for both indexed tool_calls and legacy function_call, including interleaved tools across multiple choices. Retain the requested-model convention for streams. Explicit null usage no longer discards stream output.
  • Preserve primary span attributes when indexed details exceed OpenTelemetry's attribute limit. Reapply primary request/response data after optional details, preserving response-over-request precedence and using the same privacy-masking API. This retains provider, model, token counts, and full output; optional indexed details remain subject to the configured span limit.
  • Match exact hosts in the legacy compatibility route and preserve streaming usage when OpenAI 1.0 exposes it as a dictionary.
  • Replace the Fireworks README with shared-package setup and migration instructions. Add network-isolated CI for the legacy floor, shared floor and current SDK.

Why this route

Arize's Fireworks guide uses its existing OpenAI instrumentor without a separate Fireworks instrumentor. Fireworks documents the same OpenAI-compatible endpoint. No vendor code was copied.

The original baseline emitted an openai-labelled span with the shared integration and two spans when both integrations were enabled. Independent review subsequently identified two regressions in this PR's streamed-tool normalization: attribute eviction with 50 parallel tools, and replacement rather than accumulation of fragmented function names. Both are fixed here; neither finding was rejected.

Verification

Final repair commit: c02dcc9. All executions below used real SDKs, synthetic credentials, mocked vendor HTTP, and the macOS sandbox denying outbound network except localhost. No vendor/model API or live Future AGI backend was called. CI uses a network namespace with only loopback enabled.

  • New boundary regressions against the pre-fix head: 12 failed / 8 passed at both OpenAI 1.69.0 and 3.42.0. The failures reproduce lost core attributes/output and truncated function names.
  • Repaired standalone PR, Python 3.12, at both SDK versions: 188 OpenAI package tests passed, plus 30 Fireworks tests passed in a separate process. This includes all 20 new boundary cases: sync/async, 1/50 parallel tools, 16/128-attribute limits, output privacy, and modern/legacy fragmented names. The existing multi-choice accumulator regression now also fragments names.
  • Independent reviewer's original adversarial tests, exporting actual OTLP protobuf to localhost: 10 passed at each shared SDK version.
  • Local composition with PR fix(openai): migrate vLLM and attribute Ollama clients #424 head b4054cbf2a58e5f376abf43e4dd4e0a71529faa7: 461 OpenAI package tests passed at each SDK version. Independent OTLP protobuf/JSON contracts, duplicate-span/README probes, and the reviewer's adversarial tests: 86 passed at each version. This is local composition evidence, not a merge or a separate CI run.
  • Legacy OpenAI 1.0.0, Python 3.10: 16 Fireworks compatibility tests passed, 87 inapplicable cases skipped, plus 30 Fireworks tests passed. The combined tree's legacy vLLM suite also passed 38 tests at OpenAI 1.0.0, 1.69.0, and 3.42.0.
  • release_plan.py --check, bootstrap_audit.py --check, and 54 release unittests passed. New/updated test and span-wrapper Ruff E/F/I checks and git diff --check passed. PyPI was independently checked: 3.42.0 was the latest OpenAI release during this repair.

CI on exact repaired head c02dcc90972bcd0b1f620bdcf1f3a2656b4b6a23: 51 checks passed, 15 skipped, no failures or pending checks. This includes all three network-isolated Fireworks matrix jobs, Python package tests, and the OpenAI-compatible recipes. PR #424's unchanged head also has 51 passed / 15 skipped. Branch protection/review requirements remain in effect; neither PR was merged.

To rerun, install the source core and both source packages, httpx, pytest and pytest-asyncio, then run python -m pytest python/frameworks/openai/tests. Run python/frameworks/fireworks/tests in a separate pytest process; both packages use a top-level tests package and their mock-based fixtures are independent. The workflow pins each SDK explicitly.

Release and retirement boundaries

Do not remove the Fireworks package or its release inventory yet. It still provides the existing public entry point and supports OpenAI 1.0–1.68, below the shared integration's 1.69 floor. This is a non-breaking deprecation/migration release, not a registry deletion. Release the shared fix and legacy migration patch before directing existing users to switch. Neither version files nor CHANGELOG release sections were hand-edited.

The customer docs page remains held outside the docs repository until the corrected traceAI-openai release is on PyPI; no docs PR advertises unreleased behavior. Native fireworks-ai SDK-only inference/training/management APIs and live backend rendering are not claimed.

PR #424 supplies Ollama/self-hosted per-client attribution and vLLM migration; this PR supplies the corrected shared streamed-tool prerequisite. Only this PR's branch was changed for these two findings. No merge into dev, tag, package publication, or docs publication was performed.

E2E coverage

not applicable (no e2e/ harness) · flows hit: n/a · marker: n/a · verdict: not applicable

Generated with Claude Code

Preserve the legacy entry point while deprecating duplicate tracing. Add exact-host attribution and restore streamed tool arguments before migrating users to the shared instrumentor.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Reapply primary request/response data after indexed details, retaining response precedence and privacy masking. Accumulate function-name deltas for tool_calls and legacy function_call. Cover SDK sync/async streams, 50 parallel tools, custom attribute limits, privacy, and interleaved choices.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@nik13
nik13 merged commit 84aa857 into dev Nov 1, 2026
77 checks passed
@nik13
nik13 deleted the fix/fireworks-python-openai-route branch November 1, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant