Skip to content

fix(designer): Use actual model name for deploymentModelProperties#9054

Merged
Elaina-Lee merged 5 commits intomainfrom
fix/agent-deployment-model-properties-name
Apr 13, 2026
Merged

fix(designer): Use actual model name for deploymentModelProperties#9054
Elaina-Lee merged 5 commits intomainfrom
fix/agent-deployment-model-properties-name

Conversation

@Elaina-Lee
Copy link
Copy Markdown
Contributor

@Elaina-Lee Elaina-Lee commented Apr 13, 2026

Commit Type

  • fix - Bug fix

Risk Level

  • Medium - Moderate changes, some user impact

What & Why

PRs #9012 and #9028 regressed #8965 in two ways:

  1. onValueChange handler: Used the deployment ID (selectedModelId) directly as deploymentModelProperties.name and as the key for AGENT_MODEL_CONFIG lookup. Since AGENT_MODEL_CONFIG is keyed by model names (e.g., "gpt-4.1"), not deployment names (e.g., "my-gpt4-deployment"), the lookup fails and incorrect values are written.

  2. Auto-connection flow: updateConnectionAndDeployment (called by dynamicallyLoadAgentConnection when model type switches) only set deploymentId but never populated deploymentModelProperties. Since onValueChange only fires on manual dropdown changes, the model properties were missing when the deployment was auto-populated.

Fixes:

  • Restore PR feat(designer): Add Foundry Models (Preview) agent model source #8965's approach in onValueChange: look up the deployment object from deploymentsForCognitiveServiceAccount to extract the actual model name, format, and version from deployment.properties.model, falling back to AGENT_MODEL_CONFIG[modelName] only when the deployment doesn't provide format/version.
  • Add getFirstDeploymentInfo helper that returns full deployment info (name, model name, format, version).
  • Update updateConnectionAndDeployment to also populate deploymentModelProperties for MicrosoftFoundry during auto-connection setup.

Applied to both designer v1 and v2.

Impact of Change

  • Users: MicrosoftFoundry agent deployments now correctly populate deploymentModelProperties.name with the actual model name instead of the deployment ID, in both manual dropdown changes and auto-connection setup flows
  • Developers: No API changes. Note: .claude/settings.local.json was accidentally included in earlier commits and has been removed — it contained local paths/commands and no secrets or tokens.
  • System: No performance or architecture impact

Test Plan

  • Unit tests added/updated
    • libs/designer-v2/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/__test__/helpers.spec.ts
    • libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/__test__/helpers.spec.ts
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:
    • Select MicrosoftFoundry model type, verify deploymentModelProperties is auto-populated with correct model name/format/version
    • Manually change deployment dropdown, verify deploymentModelProperties.name is the actual model name (e.g., "gpt-4.1"), NOT the deployment ID
    • Verify AzureOpenAI model type still works (no deploymentModelProperties populated — backend handles it)
    • Test in both designer v1 and v2

Contributors

Screenshots/Videos

🤖 Generated with Claude Code

…stead of deployment ID

PRs #9012 and #9028 regressed #8965 by using the deployment ID (selectedModelId)
directly as the model name and for AGENT_MODEL_CONFIG lookup. Since the config is
keyed by model names (e.g. "gpt-4.1"), not deployment names (e.g. "my-gpt4-deployment"),
the lookup would fail and deploymentModelProperties.name was set to the deployment ID.

This restores PR #8965's approach: look up the deployment object from
deploymentsForCognitiveServiceAccount to get the actual model name, format, and
version from deployment.properties.model, falling back to AGENT_MODEL_CONFIG only
when the deployment doesn't provide format/version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 13, 2026 20:41
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(designer): Use actual model name for deploymentModelProperties
  • Issue: None — title is clear, follows conventional commit style and explains what is fixed.
  • Recommendation: Keep as-is. If you want more context you can add v1/v2 scope, but not required.

Commit Type

  • Properly selected (fix).
  • Only one option selected which is correct.

Risk Level

  • The PR body marks Medium and the repository labels include risk:medium.
  • Assessment: The change touches connection/deployment handling across designer v1 and v2 and updates how model properties are populated — Medium is appropriate.

