Fix MCP update tool bypassing close approval workflow

- Detect when update is called with status='closed'
- Redirect to close_issue to preserve approval workflow
- Ensures closing tasks always requires same approval regardless of tool used

Fixes #90

Amp-Thread-ID: https://ampcode.com/threads/T-9eab3a82-18f3-4ae3-a2d5-d114811383c1
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-20 23:47:56 -07:00
parent f41cd8816e
commit f4dd9e09a1
2 changed files with 6 additions and 0 deletions

View File

@@ -339,6 +339,11 @@ async def update_issue(
workspace_root: str | None = None,
) -> Issue:
"""Update an existing issue."""
# If trying to close via update, redirect to close_issue to preserve approval workflow
if status == "closed":
issues = await beads_close_issue(issue_id=issue_id, reason="Closed via update")
return issues[0] if issues else None
return await beads_update_issue(
issue_id=issue_id,
status=status,