Skip to content

fix: restore hermes-config and config-patch API routes - #458

Closed
Trillx wants to merge 1 commit into
outsourc-e:mainfrom
Trillx:fix/restore-hermes-config-routes
Closed

fix: restore hermes-config and config-patch API routes#458
Trillx wants to merge 1 commit into
outsourc-e:mainfrom
Trillx:fix/restore-hermes-config-routes

Conversation

@Trillx

@Trillx Trillx commented May 15, 2026

Copy link
Copy Markdown

fix: restore hermes-config and config-patch API routes

Problem

The Aurora rename migration (efcb7d14, May 1) renamed hermes-config.tsclaude-config.ts under src/routes/api/. However, the frontend code and routeTree.gen.ts still reference the original paths:

  • /api/hermes-config — used by settings-dialog.tsx (GET for reading config, PATCH for saving provider settings, API keys, model defaults)
  • /api/config-patch — used by providers-screen.tsx and provider-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.ts contains 20+ references to /api/hermes-config and /api/config-patch
  • -hermes-config.test.ts imports 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 it
  • claude-config.ts exists as the renamed file but serves /api/claude-config, not /api/hermes-config

Fix

Created two thin route files that delegate to the existing handlers:

src/routes/api/hermes-config.ts — wires GET/PATCH/POST to handleHermesConfigGet/handleHermesConfigPatch

src/routes/api/config-patch.ts — wires POST to handleHermesConfigPatch

Both files import from ../../server/hermes-config-route which already handles:

  • Action-based patches (set-api-key, set-default-model, set-custom-provider, etc.)
  • Legacy patches ({ config: {...}, env: {...} })
  • Auth and capability checks

Testing

Verified locally:

  • GET /api/hermes-config returns proper JSON with provider status (12 providers)
  • PATCH /api/hermes-config with legacy format succeeds
  • POST /api/config-patch succeeds
  • Config file integrity preserved after writes

Related

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.
@outsourc-e

Copy link
Copy Markdown
Owner

Closing as superseded by #483, which is already merged into main. The validated fix from this branch was folded into the consolidation batch; keeping this PR open now just inflates the queue. If there is any missing behavior not covered by #483, we can reopen or spin a fresh focused follow-up.

@outsourc-e

Copy link
Copy Markdown
Owner

Superseded by merged cleanup batch #483.

@outsourc-e outsourc-e closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants