Refactor/foundry service use httpclient#8880
Conversation
…entService Replace the custom foundryRequest wrapper (raw fetch + AbortController) with the shared IHttpClient abstraction used by all other services. This gives Foundry API calls consistent retry (axios-retry), error handling, and request patterns. - Add getHttpClient() to ICognitiveServiceService and BaseCognitiveServiceService - Refactor all foundryAgentService functions to accept IHttpClient as first param - Use httpClient.get/post with noAuth:true and custom Bearer headers - Update callers in designer and designer-v2 (useCognitiveService, foundryUpdates) - Update all tests to mock IHttpClient instead of globalThis.fetch Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the Tools label, summary text, toolsList style, and related tests from the Foundry agent inline details component. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… dropdown - Remove portal link rendering from FoundryAgentDetails component - Add FoundryPortalLink component in parametersTab (designer + designer-v2) - Change label to lowercase "Edit in foundry portal" - Fix duplicate NavigateIcon export; re-export useFoundryAgentDetailsStyles - Update tests to cover buildFoundryPortalUrl instead of removed UI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:❌ PR Title
❌ Commit Type
❌ Risk Level
❌ What & Why
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ❌ | Use an imperative, descriptive title. Example: Refactor: Use shared IHttpClient for Foundry service and add Foundry agent versioning support |
| Commit Type | ❌ | Select a single commit type in the PR body; likely refactor or feature |
| Risk Level | ❌ | Add risk:high label and select High in PR body (advised: High) |
| What & Why | ❌ | Add a short What & Why section describing intent and reason (see examples above) |
| Impact of Change | Describe Users/Developers/System impacts, migration steps, and runtime expectations | |
| Test Plan | ✅ | Tick Unit tests added/updated and add short manual test summary; add E2E if applicable |
| Contributors | Add contributors if applicable (optional but recommended) | |
| Screenshots/Videos | Add if UI changes are significant (optional) |
Final message:
Please update the PR title and body as recommended above, add a risk label (recommended risk:high), and mark the appropriate commit type and test plan checkboxes. Highlights to update in the PR body:
- Commit Type: check
refactor(orfeatureif you consider new user-facing behavior). - Risk Level: check
Highand add labelrisk:highto the PR. - What & Why: add the suggested short description (one paragraph each).
- Impact of Change: fill in Users/Developers/System bullets (use the suggested text or refine it to be specific to your changes).
- Test Plan: check
Unit tests added/updatedand add a brief manual testing summary. Mention the main test files you updated.
Once you update the PR body and add the risk label, please re-request review. If you intended this to be lower risk, include reasoning (test coverage, limited runtime surface) and we will reconsider the advised risk level.
Last updated: Thu, 05 Mar 2026 17:32:14 GMT
📊 Coverage CheckThe following changed files need attention:
Please add tests for the uncovered files before merging. |
…, and post-save refresh - Add version picker dropdown to FoundryAgentDetails with auto-select of latest version on first load and stored version restoration - Add listFoundryAgentVersions API with data-plane + portal BFF fallback and resilient response parsing (extractVersionsData) - Add foundryAgentVersionNumber internal parameter to agent loop manifest - Add useFoundryAgentVersions React Query hook in both designer packages - Wire version change to update model, instructions, and portal link - Add post-save version refresh: flushPendingFoundryUpdates tracks flushed nodes, onFlushed callback invalidates versions cache - Refactor CognitiveServiceService: replace getHttpClient() getter with readonly httpClient property to match standard service pattern - Add 35 foundry service tests, 9 UI tests, and foundryUpdates tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s on initial load On first agent load, the version number and system instructions were not written to the workflow parameters, causing validation errors (empty system message content). The initial-load effect now writes both foundryAgentVersionNumber and syncs instructions into the messages parameter alongside user instructions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… warning - Use useRef flag for one-shot initial version sync instead of state guard that could race with batched Redux dispatches - Add value and selectedOptions props to disabled version dropdown to prevent uncontrolled-to-controlled transition Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Foundry code - Add needsVersionRefresh() to check flag without consuming it - Only consume flag after confirming new version differs from stored - Extract shared helpers: useFoundryConnectionResourceId, getFoundryServiceContext - Simplify foundryAgentService query params and extractVersionsData - Update tests for needsVersionRefresh behavior in both designer packages Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| /** Normalize the project endpoint to the Foundry data-plane host. */ | ||
| function normalizeEndpoint(projectEndpoint: string): string { | ||
| const base = projectEndpoint.endsWith('/') ? projectEndpoint.replace(/\/+$/, '') : projectEndpoint; | ||
| const base = projectEndpoint.replace(/\/+$/, ''); |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
… fix ReDoS and portal URL fallback - Version selection no longer queues a Foundry agent update API call - Portal URL omits ?version= when no version is selected (defaults to latest) - Fix polynomial regex in buildProjectEndpointFromResourceId (greedy [^/]+) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ctor/foundry-service-use-httpclient
Commit Type
Risk Level
What & Why
Impact of Change
Test Plan
Contributors
Screenshots/Videos