mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-05-06 16:26:16 +08:00
Fix: Sort task JSON files numerically instead of lexicographically
This commit is contained in:
@@ -112,7 +112,11 @@ class TaskManager:
|
|||||||
|
|
||||||
def list_all(self) -> str:
|
def list_all(self) -> str:
|
||||||
tasks = []
|
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()))
|
tasks.append(json.loads(f.read_text()))
|
||||||
if not tasks:
|
if not tasks:
|
||||||
return "No tasks."
|
return "No tasks."
|
||||||
|
|||||||
Reference in New Issue
Block a user