feat(portal): allow editing Azure AI Foundry model - #1411
Open
Vv (dcaiwei) wants to merge 2 commits into
Open
Vv (dcaiwei) wants to merge 2 commits into
Vv (dcaiwei) wants to merge 2 commits into
Conversation
Author
|
@microsoft-github-policy-service agree |
Copilot started reviewing on behalf of
Wassim Chegham (manekinekko)
September 22, 2026 14:19
View session
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved backend consistency, validation, and data-safety issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Enables editing Azure AI Foundry model names while preserving credentials and triggering revalidation.
Changes:
- Adds backend model projection, updates, and validation handling.
- Adds Portal editing UI, tests, and Storybook demo.
- Updates shared types and documentation.
| File | Reviewed change |
|---|---|
packages/shared/src/token-manager/types.ts |
Extends shared key and update request types. |
docs/architecture/token-manager.md |
Documents model editing and validation behavior. |
apps/token-manager/src/routes.ts |
Handles model updates and background validation. |
apps/token-manager/src/foundry-model.ts |
Projects and updates Foundry model data. |
apps/token-manager/src/foundry-model.test.ts |
Tests Foundry model helpers. |
apps/portal/src/types.ts |
Adds frontend model types. |
apps/portal/src/pages/TokenDetail.tsx |
Adds model editing controls and polling behavior. |
apps/portal/src/pages/TokenDetail.test.ts |
Tests update request construction. |
apps/portal/src/pages/TokenDetail.stories.tsx |
Adds a synthetic editing demo. |
apps/portal/src/pages/token-detail-utils.ts |
Builds normalized update requests. |
apps/portal/src/lib/api.ts |
Documents the expanded update API. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+242
to
+246
| const updatedFoundrySecret = await updateFoundryModelSecret( | ||
| token, | ||
| body.model, | ||
| store | ||
| ); |
| .then(async (validation) => { | ||
| const now = new Date(); | ||
| await collection.updateOne( | ||
| { _id: result._id }, |
Comment on lines
+17
to
+20
| const parsed = parseAzureAiFoundrySecret( | ||
| await store.getSecret(token.secretName) | ||
| ); | ||
| return parsed?.model ? { ...token, model: parsed.model } : token; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Fixes #1386
Demo
Azure AI Foundry model edited from
gpt-4.1togpt-4.1-miniwith synthetic data, followed by background validation.9.22.mp4
Testing
pnpm exec vitest run packages/shared/src/token-manager/types.test.ts apps/token-manager/src/foundry-model.test.ts apps/portal/src/pages/TokenDetail.test.ts— passed (14 tests)pnpm --filter shared build— passedpnpm --filter telemetry build— passedpnpm --filter token-manager build— passedpnpm --filter portal lint— passedpnpm headers:check— passedgit diff --check— passedDocumentation and compatibility
Updated
docs/architecture/token-manager.md.The API changes are additive and backward-compatible. No database migration or dependency change is required.
Checklist
AI assistance was used while preparing this change. The implementation and test results were reviewed locally before submission.