Skip to content

refactor(server): dedupe maintenance gate across API entrypoints - #191

Open
Mitaligrawal wants to merge 1 commit into
FlashML-org:mainfrom
Mitaligrawal:refactor/dedupe-maintenance-gate
Open

refactor(server): dedupe maintenance gate across API entrypoints#191
Mitaligrawal wants to merge 1 commit into
FlashML-org:mainfrom
Mitaligrawal:refactor/dedupe-maintenance-gate

Conversation

@Mitaligrawal

Copy link
Copy Markdown

Summary

  • Extract shared maintenance-state checks into python/freetoken/server/maintenance.py
  • Wire OpenAI, Anthropic, Responses, and /generate through the same helpers instead of copy-pasted gate logic
  • Unify 503 messages so "failed" and rebuild states get consistent wording across all entrypoints

Test plan

  • pytest tests/server/test_rebuild_maintenance.py::test_openai_gate_message_is_loading_aware
  • Hit /v1/chat/completions, /v1/messages, /v1/responses, and /generate while maintenance_state is "loading", "rebuilding", and "failed" — each should 503 with the expected message

Made with Cursor

Extract shared maintenance_state checks into maintenance.py so OpenAI,
Anthropic, Responses, and /generate all return consistent 503 messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant