fix(api): provider endpoint mismatches preventing copilot save#511
fix(api): provider endpoint mismatches preventing copilot save#511ibhagwan wants to merge 1 commit intospacedriveapp:mainfrom
Conversation
… and remove Fix spacedriveapp#415 Three endpoint mismatches between frontend and backend caused the GitHub Copilot provider's save, test, and remove buttons to fail with 405 Method Not Allowed. These affected all providers for save. - change update_provider annotation from post to put to match frontend - fix test button URL from /providers/test to /providers/test-model - add github-copilot entry in build_test_llm_config since default_provider_config returns None for providers that require token exchange - widen GITHUB_COPILOT_DEFAULT_BASE_URL visibility to pub(crate) - add unit test for build_test_llm_config with github-copilot fix(api): Copilot provider shows as available after remove when env var is set get_providers fell back to the GITHUB_COPILOT_API_KEY env var when the TOML key was absent, so the provider stayed visible in settings after a remove — the env var can't be unset from a running process. Only check the TOML key for Copilot status in the config-exists path. The env var fallback remains for the no-config-file case (fresh install).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughUpdates GitHub Copilot provider registration logic in LLM test configuration, modifies provider availability detection to prioritize TOML config over environment variables, changes the provider update route from POST to PUT, and adjusts visibility of GitHub Copilot configuration constants. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review SummaryP2 Suggestion (non-blocking)The Copilot special case in P3 Architecture NoteThe sandbox refactoring (deleting |
This PR does not modify detection.rs at all, probably a local leftover during the review? |
Fix #415
And remove three endpoint mismatches between frontend and backend caused the GitHub Copilot provider's save, test, and remove buttons to fail with 405 Method Not Allowed. These affected all providers for save.
fix(api): Copilot provider shows as available after remove when env var is set
get_providers fell back to the GITHUB_COPILOT_API_KEY env var when the TOML key was absent, so the provider stayed visible in settings after a remove — the env var can't be unset from a running process.
Only check the TOML key for Copilot status in the config-exists path. The env var fallback remains for the no-config-file case (fresh install).