From 70aa7a5b4c91a3c27d7a707748109fd97155d3a9 Mon Sep 17 00:00:00 2001 From: chablino Date: Mon, 23 Mar 2026 21:14:28 +0800 Subject: [PATCH 1/3] Fix: Sort task JSON files numerically instead of lexicographically --- agents/s07_task_system.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agents/s07_task_system.py b/agents/s07_task_system.py index 7689be42b..9f576610b 100644 --- a/agents/s07_task_system.py +++ b/agents/s07_task_system.py @@ -112,7 +112,11 @@ def _clear_dependency(self, completed_id: int): def list_all(self) -> str: tasks = [] - for f in sorted(self.dir.glob("task_*.json")): + files = sorted( + self.dir.glob("task_*.json"), + key=lambda f: int(f.stem.split("_")[-1]) + ) + for f in files: tasks.append(json.loads(f.read_text())) if not tasks: return "No tasks." From 73b11ce18c9fbfebd715cffb1878e50bd7ec859e Mon Sep 17 00:00:00 2001 From: to7for <31083461+chablino@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:21:26 +0800 Subject: [PATCH 2/3] Update agents/s07_task_system.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- agents/s07_task_system.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/s07_task_system.py b/agents/s07_task_system.py index 9f576610b..8b4e7acbd 100644 --- a/agents/s07_task_system.py +++ b/agents/s07_task_system.py @@ -112,8 +112,8 @@ def _clear_dependency(self, completed_id: int): def list_all(self) -> str: tasks = [] - files = sorted( - self.dir.glob("task_*.json"), + files = sorted( + self.dir.glob("task_*.json"), key=lambda f: int(f.stem.split("_")[-1]) ) for f in files: From 41f18ca08d1d7bbbf4d9fa5b2b57368ba8b8802b Mon Sep 17 00:00:00 2001 From: chablino Date: Mon, 23 Mar 2026 21:27:50 +0800 Subject: [PATCH 3/3] Fix: Align ID extraction logic with _new_id using index [1] --- agents/s07_task_system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents/s07_task_system.py b/agents/s07_task_system.py index 8b4e7acbd..136ec9efa 100644 --- a/agents/s07_task_system.py +++ b/agents/s07_task_system.py @@ -114,7 +114,7 @@ def list_all(self) -> str: tasks = [] files = sorted( self.dir.glob("task_*.json"), - key=lambda f: int(f.stem.split("_")[-1]) + key=lambda f: int(f.stem.split("_")[1]) ) for f in files: tasks.append(json.loads(f.read_text()))