Commit 6dda155
feat(designer): Foundry Agent Service httpClient migration, version picker, and bug fixes (#8886)
* refactor(designer): replace raw fetch() with IHttpClient in foundryAgentService
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>
* fix(designer-ui): remove Tools section from FoundryAgentDetails panel
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>
* refactor(designer-ui): move "Edit in foundry portal" link below agent 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>
* feat(designer): add Foundry agent version picker, httpClient refactor, 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>
* fix(designer): sync version number and instructions to workflow params 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>
* fix(designer): prevent infinite update loop and uncontrolled dropdown 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>
* fix(designer): fix consumeVersionRefresh race condition and simplify 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>
* fix(designer): remove unnecessary Foundry API call on version change, 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>
* fix(designer): persist Foundry version change to workflow parameters
The version picker dropdown was not updating the serialized workflow
when changing versions. Two issues were fixed:
1. Type mismatch in handleVersionSelect: strict equality failed when
the API returned version as a number but the dropdown provided a
string. Added String() coercion for the comparison.
2. Stale preservedValue blocking serialization: dispatchParamUpdate
updated the value segments but left preservedValue intact. The
serializer checks preservedValue first, so it returned the old
version number. Now clears preservedValue on every programmatic
parameter update.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(designer): prevent generic agent UI flash for Foundry nodes
When clicking a Foundry agent node, the agentModelType parameter is
populated asynchronously via connection loading. Until it resolves,
isAgentServiceConnection is false and the generic agent UI briefly
renders before switching to the Foundry-specific view.
Added isFoundryAgentPending check: if the node already has a
foundryAgentId value, show the filtered Foundry-aware UI immediately
instead of the generic fallback, eliminating the visual flash.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test(designer): add tests for Foundry agent fixes
- Add helpers.spec.ts: tests for isAgentConnectorAndAgentServiceModel
covering Foundry params, missing model type, non-agent connector
- Add dispatchParamUpdate.spec.ts: tests for preservedValue clearing
and String coercion in parameter updates
- Enhance foundryAgentDetails.spec.tsx: add handleVersionSelect
logic tests for string/numeric version type coercion
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(designer): prevent Foundry pending state when switching to non-Foundry connection
isFoundryAgentPending now checks that agentModelType is truly empty
(not yet loaded) before returning true. Previously, switching from a
Foundry connection to a non-Foundry connection left foundryAgentId
with a stale value, causing the Foundry-filtered UI to persist and
hide normal agent parameters.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(designer): consume version refresh flag unconditionally
Move consumeVersionRefresh() before the version comparison check
so the flag is always cleared after versions refetch. Previously,
if a Foundry save didn't produce a new version number, the flag
leaked and the effect would re-fire on every render.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(logic-apps-shared): replace polynomial regex with iterative slash trimming
Replace /\/+$/ regex in normalizeEndpoint with a while-loop using
endsWith/slice to avoid ReDoS on strings with many trailing slashes.
Flagged by GitHub Advanced Security code scanning.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor(logic-apps-shared): remove portal fallback for foundry versions
Simplify listFoundryAgentVersions by removing the fallback to the legacy Portal BFF endpoint. The service now relies exclusively on the standardized Data Plane API.
- Remove projectResourceId parameter from listFoundryAgentVersions signature
- Remove fallback logic and tests
- Update call sites in designer and designer-v2 hooks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 2b1b914 commit 6dda155
File tree
24 files changed
+1513
-560
lines changed- Localize/lang
- apps/Standalone/src/designer/app/AzureLogicAppsDesigner
- libs
- designer-ui/src/lib/foundryagentdetails
- __test__
- designer-v2/src/lib
- core
- actions/bjsworkflow
- __test__
- ui/panel
- connectionsPanel/createConnection/custom
- nodeDetailsPanel/tabs/parametersTab
- designer/src/lib
- core
- actions/bjsworkflow
- __test__
- ui/panel
- connectionsPanel/createConnection/custom
- nodeDetailsPanel/tabs/parametersTab
- __test__
24 files changed
+1513
-560
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
683 | | - | |
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| |||
1875 | 1875 | | |
1876 | 1876 | | |
1877 | 1877 | | |
| 1878 | + | |
1878 | 1879 | | |
1879 | 1880 | | |
1880 | 1881 | | |
| |||
2387 | 2388 | | |
2388 | 2389 | | |
2389 | 2390 | | |
2390 | | - | |
2391 | 2391 | | |
2392 | 2392 | | |
2393 | 2393 | | |
| |||
3756 | 3756 | | |
3757 | 3757 | | |
3758 | 3758 | | |
3759 | | - | |
3760 | 3759 | | |
3761 | 3760 | | |
3762 | 3761 | | |
| |||
3942 | 3941 | | |
3943 | 3942 | | |
3944 | 3943 | | |
| 3944 | + | |
3945 | 3945 | | |
3946 | 3946 | | |
3947 | 3947 | | |
| |||
4395 | 4395 | | |
4396 | 4396 | | |
4397 | 4397 | | |
| 4398 | + | |
4398 | 4399 | | |
4399 | 4400 | | |
4400 | 4401 | | |
| |||
4972 | 4973 | | |
4973 | 4974 | | |
4974 | 4975 | | |
4975 | | - | |
4976 | 4976 | | |
4977 | 4977 | | |
4978 | 4978 | | |
| |||
5158 | 5158 | | |
5159 | 5159 | | |
5160 | 5160 | | |
| 5161 | + | |
5161 | 5162 | | |
5162 | 5163 | | |
5163 | 5164 | | |
| |||
5611 | 5612 | | |
5612 | 5613 | | |
5613 | 5614 | | |
| 5615 | + | |
5614 | 5616 | | |
5615 | 5617 | | |
5616 | 5618 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
201 | 204 | | |
202 | 205 | | |
203 | 206 | | |
| |||
Lines changed: 139 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
30 | 53 | | |
31 | 54 | | |
32 | 55 | | |
33 | 56 | | |
34 | 57 | | |
35 | 58 | | |
36 | 59 | | |
37 | | - | |
| 60 | + | |
38 | 61 | | |
39 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
40 | 71 | | |
41 | 72 | | |
42 | 73 | | |
43 | 74 | | |
44 | 75 | | |
45 | 76 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
55 | 81 | | |
56 | 82 | | |
57 | 83 | | |
58 | 84 | | |
59 | 85 | | |
60 | 86 | | |
61 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
62 | 90 | | |
63 | 91 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
71 | 95 | | |
72 | 96 | | |
73 | | - | |
| 97 | + | |
74 | 98 | | |
75 | | - | |
| 99 | + | |
76 | 100 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 101 | + | |
82 | 102 | | |
83 | 103 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 104 | + | |
89 | 105 | | |
90 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
91 | 113 | | |
92 | 114 | | |
93 | 115 | | |
94 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
0 commit comments