Skip to content

refactor(web): extract custom-endpoints routes into web_routers/custom_endpoints (web_server.py god-file slice R3-C1) - #79127

Open
andrexibiza wants to merge 2 commits into
NousResearch:mainfrom
andrexibiza:fix/web-custom-endpoints-extract
Open

refactor(web): extract custom-endpoints routes into web_routers/custom_endpoints (web_server.py god-file slice R3-C1)#79127
andrexibiza wants to merge 2 commits into
NousResearch:mainfrom
andrexibiza:fix/web-custom-endpoints-extract

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Web_server.py god-file slice R3-C1: extract the custom-endpoints family from hermes_cli/web_server.py into hermes_cli/web_routers/custom_endpoints.py (APIRouter). Part of the repo-wide large-file decomposition (tracker #78647).

What changed and why

  • Moved the 13 custom-endpoint names (list/upsert/activate/delete/validate + helpers, window 7107–7472) byte-verbatim into hermes_cli/web_routers/custom_endpoints.py
  • Router mounted; web_server.py re-exports all 13 (seam identity verified is-identical); the one cross-cluster helper (_apply_main_model_assignment) resolves via web_deps.late()
  • Added seam-identity regression (13 names) + aggressive tests (model-id parsing shapes, api-key display redaction, env-ref detection, HTTP-failure paths)

Why this matters to users

Custom OpenAI-compatible provider endpoints are a dashboard surface users configure directly. Extracting the CRUD + validate family into a router module keeps the credential-handling behavior byte-identical (api_key vs key_env, redaction, audit names-not-values) while enabling the large-file decomposition.

Testing

  • pytest tests/test_web_server_custom_endpoints_seam.py tests/hermes_cli/test_custom_provider_model_switch.py tests/gateway/test_25107_stale_base_url_api_mode.py27 passed
  • Canonical runner: 3 files, 27 passed, 0 failed
  • Seam identity 13/13; all 5 routes live on the app; literal-path precedence (/validate vs /{endpoint_id}) verified
  • ruff clean · git diff --check clean · LF-only · DCO signed
  • Platforms tested: Windows (native), CI-parity runner

Coordination / interlock

Part of #78647
Part of #78628

…m_endpoints (web_server.py god-file slice R3-C1)

Signed-off-by: andrexibiza <84248988+andrexibiza@users.noreply.github.com>
…llects it

Signed-off-by: Andrex <andrex@users.noreply.github.com>
@andrexibiza

Copy link
Copy Markdown
Contributor Author

🔒 This shard is part of the web_server.py KILL LOCK — the permanent record of the 17,700-line whole, the mess it caused (#58576 event-loop stalls, #60800 cold-start stalls, #53972 token persistence, #71778 analytics), every shard in the wave, and every open fixer PR still fighting the surface (#50188 #71802 #54034 #76764 #71150 #67365 #65434 #65424 #78411 #75845 #68022 #62654 #76757 #68251 #51070 #73605 #73849 #73393 #71752 #77808 #46956 #74297 #77853).

Lock: posted on #78628 · Indexed by the Kill All Gods meta-issue #78647.

@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) area/config Config system, migrations, profiles labels Aug 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #79776 also extracts the custom-endpoint route family. This PR imports config helpers directly; #79776 resolves them through late-bound seams. Please consolidate or choose one approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants