okl warm stop reports no server when one answered slower than the prompt's 0.5 s budget

Open Beginner friendly
#320 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Start in src/okl/warm.py at lines 464-473 where warm.stop() uses the 0.5s TIMEOUT_S. Give stop and ping (for okl warm status) a longer timeout of a few seconds, keeping TIMEOUT_S for the prompt embed. Add a test in tests/test_warm.py that delays the server past TIMEOUT_S and asserts stop() is True; confirm it fails before the fix. Done when okl warm stop reports the server it actually stopped.

Written by the indexing model from the issue text.

Description

bug

The defect. warm.stop() sends the stop request with TIMEOUT_S (0.5 s), the budget a prompt allows for its vector. A server that takes longer than that to answer still receives the request and exits, but the client times out first, so stop() returns False. okl warm stop then reports that no server answered, even though it stopped one. src/okl/warm.py:464-473.

Seen. On #312's CI, 2026-10-31, tests/test_warm.py::test_the_server_answers_ping_embed_and_stop failed on Python 3.11 only, at assert warm.stop() is True, with the other Pythons green on the same commit. #312 does not touch warm.py. A busy runner is enough to push the server's answer past 0.5 s.

Fix. Give stop (and ping when a person runs okl warm status) a timeout of its own, a few seconds, since nothing waits on it the way a prompt does. Keep TIMEOUT_S for the prompt's embed. Add a test that slows the server's answer past TIMEOUT_S and still expects stop() to be True, and check that it fails before the fix.

Dominant language
Python
Stars
1
Forks
1
Avg merge
7h 42m
Merged PRs (30d)
110

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from emeraldleaf/okl

All issues in emeraldleaf/okl

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.