What & Why

  • Current: PR includes a clear What & Why describing the regression and the steps taken to fix it.
  • Issue: None — the explanation is concise and links the regression to prior PRs and the intended behavior.
  • Recommendation: No change needed.

Impact of Change

  • Impact is documented for Users/Developers/System.
  • Recommendation: Good. One small note: you mentioned .claude/settings.local.json was removed — consider adding the explicit commit or file path in the description for traceability (optional).
    • Users: MicrosoftFoundry agent deployments now correctly populate deploymentModelProperties with the actual model name/format/version.
    • Developers: No API changes; note about accidental local file included and removed is helpful.
    • System: No performance or architectural changes.

Test Plan

  • Unit tests are claimed and verified in the code diff: tests were added/updated in both designer and designer-v2 test files referenced in the PR body. This matches the PR claim.
  • E2E tests: none added — acceptable for this change but consider adding an E2E in future if this flow is critical to user scenarios.
  • Manual testing: marked completed. One actionable suggestion: fill the "Tested in:" checklist (select the appropriate boxes or add a short note with results) so reviewers know exactly which scenarios were validated manually.

⚠️ Contributors

  • Current: Blank
  • Assessment: Optional, but it's recommended to list any PMs/designers/reviewers who contributed ideas or testing so contributors get credit.
  • Recommendation: Add any contributors or keep blank if none — no failing requirement.

⚠️ Screenshots/Videos

  • Current: Blank
  • Assessment: Visual changes are not obvious from the diff; screenshots are optional. This is acceptable.
  • Recommendation: Add screenshots only if the UI behavior visible to users changed significantly during manual testing.

Summary Table

Section Status Recommendation
Title Keep as-is — clear and conventional commit style.
Commit Type Properly selected (fix).
Risk Level Medium is appropriate and matches label.
What & Why Clear and sufficient.
Impact of Change Good; optionally cite the removal commit for the local file.
Test Plan Unit tests present and verified. Fill the "Tested in:" checklist or add short results.
Contributors ⚠️ Optional: add credits if applicable.
Screenshots/Videos ⚠️ Optional: add only if UI changes are visible.

Final message:
This PR passes the PR title/body validation. The advised risk level (medium) matches the PR label and the change surface in the diff. The unit tests you referenced were found in the diff and cover the new helper functions. Please consider the two small recommendations before merge:

  1. Fill out the "Tested in:" checklist or add a short note describing which environments/flows you manually validated (this helps release engineers and reviewers confirm manual QA coverage).
  2. Add contributor credits in the Contributors section if anyone else (PMs, designers, reviewers) helped with testing/review.
  3. Optionally reference the commit that removed .claude/settings.local.json in the body for traceability (or confirm that removal is in the PR commits).

Thank you — this PR is ready from a PR title/body perspective. Good job including unit tests and a clear description of the bug and the fix!


Last updated: Mon, 13 Apr 2026 23:07:47 GMT

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes a regression where MicrosoftFoundry deploymentModelProperties incorrectly used the deployment ID as the model name, causing AGENT_MODEL_CONFIG lookups (keyed by model name) to fail.

Changes:

  • Resolve the real model name/format/version from the selected deployment’s properties.model instead of using selectedModelId.
  • Add fallback logic to AGENT_MODEL_CONFIG[modelName] only when the deployment doesn’t provide format/version.
  • Apply the fix in both designer v1 and designer v2.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/index.tsx Lookup deployment by name to derive true model metadata; fallback to AGENT_MODEL_CONFIG for missing fields.
libs/designer-v2/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/index.tsx Same deployment-based model metadata derivation and fallback logic as v1.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

📊 Coverage Check

🎉 All changed files have adequate test coverage!

…ion setup

The auto-connection flow (dynamicallyLoadAgentConnection → updateConnectionAndDeployment)
only set deploymentId but never populated deploymentModelProperties. Since onValueChange
only fires on manual dropdown changes, the model properties were missing when the
deployment was auto-populated.

