Skip to content

feat(engine): surface is_sleeping as a GET control endpoint mirroring /is_paused - #1118

Open
SuperMarioYL wants to merge 1 commit into
lightseekorg:mainfrom
SuperMarioYL:feat/is-sleeping-endpoint
Open

feat(engine): surface is_sleeping as a GET control endpoint mirroring /is_paused#1118
SuperMarioYL wants to merge 1 commit into
lightseekorg:mainfrom
SuperMarioYL:feat/is-sleeping-endpoint

Conversation

@SuperMarioYL

Copy link
Copy Markdown

Summary

The Sleep/Wake-Up data-plane is wired end-to-end (engine.is_sleeping
AsyncLLM.is_sleepingIsSleepingReq round-trip through the scheduler control
client) and is GPU-tested in test_sleep_wakeup_gpu.py, but the only status
route mounted on the HTTP control surface is /is_paused. The symmetric
/is_sleeping route was missing from both the in-engine RL-control router
(vllm_compat_http.py) and the sidecar control_server.py, so callers could
poll pause status over HTTP but not sleep status.

This adds the matching /is_sleeping endpoint, mirroring /is_paused
end-to-end:

  • WeightTransferManager.is_sleeping() — async accessor delegating to
    AsyncLLM.is_sleeping() (mirrors the sync is_paused() accessor at
    manager.py:94; carries await because AsyncLLM.is_sleeping is async,
    whereas AsyncLLM.weight_transfer_admission_paused is sync).
  • @router.get("/is_sleeping") on vllm_compat_http.py — direct handler
    returning {"is_sleeping": bool}, mirroring the /is_paused handler.
  • @app.get("/is_sleeping") on control_server.py — thin sidecar proxy to
    the in-engine RL-control app, mirroring the /is_paused proxy.

The change is purely additive: no existing route or control-plane behavior is
modified. The read semantics are point-in-time status polling, identical to
/is_paused, so the same transient-state reasoning applies to both — this is
parity with the existing route, not a new contract.

Test Plan

  • TestRlControlProxy in test/runtime/test_control_server.py: spins up a
    mock RL-control app and asserts the sidecar's /is_sleeping and /is_paused
    routes relay {"is_sleeping": bool} / {"is_paused": bool} byte-faithfully.
    A missing /is_sleeping mount would 404 and fail the assertion, so this is
    a real regression guard for the new route plus parity coverage for /is_paused
    (which had no proxy test before).
  • ruff check and isort --check-only clean on all four changed files;
    python -m py_compile clean.
  • The control-server test suite imports the tokenspeed runtime, which pulls
    in triton / torch / tokenspeed_kernel, so it runs in GPU CI rather than
    on a non-GPU host; CI will exercise the new test.

… /is_paused

The Sleep/Wake-Up data-plane (engine.is_sleeping -> AsyncLLM.is_sleeping ->
IsSleepingReq round-trip) is wired end-to-end and GPU-tested, but only /is_paused
is mounted as an HTTP control route. Add /is_sleeping on both the in-engine
RL-control router (vllm_compat_http) and the sidecar control_server, mirroring
/is_paused, plus a WeightTransferManager.is_sleeping accessor that delegates to
AsyncLLM.is_sleeping. Includes a TestRlControlProxy regression covering
/is_sleeping and /is_paused proxy parity.

Signed-off-by: supermario_leo <leo.stack@outlook.com>
@SuperMarioYL
SuperMarioYL requested a review from a team as a code owner August 16, 2026 20:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6eb9be8d1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +233 to +234
@router.get("/is_sleeping")
async def is_sleeping(raw_request: Request) -> JSONResponse:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the new sleep-status endpoint

This exposes a new public GET /is_sleeping control API, but the commit does not update any user-facing documentation, leaving operators without a documented response contract or guidance on how this status differs from /is_paused. Add the route, response shape, and sleep-state semantics to the control-plane documentation as required for changed code.

AGENTS.md reference: AGENTS.md:L11-L14

Useful? React with 👍 / 👎.

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