chore: Update frontend route calls to use new endpoints#8852
chore: Update frontend route calls to use new endpoints#8852Danelegend wants to merge 2 commits intotest_llm_providerfrom
Conversation
|
Preview Deployment
|
Greptile SummaryUpdated frontend calls to use new unified LLM provider endpoints. The changes migrate from provider-specific parameterized URLs (e.g., Key Changes:
All changes are consistent with the backend API migration and maintain the same functionality while using the new routing structure. Confidence Score: 5/5
Important Files Changed
Last reviewed commit: da3f8b2 |
| expect.objectContaining({ | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: expect.stringContaining('"provider_id":5'), |
There was a problem hiding this comment.
also verify model_name field is present in body
| body: expect.stringContaining('"provider_id":5'), | |
| body: expect.stringContaining('"provider_id":5'), | |
| body: expect.stringContaining('"model_name"'), |
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="web/src/sections/modals/llmConfig/CustomModal.test.tsx">
<violation number="1" location="web/src/sections/modals/llmConfig/CustomModal.test.tsx:442">
P2: Duplicate `body` keys in the matcher cause the `provider_id` assertion to be overwritten, weakening the test and allowing regressions in request payload validation.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: expect.stringContaining('"provider_id":5'), | ||
| body: expect.stringContaining('"model_name"'), |
There was a problem hiding this comment.
P2: Duplicate body keys in the matcher cause the provider_id assertion to be overwritten, weakening the test and allowing regressions in request payload validation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At web/src/sections/modals/llmConfig/CustomModal.test.tsx, line 442:
<comment>Duplicate `body` keys in the matcher cause the `provider_id` assertion to be overwritten, weakening the test and allowing regressions in request payload validation.</comment>
<file context>
@@ -439,6 +439,7 @@ describe("Custom LLM Provider Configuration Workflow", () => {
method: "POST",
headers: { "Content-Type": "application/json" },
body: expect.stringContaining('"provider_id":5'),
+ body: expect.stringContaining('"model_name"'),
})
);
</file context>
Description
There are currently some more frontend places that don't make use of the new routes. This updates them to use the new routes
How Has This Been Tested?
...
Additional Options
Summary by cubic
Updated frontend LLM routes to use the new admin endpoints and payloads, aligning with backend changes. This also updates response parsing and tests to match the new API shape.
${LLM_ADMIN_URL}/defaultand${LLM_ADMIN_URL}/default-visionwith JSON{ provider_id, model_name }.fetchVisionProvidersto readprovidersfromLLMProviderResponse.model_namefromdefault_model_nameor firstmodel_configurationsentry, then sets default via the new route.CustomModaltest to assert the new endpoint, JSON body, andContent-Typeheader.Written for commit 19d8ee3. Summary will update on new commits.