#3721·pr-agent

Azure DevOps comment handler resolves the thread after a swallowed tool failure

Author: LesereingrapeCreated Sep 27, 2026Updated Sep 27, 2026

Git provider

Azure

System Info

PR-Agent main @ b138817e, deployed as the Azure DevOps Server webhook (pr_agent/servers/azuredevops_server_webhook.py), default configuration (CONFIG.propagate_tool_errors = false, see pr_agent/settings/configuration.toml).

Bug details

handle_request_comment() resolves the discussion thread and deletes the progress comment whenever PRAgent.handle_request() returns True:

python
handled = await agent.handle_request(url, body, notify=...)
if handled and not is_question:
    provider.set_thread_status(thread_id, "closed")
if handled:
    provider.remove_initial_comment()

With the default propagate_tool_errors = false, a tool that fails internally calls record_command_failure() and returns normally anyway (pr_agent/tools/pr_reviewer.py:458-464, and the same shape in pr_description.py, pr_code_suggestions.py, pr_add_docs.py, pr_generate_labels.py, pr_help_message.py). handle_request() therefore still returns True, so a /review whose model call errored closes the author's thread and removes the progress comment, leaving a resolved discussion with no review and no indication that the command failed.

The GitHub comment path already avoids exactly this by demanding an honest verdict — pr_agent/servers/github_app.py:164-169 passes propagate_tool_errors=True with the comment "Preserve compatibility mode while exposing failures to outcome reactions" (that was the fix for #3170).

The other comment-triggered servers (gitlab_webhook.py:72, bitbucket_app.py:367) discard the return value, so they never resolve anything on it. The Azure comment handler is the remaining path that acts on the boolean without asking for an honest one.

Suggested fix: pass propagate_tool_errors=True from handle_request_comment(), so a swallowed tool error surfaces as False and the thread stays open for the author to retry.