Skip to content

Phase 4.3: Extract legacy/compat + core health endpoints#568

Merged
shikhalev merged 1 commit intomainfrom
server/phase-4.3-legacy-core
Mar 13, 2026
Merged

Phase 4.3: Extract legacy/compat + core health endpoints#568
shikhalev merged 1 commit intomainfrom
server/phase-4.3-legacy-core

Conversation

@shikhalev
Copy link
Collaborator

Summary

  • Extract legacy telephony endpoints (/tts, /stt, /chat, /process_call, /reset_conversation) and OpenAI-compatible endpoints (/v1/models, /v1/voices, /v1/audio/speech, /v1/chat/completions) → modules/compat/router.py (~510 lines)
  • Extract core health endpoints (/, /health, /admin/deployment-mode) → modules/core/router_health.py (~110 lines)
  • Remove dead duplicate endpoints: 3 auth endpoints + /admin/status that were shadowed by routers registered earlier
  • All global variable access replaced with ServiceContainer via get_container()
  • Orchestrator reduced: 3544 → 2875 lines (-669 lines, -19%)

Key changes

File Action Lines
modules/compat/router.py New: 5 Pydantic models + synthesize_with_current_voice helper + 10 endpoints ~510
modules/core/router_health.py New: root + health + deployment-mode ~110
modules/compat/__init__.py New: empty (avoid circular imports) 0
orchestrator.py Removed extracted code + dead duplicates, added router includes -669

Test plan

  • ruff check passes on all changed files
  • ruff format --check passes
  • pytest tests/ — all 65 tests pass
  • Verify GET /health returns correct status
  • Verify GET /v1/models returns model list
  • Verify legacy /tts, /stt, /chat endpoints still work

Closes #548

🤖 Generated with Claude Code

…ator (#548)

Phase 4.3 of orchestrator decomposition (Strangler Fig):
- Extract 5 legacy telephony endpoints (/tts, /stt, /chat, /process_call,
  /reset_conversation) + 5 OpenAI-compatible endpoints (/v1/*) to
  modules/compat/router.py (~510 lines)
- Extract core endpoints (/, /health, /admin/deployment-mode) to
  modules/core/router_health.py (~110 lines)
- Remove dead duplicate auth endpoints and /admin/status (shadowed by routers)
- All globals replaced with ServiceContainer via get_container()
- Orchestrator: 3544 → 2875 lines (-669)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shikhalev shikhalev merged commit 045fa7d into main Mar 13, 2026
3 checks passed
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.

Phase 4.3: Legacy /v1/* + core endpoints → modules/compat/router.py

1 participant