Conversation
SummaryThanks for the patch, but I think this PR is a no-op and should probably be closed. Reading def _run_lifecycle_health() -> dict:
"""Return active worker-run state independent of SSE stream presence."""
# Import the module rather than relying only on imported scalar aliases so
# LAST_RUN_FINISHED_AT stays fresh after unregister_active_run() updates it.
from api import config as _live_config
now = time.time()
with _live_config.ACTIVE_RUNS_LOCK:
runs = []
for stream_id, raw in (_live_config.ACTIVE_RUNS or {}).items():
...
last_finished = _live_config.LAST_RUN_FINISHED_ATThe pattern is intentional: Code referenceSearching the PR's HEAD for unqualified uses of any of the three added names: The only match outside the import block is a comment. Nothing actually consumes the new names. Diagnosis
If you added these imports because a different downstream patch you have locally uses the bare names, that local patch is the one that should change to follow the RecommendationClose this PR. If there's a concrete symptom you're working around (e.g. a NameError from a third-party fork), can you paste the traceback into a fresh issue? Happy to look at the actual failure, but I don't think the fix lives in adding these imports. |
|
Holding this one — the diff is currently a no-op against What the PR adds (3 lines in from api.config import (
...
+ ACTIVE_RUNS,
+ ACTIVE_RUNS_LOCK,
+ LAST_RUN_FINISHED_AT,
SERVER_START_TIME,
...
)Why those imports aren't doing anything
def _run_lifecycle_health() -> dict:
from api import config as _live_config
with _live_config.ACTIVE_RUNS_LOCK:
...
for stream_id, raw in (_live_config.ACTIVE_RUNS or {}).items():
...
last_finished = _live_config.LAST_RUN_FINISHED_ATThat deliberately routes through Test plan mismatch The body lists Two ways forward
Marking — Thanks for the contributions, by the way — your other PRs (#2100, #2070) are real fixes and are in the current merge queue. |
|
Closing this one after re-checking the current The original lifecycle-health work was valid, but it has already landed upstream in ACTIVE_RUNS,
ACTIVE_RUNS_LOCK,
LAST_RUN_FINISHED_AT,Those names are not referenced unqualified anywhere in the PR. So this PR was opened from stale split context: the body described the earlier full lifecycle-health fix/tests, but the actual diff is just unused imports. Closing rather than asking maintainers to review a no-op. |
Summary
_run_lifecycle_health()/healthable to report active worker lifecycle state separately from SSE stream stateTest Plan
python3 -m py_compile api/config.py api/routes.py api/streaming.py tests/test_run_lifecycle_health.pypython3 -m pytest tests/test_run_lifecycle_health.py -q→ 2 passedNotes
Most of the earlier lifecycle guard work is already present upstream; this PR is the small remaining import fix needed for the current
origin/masterbranch.