fix: restore hermes-config and config-patch API routes - #458
Closed
Trillx wants to merge 1 commit into
Closed
Conversation
The Aurora rename migration (efcb7d1) renamed hermes-config.ts to claude-config.ts, but the frontend and routeTree.gen.ts still reference the original paths. This caused all /api/hermes-config and /api/config-patch requests to fall through to the SPA HTML fallback, breaking config saves from the settings dialog and provider wizard with 'Failed to save' errors. Restored by creating thin route files that delegate to the existing handleHermesConfigGet/handleHermesConfigPatch handlers from src/server/hermes-config-route.ts. Fixes the settings dialog (hermes-config GET/PATCH) and provider wizard (config-patch POST) config save flows.
Owner
Owner
|
Superseded by merged cleanup batch #483. |
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.
fix: restore hermes-config and config-patch API routes
Problem
The Aurora rename migration (
efcb7d14, May 1) renamedhermes-config.ts→claude-config.tsundersrc/routes/api/. However, the frontend code androuteTree.gen.tsstill reference the original paths:/api/hermes-config— used bysettings-dialog.tsx(GET for reading config, PATCH for saving provider settings, API keys, model defaults)/api/config-patch— used byproviders-screen.tsxandprovider-wizard.tsx(POST for saving provider API keys and custom endpoint config)Since the route files no longer exist, all requests to these endpoints fall through to the SPA HTML fallback (HTTP 200 with HTML content). The frontend's
response.json()fails to parse HTML, resulting in the "Failed to save" error toast.Evidence
routeTree.gen.tscontains 20+ references to/api/hermes-configand/api/config-patch-hermes-config.test.tsimports from'./hermes-config'(the original file name)src/server/hermes-config-route.ts(6697 bytes) has the handler code (handleHermesConfigGet,handleHermesConfigPatch) but no route file to mount itclaude-config.tsexists as the renamed file but serves/api/claude-config, not/api/hermes-configFix
Created two thin route files that delegate to the existing handlers:
src/routes/api/hermes-config.ts— wires GET/PATCH/POST tohandleHermesConfigGet/handleHermesConfigPatchsrc/routes/api/config-patch.ts— wires POST tohandleHermesConfigPatchBoth files import from
../../server/hermes-config-routewhich already handles:set-api-key,set-default-model,set-custom-provider, etc.){ config: {...}, env: {...} })Testing
Verified locally:
GET /api/hermes-configreturns proper JSON with provider status (12 providers)PATCH /api/hermes-configwith legacy format succeedsPOST /api/config-patchsucceedsRelated