Skip to content

feat(client): NemoClient platform provider + request-scoped FastAPI DI - #800

Merged
maxdubrinsky merged 6 commits into
mainfrom
aircore-904-add-nemoclient-fastapi-di/md
Aug 12, 2026
Merged

feat(client): NemoClient platform provider + request-scoped FastAPI DI#800
maxdubrinsky merged 6 commits into
mainfrom
aircore-904-add-nemoclient-fastapi-di/md

Conversation

@maxdubrinsky

@maxdubrinsky maxdubrinsky commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Consolidates the NemoClient foundation into one PR: the platform provider (AIRCORE-883) plus the request-scoped FastAPI DI seam (AIRCORE-904). This was previously split across #799 (provider) and #800 (DI, stacked on #799's branch). #800 is now retargeted to main and carries both halves; #799 is closed in favor of this PR.

Provider foundation (AIRCORE-883)

  • Plugin-side NemoClientProvider protocol with explicit override, entry-point discovery, and a zero-nmp-common env-var default (DefaultNemoClientProvider).
  • Platform provider (PlatformNemoClientProvider) backed by per-service URL routing, shared HTTP transports, request principal headers, and OTEL propagation.
  • Provider entry points registered in nmp-common and the bundled nemo-platform package.
  • Fails closed on broken/conflicting providers; OTEL context cannot replace authoritative identity headers.

Request-scoped DI (AIRCORE-904)

  • Canonical FastAPI get_nemo_client dependency + exact common-package re-export.
  • Fresh request-scoped AsyncNemoClient with current principal + trace headers, sharing one provider-owned transport.
  • DependencyProvider transport/SDK init made thread-safe and order-independent; provider-owned transport closed exactly once on shutdown.

How it's used (downstream)

In-process (service / middleware / controller), async:

from nemo_platform_plugin.client_provider import get_async_nemo_client
from nemo_platform_plugin.files import endpoints

client = get_async_nemo_client(as_service="data-designer", internal=True)
data = (await client.send(endpoints.download_file(name="fs", path="x.csv"))).read()

In a job's task container the same call falls back to the env-var DefaultNemoClientProvider (NMP_BASE_URL / NMP_PRINCIPAL injected by the jobs backend). The plugin imports only nemo_platform_plugin.client_provider — never nmp-common, never Stainless.

Per-service migration playbook: packages/nemo_platform_plugin/src/nemo_platform_plugin/client/MIGRATION.md.

Unblocks

  • Phase-2 consumer cleanup: swap client_from_platform(...) for Depends(get_nemo_client).
  • AIRCORE-882 (generate FastAPI routes from endpoints.py), AIRCORE-893 (CLI generator → typed clients).

Follow-up (not in this PR)

  • Typed-client ergonomics on the provider: a client_cls param so get_async_nemo_client(AsyncFilesClient) returns a typed client directly (today it returns a base client; use .send(endpoints.*)).
  • Ownership-aware client close() / context-manager support — AIRCORE-933.

Validation

  • Provider foundation: 81 focused provider + client-factory tests.
  • DI: 50 focused dependency, lifecycle, concurrency, and client-factory tests.
  • Ruff, formatting, git diff --check, focused ty, and wheel entry-point inspection passed. Independent adversarial review found no blocker on either half.
  • Full CI now runs against main (while stacked on a feature branch, most CI jobs were suppressed).

Linear: https://linear.app/nvidia/issue/AIRCORE-883 , https://linear.app/nvidia/issue/AIRCORE-904

Summary by CodeRabbit

  • New Features

    • Added configurable Nemo client providers with automatic discovery.
    • Added workspace-aware synchronous and asynchronous clients, including task-specific clients.
    • Added platform support for service routing, authentication, delegation, workload identity, and tracing.
    • Added request-scoped Nemo client dependency support for services.
  • Bug Fixes

    • Improved delegated identity and authentication header handling.
    • Prevented duplicate client and transport creation during concurrent requests.
    • Improved provider conflict detection and loading error reporting.
  • Tests

    • Expanded coverage for client creation, dependencies, provider resolution, concurrency, authentication, and lifecycle behavior.

