Fix audit hanging: add auto_apply param + allow_write for tool access
Root cause: claude agent without --dangerously-skip-permissions hangs on tool permission prompts when stdin=DEVNULL. Fixes: - run_audit() now passes allow_write=True so agent can use Read/Bash tools without interactive permission prompts - Added auto_apply param: False for API (result only), CLI confirms with user then applies manually - API explicitly passes auto_apply=False - Tests for auto_apply=True/False behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
96509dcafc
commit
9cbb3cec37
4 changed files with 78 additions and 5 deletions
|
|
@ -613,6 +613,7 @@ def audit_backlog(ctx, project_id):
|
|||
return
|
||||
|
||||
click.echo(f"Auditing {len(pending)} pending tasks for {project_id}...")
|
||||
# First pass: get results only (no auto_apply yet)
|
||||
result = run_audit(conn, project_id)
|
||||
|
||||
if not result["success"]:
|
||||
|
|
@ -643,9 +644,14 @@ def audit_backlog(ctx, project_id):
|
|||
if result.get("duration_seconds"):
|
||||
click.echo(f"Duration: {result['duration_seconds']}s")
|
||||
|
||||
# Apply: mark tasks as done after user confirmation
|
||||
if done and click.confirm(f"\nMark {len(done)} tasks as done?"):
|
||||
for item in done:
|
||||
models.update_task(conn, item["id"], status="done")
|
||||
tid = item.get("id")
|
||||
if tid:
|
||||
t = models.get_task(conn, tid)
|
||||
if t and t["project_id"] == project_id and t["status"] == "pending":
|
||||
models.update_task(conn, tid, status="done")
|
||||
click.echo(f"Marked {len(done)} tasks as done.")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue