Skip to content

feat(studio): return the resolved deployment from useModelDeploymentStatus - #1882

Draft
aray12 wants to merge 1 commit into
mainfrom
deployment-identity-hook/alray
Draft

feat(studio): return the resolved deployment from useModelDeploymentStatus#1882
aray12 wants to merge 1 commit into
mainfrom
deployment-identity-hook/alray

Conversation

@aray12

@aray12 aray12 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

useModelDeploymentStatus already walked model_providers → ModelProvider → ModelDeployment and fetched the whole deployment object, then returned only { status, isLoading }. Nothing in Studio could name the deployment serving a model, because the one place that knew threw it away.

This returns the deployment alongside its status. No new request — both additions come from data the hook had already resolved.

Changes

  • Add deployment and deploymentRef to the hook's return value.
  • Wire ModelPanel's deployment prop from the Base Models route.
  • Add the hook's first test file.

Why this matters

The only "where is it deployed" affordance that ships today (FilesetMetadataPanel) links to the deployments list page and leaves the user to find the row. getWorkspaceDeploymentDetailsRoute needs a deployment name, and no hook surfaced one — so no model-side UI could link to a specific deployment.

deploymentRef mirrors the arguments the deployment query was issued with, so a caller building a link cannot drift from what was actually fetched. It is populated as soon as the provider names a deployment — before the deployment itself has loaded — so a link can render without waiting on the second request.

Dead UI now renders

ModelPanel has accepted a deployment?: ModelDeployment | null prop since it was written, driving a status dot and a Status row. No caller ever passed it, so that UI was unreachable. The Base Models route now supplies it.

Backward compatibility

Both existing consumers — useModelChatAvailability and DeploymentIndicator — destructure only status and isLoading, so they are unaffected.

Base

Targets main directly. This is the bottom of stack #1914 — the only genuine dependency edge in the original series. Both #1893 (Deploy CTA) and #1894 (Deployment column) fail to compile without the deploymentRef this PR adds:

Property 'deploymentRef' does not exist on type '{ status: ModelDeploymentStatus | null; isLoading: boolean; }'

Note that #1893 and #1894 depend on this PR but not on each other — they touch no file in common, and #1894 typechecks and passes its tests with only this PR applied. They are stacked sequentially for convenience, not necessity, and can be reviewed in either order.

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: internal hook contract; the only user-visible effect is a status row that was already designed and built.

New useModelDeploymentStatus/index.test.tsx covers: the no-providers case, the full provider→deployment walk, a provider naming no deployment, a cross-workspace deployment reference, and the render-early contract for deploymentRef.

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

Targeted validation:

  • pnpm --filter nemo-studio-ui test src/hooks/useModelDeploymentStatus — 5 tests passed (new file)
  • pnpm --filter nemo-studio-ui test src/hooks src/routes/WorkspaceBaseModelsRoute src/components/dataViews/CustomModelsDataView src/components/sidePanels/ModelPanels — 10 files, 72 tests passed
  • pnpm --filter nemo-studio-ui typecheck — clean
  • pnpm --filter nemo-studio-ui lint:fix — clean
  • uv run pre-commit run -a not run in full; the commit-scoped pre-commit hooks ran and passed on commit.

@github-actions github-actions Bot added the feat label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 39110/50081 78.1% 62.2%
Integration Tests 23793/47309 50.3% 23.0%

@aray12
aray12 force-pushed the deployment-identity-hook/alray branch from 696311c to abccfdf Compare September 9, 2026 19:17
@aray12
aray12 removed this pull request from stack #1883 September 9, 2026 19:18
@aray12
aray12 changed the base branch from models-naming/alray to deployments-tab-order/alray September 9, 2026 19:18
@aray12
aray12 added this pull request to stack #1909 September 9, 2026 19:19
…tatus

The hook already walked model_providers -> ModelProvider -> ModelDeployment
and fetched the whole deployment object, then returned only
`{ status, isLoading }`. Nothing in Studio could name the deployment serving a
model, because the one place that knew threw it away.

That gap is why the only "where is it deployed" affordance that ships today
(FilesetMetadataPanel) links to the deployments *list* and leaves the user to
find the row, and why `getWorkspaceDeploymentDetailsRoute` — which needs a
deployment name — has no caller reachable from a model.

Adds `deployment` and `deploymentRef` to the return value. No new request:
both come from data the hook had already resolved. `deploymentRef` mirrors the
arguments the deployment query was issued with, so a caller building a link
cannot drift from what was actually fetched, and it is populated as soon as
the provider names a deployment — before the deployment itself has loaded — so
a link can render without waiting.

Both existing consumers (useModelChatAvailability, DeploymentIndicator)
destructure only `status` and `isLoading`, so they are unaffected.

Wires up ModelPanel's `deployment` prop from the Base Models route. The prop
has existed since the panel was written and drives a status dot and a Status
row, but no caller ever passed it, so that UI was dead. It now renders.

Adds the hook's first test file, covering the no-providers case, the full
walk, the provider-named-no-deployment case, a cross-workspace deployment
reference, and the render-early contract for `deploymentRef`.

Signed-off-by: Alex Ray <alray@nvidia.com>
@aray12
aray12 removed this pull request from stack #1909 September 9, 2026 20:11
@aray12
aray12 force-pushed the deployment-identity-hook/alray branch from abccfdf to c62e450 Compare September 9, 2026 20:11
@aray12
aray12 changed the base branch from deployments-tab-order/alray to main September 9, 2026 20:11
@aray12
aray12 added this pull request to stack #1914 September 9, 2026 20:12
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