@github-actions github-actions Bot added the feat label Jul 20, 2026
@maxdubrinsky maxdubrinsky changed the title feat(client): add request-scoped NemoClient dependency feat(client): NemoClient platform provider + request-scoped FastAPI DI Jul 21, 2026
@maxdubrinsky
maxdubrinsky changed the base branch from aircore-883-nemoclient-provider-foundation/md to main July 21, 2026 15:49
@maxdubrinsky maxdubrinsky reopened this Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 32233/40906 78.8% 63.7%
Integration Tests 18639/38832 48.0% 20.7%

@maxdubrinsky
maxdubrinsky marked this pull request as ready for review July 21, 2026 16:25
@maxdubrinsky
maxdubrinsky requested review from a team as code owners July 21, 2026 16:25
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Nemo client creation now resolves pluggable providers through entry points or explicit overrides. Platform factories support routing, authentication, workspace propagation, and task delegation. Service dependencies expose request-scoped clients with synchronized transport lifecycle management.

Changes

Nemo client provider flow

Layer / File(s) Summary
Provider contract and resolution
packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py, packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py, packages/nemo_platform_plugin/tests/*, packages/nemo_platform/pyproject.toml
Adds provider protocols, default providers, entry-point discovery, validation, caching, conflict handling, workspace forwarding, and resolution tests.
Platform client and task factories
packages/nmp_common/src/nmp/common/client_factory.py, packages/nmp_common/pyproject.toml, packages/nmp_common/tests/client_factory/*, packages/nemo_platform_plugin/tests/test_nemo_client_task_auth.py
Adds sync and async factories with endpoint routing, workspace paths, authentication, OTEL headers, workload-identity exchange, task delegation, and HTTP-client selection.
Request-scoped dependency wiring
packages/nemo_platform_plugin/src/nemo_platform_plugin/dependencies.py, packages/nmp_common/src/nmp/common/service/*, packages/nmp_common/tests/nmp_common/*, packages/nemo_platform_plugin/tests/test_dependencies.py
Adds the Nemo client dependency, FastAPI override wiring, synchronized transport creation, request-scoped client handling, and shutdown updates.

Sequence Diagram(s)

sequenceDiagram
  participant ServiceRequest
  participant FastAPI
  participant DependencyProvider
  participant PlatformNemoClientProvider
  participant AsyncNemoClient
  ServiceRequest->>FastAPI: resolve get_nemo_client
  FastAPI->>DependencyProvider: request-scoped client dependency
  DependencyProvider->>PlatformNemoClientProvider: create async client
  PlatformNemoClientProvider->>AsyncNemoClient: construct with workspace, headers, and routing
  AsyncNemoClient-->>FastAPI: return request-scoped client
  FastAPI-->>ServiceRequest: inject client
Loading

Possibly related PRs

Suggested reviewers: ironcommit

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.82% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the PR's two main changes: the NemoClient platform provider and request-scoped FastAPI dependency injection.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aircore-904-add-nemoclient-fastapi-di/md

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

@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)
packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py (1)

187-253: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract shared entry-point resolution helper. _resolve_provider is duplicated verbatim between the two files (dedup, deterministic-conflict RuntimeError, load/construct, protocol validation) — only the group name, protocol type, and default class differ. One shared helper avoids future divergence when either copy gets a bug fix, and is a natural place to add a lock around the scan+load+construct+cache sequence.

  • packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py#L187-L253: replace with a call to a shared _resolve_provider(group, protocol, default_factory, kind_label) helper.
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py#L298-L337: replace with a call to the same shared helper, passing "nemo.sdk_provider", SDKProvider, DefaultSDKProvider.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py`
around lines 187 - 253, Extract the duplicated entry-point resolution logic from
_resolve_provider in
packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py#L187-L253
and
packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py#L298-L337
into one shared _resolve_provider(group, protocol, default_factory, kind_label)
helper. Preserve deterministic conflict detection, entry-point loading and
construction, protocol validation, default fallback, caching, and add locking
around the scan/load/construct/cache sequence; update both providers to call it
with their respective group, protocol, and default factory.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py`:
- Around line 187-253: Extract the duplicated entry-point resolution logic from
_resolve_provider in
packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py#L187-L253
and
packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py#L298-L337
into one shared _resolve_provider(group, protocol, default_factory, kind_label)
helper. Preserve deterministic conflict detection, entry-point loading and
construction, protocol validation, default fallback, caching, and add locking
around the scan/load/construct/cache sequence; update both providers to call it
with their respective group, protocol, and default factory.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 72cf3fb6-a3a0-4a76-b118-1f0adb68251b

📥 Commits

Reviewing files that changed from the base of the PR and between 54983be and fa95fa3.

📒 Files selected for processing (14)
  • packages/nemo_platform/pyproject.toml
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/dependencies.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py
  • packages/nemo_platform_plugin/tests/test_client_provider.py
  • packages/nemo_platform_plugin/tests/test_dependencies.py
  • packages/nemo_platform_plugin/tests/test_sdk_provider.py
  • packages/nmp_common/pyproject.toml
  • packages/nmp_common/src/nmp/common/client_factory.py
  • packages/nmp_common/src/nmp/common/service/__init__.py
  • packages/nmp_common/src/nmp/common/service/base.py
  • packages/nmp_common/src/nmp/common/service/dependencies.py
  • packages/nmp_common/tests/client_factory/test_client_factory.py
  • packages/nmp_common/tests/nmp_common/test_common_service.py

Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
@maxdubrinsky
maxdubrinsky force-pushed the aircore-904-add-nemoclient-fastapi-di/md branch from fa95fa3 to fe224c3 Compare August 4, 2026 20:25
…ty, UDS)

The NemoClient providers advertised task-container support but had no
get_task_sdk() equivalent, so task callers lost job-creator delegation and
workload-identity auth, and the platform provider mis-routed UDS endpoints.

- Add get_task_nemo_client / get_async_task_nemo_client to the
  NemoClientProvider protocol and both providers, mirroring get_task_sdk:
  service:{name} + X-NMP-Principal-On-Behalf-Of* from NMP_PRINCIPAL, or
  workload-identity bearer-token exchange when NMP_WORKLOAD_IDENTITY_TOKEN_FILE
  is set (dropping trusted X-NMP-* headers). Generic get_nemo_client(as_service)
  stays undelegated on purpose for background controllers.
- Make the platform get_nemo_client / get_async_nemo_client workload-identity
  aware via _should_bootstrap_workload_identity, matching get_platform_sdk.
- Route UDS endpoints through resolve_platform_endpoint().connect_base_url and
  an endpoint-appropriate socket transport instead of the raw unix:// base_url
  and a generic shared TCP client.

Add regression tests for delegation, workload identity, and UDS transport.

Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/nemo_platform_plugin/tests/test_client_provider.py`:
- Around line 326-340: Update the _CapturingProvider test double in
test_public_functions_pass_workspace_through to implement the missing
get_task_nemo_client and get_async_task_nemo_client methods required by
NemoClientProvider. Match the existing client-provider method behavior and
return the appropriate NemoClient or AsyncNemoClient while preserving captured
kwargs.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6b3f8370-8af0-4185-87f3-394e904abccc

📥 Commits

Reviewing files that changed from the base of the PR and between f45c965 and ebbd012.

📒 Files selected for processing (16)
  • packages/nemo_platform/pyproject.toml
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/dependencies.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py
  • packages/nemo_platform_plugin/tests/test_client_provider.py
  • packages/nemo_platform_plugin/tests/test_dependencies.py
  • packages/nemo_platform_plugin/tests/test_nemo_client_task_auth.py
  • packages/nemo_platform_plugin/tests/test_sdk_provider.py
  • packages/nmp_common/pyproject.toml
  • packages/nmp_common/src/nmp/common/client_factory.py
  • packages/nmp_common/src/nmp/common/service/__init__.py
  • packages/nmp_common/src/nmp/common/service/base.py
  • packages/nmp_common/src/nmp/common/service/dependencies.py
  • packages/nmp_common/tests/client_factory/test_client_factory.py
  • packages/nmp_common/tests/nmp_common/test_common_service.py
  • packages/nmp_common/tests/nmp_common/test_dependency_provider.py
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/nemo_platform/pyproject.toml
  • packages/nmp_common/src/nmp/common/service/dependencies.py
  • packages/nmp_common/src/nmp/common/service/init.py
  • packages/nemo_platform_plugin/tests/test_dependencies.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/dependencies.py
  • packages/nmp_common/pyproject.toml
  • packages/nmp_common/src/nmp/common/service/base.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py

Comment thread packages/nemo_platform_plugin/tests/test_client_provider.py
get_http_client() hardcoded DefaultAsyncHttpxClient(), a TCP client, and
injected it into the SDK and NemoClient factories. Those factories skip
their own transport selection when a client is supplied, so under a
unix:// endpoint the request-scoped clients got the UDS base_url
(http://nemo-platform.local) paired with a TCP transport (_uds=None) and
service-to-service requests failed.

Build the cached client through resolve_platform_endpoint().async_sdk_http_client()
so it binds the socket on UDS and stays the default TCP client otherwise.
Add provider-layer UDS/TCP regression coverage.

Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/nmp_common/tests/nmp_common/test_dependency_provider.py`:
- Around line 39-53: Convert the provider-owned client tests to async tests and
await DependencyProvider.close() in each test’s finally block before calling
Configuration.clear_cache(). Apply this to
packages/nmp_common/tests/nmp_common/test_dependency_provider.py lines 39-53,
56-64, and 67-74, preserving each test’s existing assertions and setup.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6233d8c7-43b0-4149-a9dd-91a443eac717

📥 Commits

Reviewing files that changed from the base of the PR and between ebbd012 and 2e4b39c.

📒 Files selected for processing (3)
  • packages/nmp_common/src/nmp/common/service/base.py
  • packages/nmp_common/tests/nmp_common/test_common_service.py
  • packages/nmp_common/tests/nmp_common/test_dependency_provider.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/nmp_common/src/nmp/common/service/base.py

Comment thread packages/nmp_common/tests/nmp_common/test_dependency_provider.py
@maxdubrinsky
maxdubrinsky added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
@maxdubrinsky
maxdubrinsky added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
@maxdubrinsky
maxdubrinsky enabled auto-merge August 12, 2026 17:55
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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.

Actionable comments posted: 2

🧹 Nitpick comments (3)
packages/nmp_common/src/nmp/common/client_factory.py (1)

21-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use concrete runtime annotations.

Remove postponed annotations. All referenced types are available at runtime.

  • packages/nmp_common/src/nmp/common/client_factory.py#L21-L21: remove from __future__ import annotations.
  • packages/nemo_platform_plugin/tests/test_nemo_client_task_auth.py#L14-L14: remove from __future__ import annotations.

As per coding guidelines: “Prefer concrete type hints over string-based annotations.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/nmp_common/src/nmp/common/client_factory.py` at line 21, Remove the
postponed-annotations import from client_factory.py and
test_nemo_client_task_auth.py so their type annotations are evaluated concretely
at runtime; no other changes are required.

Source: Coding guidelines

packages/nmp_common/tests/nmp_common/test_dependency_provider.py (1)

34-36: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

No shared helper for httpx UDS inspection. Both files reach into the private chain _transport._pool._uds to assert socket binding. An httpx internal rename breaks every site independently.

  • packages/nmp_common/tests/nmp_common/test_dependency_provider.py#L34-L36: move _uds_of into a shared test helper module so other packages can import it.
  • packages/nmp_common/tests/client_factory/test_client_factory.py#L374-L388: replace the two inline transport._pool._uds traversals with the shared _uds_of helper.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/nmp_common/tests/nmp_common/test_dependency_provider.py` around
lines 34 - 36, Move the _uds_of helper from
packages/nmp_common/tests/nmp_common/test_dependency_provider.py:34-36 into a
shared test helper module and update imports accordingly. In
packages/nmp_common/tests/client_factory/test_client_factory.py:374-388, replace
both direct transport._pool._uds traversals with _uds_of, preserving the
existing assertions.
packages/nemo_platform_plugin/tests/test_sdk_provider.py (1)

253-271: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

_FakeEntryPoint duplicates the identical class in packages/nemo_platform_plugin/tests/test_client_provider.py (lines 183-200). Both live in the same test package. Move it to conftest.py and import it in both modules.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/nemo_platform_plugin/tests/test_sdk_provider.py` around lines 253 -
271, Move the shared _FakeEntryPoint test helper from test_sdk_provider.py into
the package conftest.py, preserving its constructor fields and load() behavior.
Import and reuse that conftest definition in both test_sdk_provider.py and
test_client_provider.py, removing their duplicate local class definitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/nmp_common/tests/client_factory/test_client_factory.py`:
- Around line 173-193: Update the internal-header assertions in
test_merges_otel_propagation_headers_without_adding_internal_auth and
test_explicit_auth_headers_win_over_conflicting_otel_context to compare header
names case-insensitively. Assert that no key whose lowercase form is
x-nmp-internal remains in the first test, and that only the expected internal
value is present without any conflicting casing variant in the second.

In `@packages/nmp_common/tests/nmp_common/test_dependency_provider.py`:
- Around line 87-94: The test exercising shared HTTP client injection must close
the materialized transport. Convert the test containing
provider.get_http_client() to async, add the project’s pytest asyncio marker,
and await provider.close() after the existing assertions.

---

Nitpick comments:
In `@packages/nemo_platform_plugin/tests/test_sdk_provider.py`:
- Around line 253-271: Move the shared _FakeEntryPoint test helper from
test_sdk_provider.py into the package conftest.py, preserving its constructor
fields and load() behavior. Import and reuse that conftest definition in both
test_sdk_provider.py and test_client_provider.py, removing their duplicate local
class definitions.

In `@packages/nmp_common/src/nmp/common/client_factory.py`:
- Line 21: Remove the postponed-annotations import from client_factory.py and
test_nemo_client_task_auth.py so their type annotations are evaluated concretely
at runtime; no other changes are required.

In `@packages/nmp_common/tests/nmp_common/test_dependency_provider.py`:
- Around line 34-36: Move the _uds_of helper from
packages/nmp_common/tests/nmp_common/test_dependency_provider.py:34-36 into a
shared test helper module and update imports accordingly. In
packages/nmp_common/tests/client_factory/test_client_factory.py:374-388, replace
both direct transport._pool._uds traversals with _uds_of, preserving the
existing assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: df78cd4b-728b-4365-a270-1c453e57271a

📥 Commits

Reviewing files that changed from the base of the PR and between d4b8171 and 40031df.

📒 Files selected for processing (16)
  • packages/nemo_platform/pyproject.toml
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/dependencies.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py
  • packages/nemo_platform_plugin/tests/test_client_provider.py
  • packages/nemo_platform_plugin/tests/test_dependencies.py
  • packages/nemo_platform_plugin/tests/test_nemo_client_task_auth.py
  • packages/nemo_platform_plugin/tests/test_sdk_provider.py
  • packages/nmp_common/pyproject.toml
  • packages/nmp_common/src/nmp/common/client_factory.py
  • packages/nmp_common/src/nmp/common/service/__init__.py
  • packages/nmp_common/src/nmp/common/service/base.py
  • packages/nmp_common/src/nmp/common/service/dependencies.py
  • packages/nmp_common/tests/client_factory/test_client_factory.py
  • packages/nmp_common/tests/nmp_common/test_common_service.py
  • packages/nmp_common/tests/nmp_common/test_dependency_provider.py
🚧 Files skipped from review as they are similar to previous changes (9)
  • packages/nmp_common/src/nmp/common/service/dependencies.py
  • packages/nmp_common/pyproject.toml
  • packages/nmp_common/src/nmp/common/service/init.py
  • packages/nemo_platform/pyproject.toml
  • packages/nemo_platform_plugin/tests/test_dependencies.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/sdk_provider.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/dependencies.py
  • packages/nmp_common/src/nmp/common/service/base.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/client_provider.py

Comment thread packages/nmp_common/tests/client_factory/test_client_factory.py
Comment thread packages/nmp_common/tests/nmp_common/test_dependency_provider.py
@maxdubrinsky
maxdubrinsky added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 320c34e Aug 12, 2026
97 of 99 checks passed
@maxdubrinsky
maxdubrinsky deleted the aircore-904-add-nemoclient-fastapi-di/md branch August 12, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants