This commit is contained in:
Rai (Michael Pokorny)
2025-06-25 04:45:42 -07:00
parent 253324e5c3
commit 8854fbdb06
2 changed files with 18 additions and 3 deletions
+6 -2
View File
@@ -38,13 +38,17 @@ def main(task_input):
click.echo(f"No changes detected in worktree for '{slug}'; nothing to commit.", err=True)
sys.exit(0)
cmd = ['codex', '--full-auto', 'exec', '--output-last-message', str(msg_file)]
click.echo(f"Running: {' '.join(cmd)}")
# Run the Commit agent in silent mode (suppressing its full stdout)
click.echo(f"Running commit agent: {' '.join(cmd)}")
prompt_content = prompt_file.read_text(encoding='utf-8')
task_content = task_file.read_text(encoding='utf-8')
subprocess.check_call(cmd + [prompt_content + '\n\n' + task_content])
subprocess.check_call(cmd + [prompt_content + '\n\n' + task_content], stdout=subprocess.DEVNULL)
# Stage all changes, including new files (not just modifications)
subprocess.check_call(['git', 'add', '-A'])
subprocess.check_call(['git', 'commit', '-F', str(msg_file)])
# Print the commit message for visibility
msg = msg_file.read_text(encoding='utf-8').strip()
click.echo("Commit message:\n" + msg)
finally:
msg_file.unlink()
@@ -7,7 +7,7 @@ import sys
from datetime import datetime
import click
from tasklib import load_task, repo_root, save_task, task_dir, TaskMeta, worktree_dir
from tasklib import load_task, repo_root, save_task, task_dir, TaskMeta, worktree_dir, TaskStatus
import shutil
try:
@@ -311,6 +311,17 @@ def dispose(task_id):
else:
click.echo(f"No branches matching {ref_pattern}")
click.echo(f'Disposed task {tid}')
# If the task was marked Done, auto-move it into .done/
files = list(task_dir().glob(f"{tid}-*.md"))
if len(files) == 1:
path = files[0]
meta, _ = load_task(path)
if meta.status == TaskStatus.DONE:
done_dir = task_dir() / '.done'
done_dir.mkdir(exist_ok=True)
target = done_dir / path.name
click.echo(f"Moving {path.name} -> .done/ (status Done)")
subprocess.run(['git', 'mv', str(path), str(target)], cwd=repo_root())
@cli.command()
@click.argument('task_id', nargs=-1)