Skip to content

refactor(cli): run nemo setup on typed clients - #2003

Draft
maxdubrinsky wants to merge 1 commit into
mainfrom
cli-setup-typed-clients/mdubrinsky
Draft

maxdubrinsky wants to merge 1 commit into
mainfrom
cli-setup-typed-clients/mdubrinsky

Conversation

@maxdubrinsky

@maxdubrinsky maxdubrinsky commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Run nemo setup on the typed clients (SetupClients: models, secrets, inference gateway) instead of a NeMoPlatform instance. Same prompts, same created entities, same idempotency on re-run.

Part of the series moving the nemo CLI off the Stainless SDK onto the typed clients in nemo_platform_plugin (plumbing landed in #1986; #2004 is the final flip).

Changes

  • cli/commands/setup.py: SetupClients built from the CLI context; each step calls the typed client it needs; errors map through the shared errors module.
  • Two deliberate differences: model discovery walks every page of the provider's models (the generated client returned only the first page), and the provider request body is built inside the telemetry try so a locally invalid provider name emits the same ERROR event a server rejection does.
  • tests/cli/commands/test_setup_wire.py drives setup against a recorded httpx.MockTransport, asserting on raw_path so percent-encoded segments are visible. The Kind e2e builds SetupClients from its SDK handle with client_from_platform.

Related Issue

AIRCORE-893

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with documentation updates
  • Documentation only
  • Contributor tooling or automation
  • CI, build, or test infrastructure

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Documentation updated for user-visible behavior
  • Documentation not applicable — justification: no user-visible change to the setup flow.

Verification

  • Pull request title follows the repository's Conventional Commit format
  • Every commit includes an appropriate Signed-off-by: trailer
  • uv run pre-commit run -a passes, or any blocked checks are identified below
  • Targeted tests pass, or tests are marked not applicable above
  • No secrets, API keys, or credentials are included

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 44668/56634 78.9% 62.6%
Integration Tests 27728/53892 51.4% 22.6%

@maxdubrinsky
maxdubrinsky force-pushed the cli-setup-typed-clients/mdubrinsky branch 7 times, most recently from 0010470 to 4fbf3c5 Compare September 14, 2026 19:51
setup builds a frozen SetupClients bundle (ModelsClient, SecretsClient,
InferenceGatewayClient) from the CLI context instead of walking the
generated SDK's resource tree, so the wizard no longer depends on
nemo_platform for provider, secret and gateway readiness calls. The same
probes, prompts, telemetry events and error paths, with two deliberate
differences: model discovery walks every page of the provider's models
instead of the first page the generated client returned, and the provider
request body is built inside the telemetry try block, so a locally invalid
provider name emits the same ERROR event a server rejection does.

Adds wire-level tests for the setup calls over a recorded transport and
retargets the onboarding telemetry tests at the typed bundle.

The Kind e2e for auto model selection drove _run_auto_mode with a raw
NeMoPlatform handle; it now builds SetupClients from the same handle with
client_from_platform, as the rest of the e2e suite already does.

The wire recorder asserts on raw_path so percent-encoded segments (the
gateway's trailing_uri) are visible to the tests instead of being decoded
away by httpx.

Signed-off-by: Max Dubrinsky <[email protected]>
@maxdubrinsky
maxdubrinsky force-pushed the cli-setup-typed-clients/mdubrinsky branch from 4fbf3c5 to ef5d732 Compare September 15, 2026 17:33
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.

1 participant