Now updateConnectionAndDeployment also sets deploymentModelProperties (name, format,
version) for MicrosoftFoundry by using getFirstDeploymentInfo to extract the actual
model info from the deployment object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Elaina-Lee Elaina-Lee added risk:low Low risk change with minimal impact and removed needs-pr-update labels Apr 13, 2026
…tDeploymentModelName

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Elaina-Lee Elaina-Lee force-pushed the fix/agent-deployment-model-properties-name branch from 9d20d73 to 05fe862 Compare April 13, 2026 22:41
@Elaina-Lee Elaina-Lee added risk:medium Medium risk change with potential impact and removed risk:low Low risk change with minimal impact needs-pr-update labels Apr 13, 2026
Elaina-Lee and others added 2 commits April 13, 2026 15:58
…gnore

The file contained local paths and allowed shell commands specific to
a developer's machine. Added .claude/settings.local.json to .gitignore
to prevent future accidental commits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Elaina-Lee Elaina-Lee enabled auto-merge (squash) April 13, 2026 23:41
@Elaina-Lee Elaina-Lee merged commit e52eb73 into main Apr 13, 2026
14 of 16 checks passed
@Elaina-Lee Elaina-Lee deleted the fix/agent-deployment-model-properties-name branch April 13, 2026 23:41
Elaina-Lee added a commit that referenced this pull request Apr 13, 2026
…9054)

* fix(designer): Use actual model name for deploymentModelProperties instead of deployment ID

PRs #9012 and #9028 regressed #8965 by using the deployment ID (selectedModelId)
directly as the model name and for AGENT_MODEL_CONFIG lookup. Since the config is
keyed by model names (e.g. "gpt-4.1"), not deployment names (e.g. "my-gpt4-deployment"),
the lookup would fail and deploymentModelProperties.name was set to the deployment ID.

This restores PR #8965's approach: look up the deployment object from
deploymentsForCognitiveServiceAccount to get the actual model name, format, and
version from deployment.properties.model, falling back to AGENT_MODEL_CONFIG only
when the deployment doesn't provide format/version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(designer): Populate deploymentModelProperties during auto-connection setup

The auto-connection flow (dynamicallyLoadAgentConnection → updateConnectionAndDeployment)
only set deploymentId but never populated deploymentModelProperties. Since onValueChange
only fires on manual dropdown changes, the model properties were missing when the
deployment was auto-populated.

Now updateConnectionAndDeployment also sets deploymentModelProperties (name, format,
version) for MicrosoftFoundry by using getFirstDeploymentInfo to extract the actual
model info from the deployment object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(designer): Add unit tests for getFirstDeploymentInfo and getFirstDeploymentModelName

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: Remove accidental .claude/settings.local.json and add to .gitignore

The file contained local paths and allowed shell commands specific to
a developer's machine. Added .claude/settings.local.json to .gitignore
to prevent future accidental commits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* remove changes

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Elaina-Lee added a commit that referenced this pull request Apr 14, 2026
…9054) (#9056)

* fix(designer): Use actual model name for deploymentModelProperties instead of deployment ID

PRs #9012 and #9028 regressed #8965 by using the deployment ID (selectedModelId)
directly as the model name and for AGENT_MODEL_CONFIG lookup. Since the config is
keyed by model names (e.g. "gpt-4.1"), not deployment names (e.g. "my-gpt4-deployment"),
the lookup would fail and deploymentModelProperties.name was set to the deployment ID.

This restores PR #8965's approach: look up the deployment object from
deploymentsForCognitiveServiceAccount to get the actual model name, format, and
version from deployment.properties.model, falling back to AGENT_MODEL_CONFIG only
when the deployment doesn't provide format/version.



* fix(designer): Populate deploymentModelProperties during auto-connection setup

The auto-connection flow (dynamicallyLoadAgentConnection → updateConnectionAndDeployment)
only set deploymentId but never populated deploymentModelProperties. Since onValueChange
only fires on manual dropdown changes, the model properties were missing when the
deployment was auto-populated.

Now updateConnectionAndDeployment also sets deploymentModelProperties (name, format,
version) for MicrosoftFoundry by using getFirstDeploymentInfo to extract the actual
model info from the deployment object.



* test(designer): Add unit tests for getFirstDeploymentInfo and getFirstDeploymentModelName



* chore: Remove accidental .claude/settings.local.json and add to .gitignore

The file contained local paths and allowed shell commands specific to
a developer's machine. Added .claude/settings.local.json to .gitignore
to prevent future accidental commits.



* remove changes

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants