Skip to content

feat: Expose model provider header#100

Merged
max-deygin-traceloop merged 4 commits into
mainfrom
max/token-usage-metadata
Apr 14, 2026
Merged

feat: Expose model provider header#100
max-deygin-traceloop merged 4 commits into
mainfrom
max/token-usage-metadata

Conversation

@max-deygin-traceloop

@max-deygin-traceloop max-deygin-traceloop commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add X-GenAI-Provider-Name response header to chat_completions,
    completions, and embeddings pipeline handlers
  • Header value is the lowercase provider type: openai | anthropic | azure | bedrock | vertexai
  • Enables py-evaluator to attribute token usage to the correct provider without
    parsing config

Summary by CodeRabbit

  • New Features

    • API responses for chat completions, completions, and embeddings now include a provider-identification header on successful responses.
  • Tests

    • Expanded coverage with tests validating provider header values across model/provider combinations and asserting absence when no model matches.
  • Chores

    • Updated ignore configuration to exclude Node/npm artifacts (node_modules, package-lock.json, package.json).

@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds injection of the x-genai-provider-name response header (derived from matched model's provider type) to chat completions, completions, and embeddings handlers; introduces a test-only ProviderRegistry::from_mock; and updates .gitignore to ignore Node.js artifacts.

Changes

Cohort / File(s) Summary
Build Configuration
/.gitignore
Added node_modules, package-lock.json, and package.json to ignore Node.js artifacts.
Provider Registry (tests)
src/providers/registry.rs
Added #[cfg(test)] pub fn from_mock(key: String, provider: Arc<dyn Provider>) -> Self for constructing a registry with a single mock provider entry in tests.
Pipeline header injection & tests
src/pipelines/pipeline.rs
Added HEADER_PROVIDER and inject_provider_header(...) to set x-genai-provider-name based on matched model provider type; updated /chat/completions, /completions, and /embeddings to compute provider type and inject header for JSON and SSE responses; replaced fixed mocks with a configurable mock provider and expanded tests to assert header presence/values and 404 behavior when no model matches.

Sequence Diagram

sequenceDiagram
    participant Client
    participant Handler
    participant ProviderRegistry
    participant Provider
    participant Response

    Client->>Handler: POST /chat/completions (model)
    Handler->>ProviderRegistry: get(model_name)
    ProviderRegistry->>Provider: lookup provider
    Provider-->>ProviderRegistry: return provider (ProviderType)
    ProviderRegistry-->>Handler: provider + type
    Handler->>Handler: compute provider_type string
    Handler->>Response: inject header "x-genai-provider-name"
    Handler-->>Client: 200 OK + header

    Client->>Handler: POST /completions (stream)
    Handler->>ProviderRegistry: get(model_name)
    ProviderRegistry->>Provider: lookup provider
    Provider-->>ProviderRegistry: return provider (ProviderType)
    ProviderRegistry-->>Handler: provider + type
    Handler->>Handler: compute provider_type string
    Handler->>Response: stream SSE events with header injected
    Handler-->>Client: SSE stream + header

    Client->>Handler: POST /chat/completions (unknown model)
    Handler->>ProviderRegistry: get(unknown_model)
    ProviderRegistry-->>Handler: None
    Handler-->>Client: 404 Not Found (no header)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through headers, small and bright,
I tucked provider names in every byte,
Tests nodded yes, registry lent a paw,
And gitignore swept Node out the door — hurrah! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.10% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Expose model provider header' accurately describes the main change: adding a response header that exposes the model's provider type across multiple pipeline endpoints.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch max/token-usage-metadata

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant

CLAassistant commented Apr 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

🔒 Container Vulnerability Scan (hub-migrations - amd64)

Click to expand results

For OSS Maintainers: VEX Notice
--------------------------------
If you're an OSS maintainer and Trivy has detected vulnerabilities in your project that you believe are not actually exploitable, consider issuing a VEX (Vulnerability Exploitability eXchange) statement.
VEX allows you to communicate the actual status of vulnerabilities in your project, improving security transparency and reducing false positives for your users.
Learn more and start using VEX: https://trivy.dev/docs/v0.69/guide/supply-chain/vex/repo#publishing-vex-documents

To disable this notice, set the TRIVY_DISABLE_VEX_NOTICE environment variable.


hub-migrations:0b683dbe2f508b4474dd1547849361c6f39ffcb2-amd64 (debian 13.4)
===========================================================================
Total: 11 (UNKNOWN: 0, LOW: 7, MEDIUM: 4, HIGH: 0, CRITICAL: 0)

┌─────────┬──────────────────┬──────────┬──────────────┬─────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
│ Library │  Vulnerability   │ Severity │    Status    │      Installed Version      │ Fixed Version │                            Title                             │
├─────────┼──────────────────┼──────────┼──────────────┼─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ libc6   │ CVE-2026-4046    │ MEDIUM   │ fix_deferred │ 2.41-12+deb13u2             │               │ glibc: glibc: Denial of Service via iconv() function with    │
│         │                  │          │              │                             │               │ specific character sets...                                   │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4046                    │
│         ├──────────────────┤          ├──────────────┤                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4437    │          │ affected     │                             │               │ glibc: glibc: Incorrect DNS response parsing via crafted DNS │
│         │                  │          │              │                             │               │ server response                                              │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4437                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4438    │          │              │                             │               │ glibc: glibc: Invalid DNS hostname returned via              │
│         │                  │          │              │                             │               │ gethostbyaddr functions                                      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4438                    │
│         ├──────────────────┼──────────┤              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2010-4756    │ LOW      │              │                             │               │ glibc: glob implementation can cause excessive CPU and       │
│         │                  │          │              │                             │               │ memory consumption due to...                                 │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2010-4756                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2018-20796   │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2018-20796                   │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010022 │          │              │                             │               │ glibc: stack guard protection bypass                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010022                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010023 │          │              │                             │               │ glibc: running ldd on malicious ELF leads to code execution  │
│         │                  │          │              │                             │               │ because of...                                                │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010023                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010024 │          │              │                             │               │ glibc: ASLR bypass using cache of thread stack and heap      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010024                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010025 │          │              │                             │               │ glibc: information disclosure of heap addresses of           │
│         │                  │          │              │                             │               │ pthread_created thread                                       │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010025                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-9192    │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-9192                    │
├─────────┼──────────────────┼──────────┤              ├─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ zlib1g  │ CVE-2026-27171   │ MEDIUM   │              │ 1:1.3.dfsg+really1.3.1-1+b1 │               │ zlib: zlib: Denial of Service via infinite loop in CRC32     │
│         │                  │          │              │                             │               │ combine functions...                                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-27171                   │
└─────────┴──────────────────┴──────────┴──────────────┴─────────────────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘

OS Packages (license)
=====================
Total: 29 (UNKNOWN: 0, LOW: 11, MEDIUM: 0, HIGH: 18, CRITICAL: 0)

┌─────────────┬───────────────────┬────────────────┬──────────┐
│   Package   │      License      │ Classification │ Severity │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ base-files  │ GPL-2.0-or-later  │ restricted     │ HIGH     │
├─────────────┤                   │                │          │
│ gcc-14-base │                   │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-only      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Artistic-2.0      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ LGPL-2.0-or-later │ restricted     │ HIGH     │
├─────────────┼───────────────────┤                │          │
│ libc6       │ LGPL-2.1-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-or-later  │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-only      │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-or-later  │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Unicode-DFS-2016  │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ BSL-1.0           │                │          │
│             ├───────────────────┤                │          │
│             │ BSD-2-Clause      │                │          │
│             ├───────────────────┤                │          │
│             │ ISC               │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-3.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.1-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-only     │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libssl3t64  │ Apache-2.0        │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ Artistic-2.0      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-1.0-or-later  │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ GPL-1.0-only      │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libzstd1    │ BSD-3-Clause      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-2.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Zlib              │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ MIT               │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ netbase     │ GPL-2.0-only      │ restricted     │ HIGH     │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ zlib1g      │ Zlib              │ notice         │ LOW      │
└─────────────┴───────────────────┴────────────────┴──────────┘

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

🔒 Container Vulnerability Scan (hub-migrations - arm64)

Click to expand results

For OSS Maintainers: VEX Notice
--------------------------------
If you're an OSS maintainer and Trivy has detected vulnerabilities in your project that you believe are not actually exploitable, consider issuing a VEX (Vulnerability Exploitability eXchange) statement.
VEX allows you to communicate the actual status of vulnerabilities in your project, improving security transparency and reducing false positives for your users.
Learn more and start using VEX: https://trivy.dev/docs/v0.69/guide/supply-chain/vex/repo#publishing-vex-documents

To disable this notice, set the TRIVY_DISABLE_VEX_NOTICE environment variable.


hub-migrations:0b683dbe2f508b4474dd1547849361c6f39ffcb2-arm64 (debian 13.4)
===========================================================================
Total: 11 (UNKNOWN: 0, LOW: 7, MEDIUM: 4, HIGH: 0, CRITICAL: 0)

┌─────────┬──────────────────┬──────────┬──────────────┬─────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
│ Library │  Vulnerability   │ Severity │    Status    │      Installed Version      │ Fixed Version │                            Title                             │
├─────────┼──────────────────┼──────────┼──────────────┼─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ libc6   │ CVE-2026-4046    │ MEDIUM   │ fix_deferred │ 2.41-12+deb13u2             │               │ glibc: glibc: Denial of Service via iconv() function with    │
│         │                  │          │              │                             │               │ specific character sets...                                   │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4046                    │
│         ├──────────────────┤          ├──────────────┤                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4437    │          │ affected     │                             │               │ glibc: glibc: Incorrect DNS response parsing via crafted DNS │
│         │                  │          │              │                             │               │ server response                                              │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4437                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4438    │          │              │                             │               │ glibc: glibc: Invalid DNS hostname returned via              │
│         │                  │          │              │                             │               │ gethostbyaddr functions                                      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4438                    │
│         ├──────────────────┼──────────┤              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2010-4756    │ LOW      │              │                             │               │ glibc: glob implementation can cause excessive CPU and       │
│         │                  │          │              │                             │               │ memory consumption due to...                                 │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2010-4756                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2018-20796   │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2018-20796                   │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010022 │          │              │                             │               │ glibc: stack guard protection bypass                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010022                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010023 │          │              │                             │               │ glibc: running ldd on malicious ELF leads to code execution  │
│         │                  │          │              │                             │               │ because of...                                                │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010023                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010024 │          │              │                             │               │ glibc: ASLR bypass using cache of thread stack and heap      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010024                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010025 │          │              │                             │               │ glibc: information disclosure of heap addresses of           │
│         │                  │          │              │                             │               │ pthread_created thread                                       │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010025                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-9192    │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-9192                    │
├─────────┼──────────────────┼──────────┤              ├─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ zlib1g  │ CVE-2026-27171   │ MEDIUM   │              │ 1:1.3.dfsg+really1.3.1-1+b1 │               │ zlib: zlib: Denial of Service via infinite loop in CRC32     │
│         │                  │          │              │                             │               │ combine functions...                                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-27171                   │
└─────────┴──────────────────┴──────────┴──────────────┴─────────────────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘

OS Packages (license)
=====================
Total: 29 (UNKNOWN: 0, LOW: 11, MEDIUM: 0, HIGH: 18, CRITICAL: 0)

┌─────────────┬───────────────────┬────────────────┬──────────┐
│   Package   │      License      │ Classification │ Severity │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ base-files  │ GPL-2.0-or-later  │ restricted     │ HIGH     │
├─────────────┤                   │                │          │
│ gcc-14-base │                   │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-only      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Artistic-2.0      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ LGPL-2.0-or-later │ restricted     │ HIGH     │
├─────────────┼───────────────────┤                │          │
│ libc6       │ LGPL-2.1-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-or-later  │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-only      │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-or-later  │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Unicode-DFS-2016  │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ BSL-1.0           │                │          │
│             ├───────────────────┤                │          │
│             │ BSD-2-Clause      │                │          │
│             ├───────────────────┤                │          │
│             │ ISC               │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-3.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.1-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-only     │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libssl3t64  │ Apache-2.0        │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ Artistic-2.0      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-1.0-or-later  │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ GPL-1.0-only      │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libzstd1    │ BSD-3-Clause      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-2.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Zlib              │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ MIT               │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ netbase     │ GPL-2.0-only      │ restricted     │ HIGH     │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ zlib1g      │ Zlib              │ notice         │ LOW      │
└─────────────┴───────────────────┴────────────────┴──────────┘

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

🔒 Container Vulnerability Scan (hub - amd64)

Click to expand results

For OSS Maintainers: VEX Notice
--------------------------------
If you're an OSS maintainer and Trivy has detected vulnerabilities in your project that you believe are not actually exploitable, consider issuing a VEX (Vulnerability Exploitability eXchange) statement.
VEX allows you to communicate the actual status of vulnerabilities in your project, improving security transparency and reducing false positives for your users.
Learn more and start using VEX: https://trivy.dev/docs/v0.69/guide/supply-chain/vex/repo#publishing-vex-documents

To disable this notice, set the TRIVY_DISABLE_VEX_NOTICE environment variable.


hub:0b683dbe2f508b4474dd1547849361c6f39ffcb2-amd64 (debian 13.4)
================================================================
Total: 11 (UNKNOWN: 0, LOW: 7, MEDIUM: 4, HIGH: 0, CRITICAL: 0)

┌─────────┬──────────────────┬──────────┬──────────────┬─────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
│ Library │  Vulnerability   │ Severity │    Status    │      Installed Version      │ Fixed Version │                            Title                             │
├─────────┼──────────────────┼──────────┼──────────────┼─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ libc6   │ CVE-2026-4046    │ MEDIUM   │ fix_deferred │ 2.41-12+deb13u2             │               │ glibc: glibc: Denial of Service via iconv() function with    │
│         │                  │          │              │                             │               │ specific character sets...                                   │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4046                    │
│         ├──────────────────┤          ├──────────────┤                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4437    │          │ affected     │                             │               │ glibc: glibc: Incorrect DNS response parsing via crafted DNS │
│         │                  │          │              │                             │               │ server response                                              │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4437                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4438    │          │              │                             │               │ glibc: glibc: Invalid DNS hostname returned via              │
│         │                  │          │              │                             │               │ gethostbyaddr functions                                      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4438                    │
│         ├──────────────────┼──────────┤              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2010-4756    │ LOW      │              │                             │               │ glibc: glob implementation can cause excessive CPU and       │
│         │                  │          │              │                             │               │ memory consumption due to...                                 │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2010-4756                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2018-20796   │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2018-20796                   │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010022 │          │              │                             │               │ glibc: stack guard protection bypass                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010022                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010023 │          │              │                             │               │ glibc: running ldd on malicious ELF leads to code execution  │
│         │                  │          │              │                             │               │ because of...                                                │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010023                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010024 │          │              │                             │               │ glibc: ASLR bypass using cache of thread stack and heap      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010024                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010025 │          │              │                             │               │ glibc: information disclosure of heap addresses of           │
│         │                  │          │              │                             │               │ pthread_created thread                                       │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010025                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-9192    │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-9192                    │
├─────────┼──────────────────┼──────────┤              ├─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ zlib1g  │ CVE-2026-27171   │ MEDIUM   │              │ 1:1.3.dfsg+really1.3.1-1+b1 │               │ zlib: zlib: Denial of Service via infinite loop in CRC32     │
│         │                  │          │              │                             │               │ combine functions...                                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-27171                   │
└─────────┴──────────────────┴──────────┴──────────────┴─────────────────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘

OS Packages (license)
=====================
Total: 29 (UNKNOWN: 0, LOW: 11, MEDIUM: 0, HIGH: 18, CRITICAL: 0)

┌─────────────┬───────────────────┬────────────────┬──────────┐
│   Package   │      License      │ Classification │ Severity │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ base-files  │ GPL-2.0-or-later  │ restricted     │ HIGH     │
├─────────────┤                   │                │          │
│ gcc-14-base │                   │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-only      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Artistic-2.0      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ LGPL-2.0-or-later │ restricted     │ HIGH     │
├─────────────┼───────────────────┤                │          │
│ libc6       │ LGPL-2.1-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-or-later  │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-only      │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-or-later  │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Unicode-DFS-2016  │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ BSL-1.0           │                │          │
│             ├───────────────────┤                │          │
│             │ BSD-2-Clause      │                │          │
│             ├───────────────────┤                │          │
│             │ ISC               │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-3.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.1-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-only     │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libssl3t64  │ Apache-2.0        │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ Artistic-2.0      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-1.0-or-later  │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ GPL-1.0-only      │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libzstd1    │ BSD-3-Clause      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-2.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Zlib              │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ MIT               │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ netbase     │ GPL-2.0-only      │ restricted     │ HIGH     │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ zlib1g      │ Zlib              │ notice         │ LOW      │
└─────────────┴───────────────────┴────────────────┴──────────┘

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

🔒 Container Vulnerability Scan (hub - arm64)

Click to expand results

For OSS Maintainers: VEX Notice
--------------------------------
If you're an OSS maintainer and Trivy has detected vulnerabilities in your project that you believe are not actually exploitable, consider issuing a VEX (Vulnerability Exploitability eXchange) statement.
VEX allows you to communicate the actual status of vulnerabilities in your project, improving security transparency and reducing false positives for your users.
Learn more and start using VEX: https://trivy.dev/docs/v0.69/guide/supply-chain/vex/repo#publishing-vex-documents

To disable this notice, set the TRIVY_DISABLE_VEX_NOTICE environment variable.


hub:0b683dbe2f508b4474dd1547849361c6f39ffcb2-arm64 (debian 13.4)
================================================================
Total: 11 (UNKNOWN: 0, LOW: 7, MEDIUM: 4, HIGH: 0, CRITICAL: 0)

┌─────────┬──────────────────┬──────────┬──────────────┬─────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
│ Library │  Vulnerability   │ Severity │    Status    │      Installed Version      │ Fixed Version │                            Title                             │
├─────────┼──────────────────┼──────────┼──────────────┼─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ libc6   │ CVE-2026-4046    │ MEDIUM   │ fix_deferred │ 2.41-12+deb13u2             │               │ glibc: glibc: Denial of Service via iconv() function with    │
│         │                  │          │              │                             │               │ specific character sets...                                   │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4046                    │
│         ├──────────────────┤          ├──────────────┤                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4437    │          │ affected     │                             │               │ glibc: glibc: Incorrect DNS response parsing via crafted DNS │
│         │                  │          │              │                             │               │ server response                                              │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4437                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2026-4438    │          │              │                             │               │ glibc: glibc: Invalid DNS hostname returned via              │
│         │                  │          │              │                             │               │ gethostbyaddr functions                                      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4438                    │
│         ├──────────────────┼──────────┤              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2010-4756    │ LOW      │              │                             │               │ glibc: glob implementation can cause excessive CPU and       │
│         │                  │          │              │                             │               │ memory consumption due to...                                 │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2010-4756                    │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2018-20796   │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2018-20796                   │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010022 │          │              │                             │               │ glibc: stack guard protection bypass                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010022                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010023 │          │              │                             │               │ glibc: running ldd on malicious ELF leads to code execution  │
│         │                  │          │              │                             │               │ because of...                                                │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010023                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010024 │          │              │                             │               │ glibc: ASLR bypass using cache of thread stack and heap      │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010024                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-1010025 │          │              │                             │               │ glibc: information disclosure of heap addresses of           │
│         │                  │          │              │                             │               │ pthread_created thread                                       │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010025                 │
│         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
│         │ CVE-2019-9192    │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
│         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-9192                    │
├─────────┼──────────────────┼──────────┤              ├─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
│ zlib1g  │ CVE-2026-27171   │ MEDIUM   │              │ 1:1.3.dfsg+really1.3.1-1+b1 │               │ zlib: zlib: Denial of Service via infinite loop in CRC32     │
│         │                  │          │              │                             │               │ combine functions...                                         │
│         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-27171                   │
└─────────┴──────────────────┴──────────┴──────────────┴─────────────────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘

OS Packages (license)
=====================
Total: 29 (UNKNOWN: 0, LOW: 11, MEDIUM: 0, HIGH: 18, CRITICAL: 0)

┌─────────────┬───────────────────┬────────────────┬──────────┐
│   Package   │      License      │ Classification │ Severity │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ base-files  │ GPL-2.0-or-later  │ restricted     │ HIGH     │
├─────────────┤                   │                │          │
│ gcc-14-base │                   │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-only      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Artistic-2.0      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ LGPL-2.0-or-later │ restricted     │ HIGH     │
├─────────────┼───────────────────┤                │          │
│ libc6       │ LGPL-2.1-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-or-later │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-or-later  │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-2.0-only      │                │          │
│             ├───────────────────┤                │          │
│             │ GPL-3.0-or-later  │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Unicode-DFS-2016  │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ BSL-1.0           │                │          │
│             ├───────────────────┤                │          │
│             │ BSD-2-Clause      │                │          │
│             ├───────────────────┤                │          │
│             │ ISC               │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-3.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ LGPL-2.0-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-2.1-only     │                │          │
│             ├───────────────────┤                │          │
│             │ LGPL-3.0-only     │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libssl3t64  │ Apache-2.0        │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ Artistic-2.0      │                │          │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-1.0-or-later  │ restricted     │ HIGH     │
│             ├───────────────────┤                │          │
│             │ GPL-1.0-only      │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ libzstd1    │ BSD-3-Clause      │ notice         │ LOW      │
│             ├───────────────────┼────────────────┼──────────┤
│             │ GPL-2.0-only      │ restricted     │ HIGH     │
│             ├───────────────────┼────────────────┼──────────┤
│             │ Zlib              │ notice         │ LOW      │
│             ├───────────────────┤                │          │
│             │ MIT               │                │          │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ netbase     │ GPL-2.0-only      │ restricted     │ HIGH     │
├─────────────┼───────────────────┼────────────────┼──────────┤
│ zlib1g      │ Zlib              │ notice         │ LOW      │
└─────────────┴───────────────────┴────────────────┴──────────┘

@doronkopit5 doronkopit5 changed the title Expose model provider header chore: Expose model provider header Apr 14, 2026
Comment thread .gitignore Outdated
Comment on lines +38 to +40
node_modules
package-lock.json
package.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you cargo run hub locally, it's generating bunch of dependencies garbage, don't belong in the repo imo?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure, doesn't happen for me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind 🤦 removed it

Comment thread src/pipelines/pipeline.rs Outdated
use reqwest_streams::error::StreamBodyError;
use std::sync::Arc;

const HEADER_PROVIDER: HeaderName = HeaderName::from_static("x-traceloop-provider");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets call it like the gen ai semantic convention
x-genai-provider/system i don't remember the right naming

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semconv is GEN_AI_PROVIDER_NAME= gen_ai.provider.name

x-genai-provider-name will do?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@doronkopit5
doronkopit5 marked this pull request as ready for review April 14, 2026 12:39

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/pipelines/pipeline.rs (1)

483-499: Add one streaming-header test.

ConfigurableMockProvider::chat_completions always returns NonStream, so the new assertions never hit the SSE response path on Lines 145-150. One ChatCompletionResponse::Stream case would keep header propagation for streamed responses from regressing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pipelines/pipeline.rs` around lines 483 - 499, The test never exercises
the SSE path because ConfigurableMockProvider::chat_completions always returns
ChatCompletionResponse::NonStream; update the mock to support a Stream case and
adjust the test to trigger it: modify ConfigurableMockProvider::chat_completions
to inspect a flag or the incoming ChatCompletionRequest (e.g., a "stream" field
or special test marker) and return ChatCompletionResponse::Stream yielding at
least one streaming ChatCompletion chunk, then add/modify the test to send that
marker so the code path handling ChatCompletionResponse::Stream (the SSE header
propagation logic) is executed; refer to ConfigurableMockProvider,
chat_completions, ChatCompletionResponse::Stream and the
ChatCompletion/streaming variants to locate and change the code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/pipelines/pipeline.rs`:
- Around line 483-499: The test never exercises the SSE path because
ConfigurableMockProvider::chat_completions always returns
ChatCompletionResponse::NonStream; update the mock to support a Stream case and
adjust the test to trigger it: modify ConfigurableMockProvider::chat_completions
to inspect a flag or the incoming ChatCompletionRequest (e.g., a "stream" field
or special test marker) and return ChatCompletionResponse::Stream yielding at
least one streaming ChatCompletion chunk, then add/modify the test to send that
marker so the code path handling ChatCompletionResponse::Stream (the SSE header
propagation logic) is executed; refer to ConfigurableMockProvider,
chat_completions, ChatCompletionResponse::Stream and the
ChatCompletion/streaming variants to locate and change the code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7748a73d-6550-45da-bbc6-8ee6742a0f22

📥 Commits

Reviewing files that changed from the base of the PR and between 95b5880 and bcd06ab.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .gitignore
  • src/pipelines/pipeline.rs
  • src/providers/registry.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/pipelines/pipeline.rs (2)

31-37: Don’t silently ignore header serialization failures.

At Line 32, HeaderValue::from_str(...) failures are dropped silently. Even if currently unlikely, this can hide regressions if ProviderType string formatting changes later. Please log a warning (or debug assertion in test/dev) on the Err path.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pipelines/pipeline.rs` around lines 31 - 37, The inject_provider_header
function currently drops errors from HeaderValue::from_str silently; update it
so the Err branch does not get ignored: when
HeaderValue::from_str(&provider_type.to_string()) returns Err, call a logger
(e.g., warn! or debug!) or invoke debug_assert! with the error/details so
failures are visible in dev/test, while preserving the existing successful path
that inserts into response.headers_mut().insert(HEADER_PROVIDER.clone(), value);
reference the inject_provider_header function, ProviderType,
HeaderValue::from_str, and response.headers_mut().insert when making the change.

488-499: Add explicit coverage for the streaming chat path header.

Current chat header tests use a mock that returns NonStream, so the SSE branch header injection (Line 146–150) is not validated. Add one test where chat_completions returns ChatCompletionResponse::Stream(...) and assert x-genai-provider-name is present.

Also applies to: 590-615

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pipelines/pipeline.rs` around lines 488 - 499, Add a test case that
exercises the SSE/streaming branch by making the mocked chat_completions return
crate::models::chat::ChatCompletionResponse::Stream(...) instead of NonStream;
in that test assert the response includes the SSE header "x-genai-provider-name"
(the same header verified for non-stream paths) to cover the header-injection
logic executed in the streaming path (the code that emits SSE events when
ChatCompletionResponse::Stream is returned). Ensure the mock uses a Stream
variant containing at least one event so the SSE path in pipeline.rs (the SSE
branch that sets the header) is executed and the assertion checks header
presence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/pipelines/pipeline.rs`:
- Around line 31-37: The inject_provider_header function currently drops errors
from HeaderValue::from_str silently; update it so the Err branch does not get
ignored: when HeaderValue::from_str(&provider_type.to_string()) returns Err,
call a logger (e.g., warn! or debug!) or invoke debug_assert! with the
error/details so failures are visible in dev/test, while preserving the existing
successful path that inserts into
response.headers_mut().insert(HEADER_PROVIDER.clone(), value); reference the
inject_provider_header function, ProviderType, HeaderValue::from_str, and
response.headers_mut().insert when making the change.
- Around line 488-499: Add a test case that exercises the SSE/streaming branch
by making the mocked chat_completions return
crate::models::chat::ChatCompletionResponse::Stream(...) instead of NonStream;
in that test assert the response includes the SSE header "x-genai-provider-name"
(the same header verified for non-stream paths) to cover the header-injection
logic executed in the streaming path (the code that emits SSE events when
ChatCompletionResponse::Stream is returned). Ensure the mock uses a Stream
variant containing at least one event so the SSE path in pipeline.rs (the SSE
branch that sets the header) is executed and the assertion checks header
presence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f65fc20-bdaf-478f-a4b0-a158bad611f6

📥 Commits

Reviewing files that changed from the base of the PR and between bcd06ab and dcd2dc1.

📒 Files selected for processing (1)
  • src/pipelines/pipeline.rs

@max-deygin-traceloop max-deygin-traceloop changed the title chore: Expose model provider header feat: Expose model provider header Apr 14, 2026
@max-deygin-traceloop
max-deygin-traceloop merged commit e8e0199 into main Apr 14, 2026
14 checks passed
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.

4 participants