From 1f1c30f87e6a73aa48bc8b763cf5c997d855e61b Mon Sep 17 00:00:00 2001 From: "Rai (Michael Pokorny)" Date: Tue, 24 Jun 2025 21:17:37 -0700 Subject: [PATCH] agentydragon: skip fully merged tasks in status table, colorize dirty/Done/Merged rows, list merged summary; update manager prompt --- agentydragon/prompts/manager.md | 1 + .../tools/manager_utils/agentydragon_task.py | 40 ++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/agentydragon/prompts/manager.md b/agentydragon/prompts/manager.md index 9af7e6e4cf..d3b6b61375 100644 --- a/agentydragon/prompts/manager.md +++ b/agentydragon/prompts/manager.md @@ -7,6 +7,7 @@ You are the **Project Manager** Codex agent for the `codex` repository. Your re - **Live coordination**: Continuously monitor and report progress, adjust the plan as tasks complete or new ones appear, and surface any blockers. - **Worktree monitoring**: Check each task’s worktree for uncommitted changes or dirty state to detect agents still working or potential crashes, and report their status as in-progress or needing attention. +- When displaying the task-status table, highlight dirty worktrees in red and tasks marked Done or Merged in green; exclude tasks that are Merged with no branch and no worktree from the main table (they should instead be listed in a green “Done & merged:” summary at the bottom), and filter such merged tasks out of other tasks’ dependency lists. - **Background polling**: On user request, enter a sleep‑and‑scan loop (e.g. 5 min interval) to detect tasks marked “Done” in their Markdown; for each completed task, review its branch worktree, check for merge conflicts, propose merging cleanly mergeable branches, and suggest conflict‑resolution steps for any that aren’t cleanly mergeable. - **Manager utilities**: Create and maintain utility scripts under `agentydragon/tools/manager_utils/` to support your work (e.g., branch scanning, conflict checking, merge proposals, polling loops). Include clear documentation (header comments or docstrings with usage examples) in each script, and invoke these scripts in your workflow. diff --git a/agentydragon/tools/manager_utils/agentydragon_task.py b/agentydragon/tools/manager_utils/agentydragon_task.py index 5ba765e0cc..b600bb2cd8 100644 --- a/agentydragon/tools/manager_utils/agentydragon_task.py +++ b/agentydragon/tools/manager_utils/agentydragon_task.py @@ -2,6 +2,7 @@ CLI for managing agentydragon tasks: status, set-status, set-deps, dispose, launch. """ import subprocess +import re import sys from datetime import datetime @@ -26,7 +27,18 @@ def status(): If tabulate is installed, render as GitHub-flavored Markdown table; otherwise fallback to fixed-width formatting. """ + # preload all task statuses to filter dependencies + all_meta = {} + for md in sorted(task_dir().glob('*.md')): + if md.name == 'task-template.md' or md.name.endswith('-plan.md'): + continue + try: + meta, _ = load_task(md) + except ValueError: + continue + all_meta[meta.id] = meta rows = [] + merged_tasks = [] # collect merged tasks for bottom summary root = repo_root() for md in sorted(task_dir().glob('*.md')): if md.name == 'task-template.md' or md.name.endswith('-plan.md'): @@ -61,7 +73,7 @@ def status(): capture_output=True, text=True ).stdout.strip() wt_clean = 'Clean' if not status_out else 'Dirty' - # derive branch & merge status + # derive branch & merge status (unchanged) if branches: bname = branches[0] # merged into agentydragon? @@ -106,11 +118,25 @@ def status(): wt_info = wt_clean else: wt_info = 'none' + # skip fully merged tasks (no branch, no worktree) into summary + if meta.status == 'Merged' and branch_info == 'no branch' and wt_info == 'none': + merged_tasks.append((meta.id, meta.title)) + continue + # filter out merged dependencies by ID + deps = [d.strip() for d in re.findall(r"\d+", meta.dependencies)] + deps = [d for d in deps if all_meta.get(d, None) and all_meta[d].status != 'Merged'] + deps_str = ','.join(deps) + # color status and worktree info with ANSI codes + stat_disp = meta.status + wt_disp = wt_info + if wt_info.lower() == 'dirty': + wt_disp = f"\033[31m{wt_info}\033[0m" + if meta.status in ('Done', 'Merged'): + stat_disp = f"\033[32m{meta.status}\033[0m" rows.append(( - meta.id, meta.title, meta.status, - meta.dependencies.replace('\n', ' '), - meta.last_updated.strftime('%Y-%m-%d %H:%M'), - branch_info, wt_info + meta.id, meta.title, stat_disp, + deps_str, meta.last_updated.strftime('%Y-%m-%d %H:%M'), + branch_info, wt_disp )) headers = ['ID', 'Title', 'Status', 'Dependencies', 'Updated', 'Branch Status', 'Worktree Status'] @@ -125,6 +151,10 @@ def status(): print(fmt.format(*headers)) for r in rows: print(fmt.format(*r)) + # summary of merged tasks (no branch, no worktree) + if merged_tasks: + items = ' '.join(f"{tid} ({title})" for tid, title in merged_tasks) + print(f"\n\033[32mDone & merged:\033[0m {items}") @cli.command() @click.argument('task_id')