Skip to content

Commit 700b6bf

Browse files
committed
fix: stabilize hosted run ordering
1 parent b2cb869 commit 700b6bf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/orchestrator/src/cortexpilot_orch/services/control_plane_read_service.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ def _list_runs_runtime() -> list[dict[str, Any]]:
202202
continue
203203
run_dirs.append((run_dir, manifest_record, _run_sort_ts(run_dir, manifest_record)))
204204

205-
for run_dir, manifest_record, _sort_ts in sorted(run_dirs, key=lambda item: item[2], reverse=True):
205+
for run_dir, manifest_record, _sort_ts in sorted(
206+
run_dirs,
207+
key=lambda item: (item[2], item[0].name),
208+
reverse=True,
209+
):
206210
run_id = _as_text(manifest_record.get("run_id")) or run_dir.name
207211
payload = dict(manifest_record)
208212
payload["run_id"] = run_id

0 commit comments

Comments
 (0)