Repository navigation
feat(admin-console): queue position per run from the device queue, and a requeue event (CHE-10263) [squash] - #350
Open
congvc-bot-x99[bot] wants to merge 2 commits into
Conversation
added 2 commits
November 26, 2026 19:09
…d a requeue event (CHE-10263) [squash] Refs CHE-1134
…session_requeued (CHE-10263)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
Draft. Waiting on cross-lab agent review and CI checks on head
aa872e9fd5880c3607abebdb699e2aff6e499186. Delivers stage 1 of CHE-1134 (B5a-2).Conditions
start_timeback fromcreated_at.session_requeuedis in_RUN_BOUND_EVENTS. Named streams isolatesession_requeuedto its own run in both Cloudflare mode and open mode.Change
DeviceExecutionLock.queue_positions()(artemis/runtime/device_lock.py) maps each live ticket token to its 1-based rank. It filters dead-owner tickets before collecting target lock IDs and calling_build_device_queue. Deadpending/anyor concrete tickets cannot occupy parking slots. Each token appears at most once.GET /api/status(apps/admin_console/routers/tasks.py) callsqueue_positions()once per request. It addsqueue_position(int or null) to response copies only, leavingstate.queue_itemsuntouched.TaskQueueService.requeue_starting(apps/admin_console/services/task_queue_service.py) restoresstart_timetocreated_at(or popsstart_timewhencreated_atis absent). It then broadcastssession_requeuedwithsession_id,device_serialandqueue_position. The early return when stopped emits nothing._RUN_BOUND_EVENTS(apps/admin_console/routers/tasks.py) now includes"session_requeued". Named streams enforce exactsession_idmatching for_RUN_BOUND_EVENTSin both Cloudflare mode and open mode._OPEN_NAMED_STREAM_EVENTSkeeps historical cross-run delivery forsession_started,session_endedandbackground_tasks_updatedin open mode.Blast Radius
Callers:
/api/statusconsumers receivequeue_positionon queue entries. Named SSE streams (/api/stream/{session_id}) receivesession_requeuedonly for their ownsession_id.requeue_startinghas no production caller yet until CHE-1142. Regressions surface intest_device_lock.py,test_task_queue_service.py,test_host_admission.py,test_host_nack_races.pyandtest_run_ownership.py. Proof level: 2.Evidence
Red before changes:
main(1f4f273ff121):6 failed, 3 passedon the initial new tests.e3110dc608b8before fixaa872e9fd588:uv run pytest tests/unit/runtime/test_device_lock.py -k "queue_positions" -q->1 failed, 4 passed(test_queue_positions_dead_pending_and_dead_concrete_do_not_distort_parking).uv run pytest tests/unit/admin_console/test_run_ownership.py -k "requeue_event or global_lifecycle_events" -q->2 failed, 1 passed(test_named_stream_gets_its_own_requeue_event_only,test_open_mode_named_stream_gets_its_own_requeue_event_only).Green on
aa872e9fd5880c3607abebdb699e2aff6e499186:uv run ruff format --check .(1049 files already formatted) anduv run ruff check .(All checks passed!) pass.Closes CHE-10263
Refs CHE-1134