Skip to content

[AutoDevNext] FLOW-2247 atlascode: Error:RovoDevChatProvider.processRovoDevResponse - #1881

Open
atlassian[bot] wants to merge 1 commit into
mainfrom
autodevnext/FLOW-2247-atlascode-error-rovodevchatprovider-processrovodevresponse
Open

[AutoDevNext] FLOW-2247 atlascode: Error:RovoDevChatProvider.processRovoDevResponse#1881
atlassian[bot] wants to merge 1 commit into
mainfrom
autodevnext/FLOW-2247-atlascode-error-rovodevchatprovider-processrovodevresponse

Conversation

@atlassian

@atlassian atlassian Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

🤖 This PR was generated by AutoDev bot. For any help or concerns, reach out on #devai-autodev-community.

Action needed: please review, approve, and merge if this PR is ready. AutoDev will not automatically merge/decline it. We collect decline feedback to improve quality. Thanks!
Changes needed or questions? Leave comments. Autodev now addresses PR comments every few hours.

Summary

Fixes an unhandled promise rejection in RovoDevChatProvider.processRovoDevResponse when handling deferred_request streaming events (FLOW-2247).

Root Cause

In processRovoDevResponse, the deferred_request case called processDeferredToolCallResponse(deferredTool) without await. This meant any exception thrown inside that method (e.g. JSON.parse failures when processing ask_user_questions or exit_plan_mode args) would escape as an unhandled promise rejection rather than being caught by the existing try/catch inside the method and surfaced to the user as an error dialog.

This is consistent with the error pattern described in FLOW-2175 (JSON parsing error) and related bugs FLOW-2254 and FLOW-2256.

Changes

  • src/rovo-dev/rovoDevChatProvider.ts: Added await to the processDeferredToolCallResponse call in processRovoDevResponse. Wrapped the deferred_request case in a block ({ }) to avoid variable scoping issues with the const declaration. Added a guard: if response.tools is empty (backend sends deferred_request with no calls), log a warning and skip rather than passing undefined to the handler.
  • src/rovo-dev/rovoDevChatProvider.test.ts: Added 3 new tests covering: (1) error surfacing when args are malformed JSON, (2) graceful handling of empty tools array, (3) correct display of ask_user_questions UI when args are valid.
  • CHANGELOG.md: Added entry describing the fix.

Recent PR change-site overlap

The clash check via TWG Bitbucket tooling was inconclusive because this repository is hosted on GitHub, not Bitbucket. No Bitbucket-based clash check was possible.

Notes for Reviewers

  • The await fix is a one-line change but has significant impact: previously any error thrown inside processDeferredToolCallResponse (including valid JSON parse errors when backend sends malformed args) would silently become an unhandled rejection, contributing to the SLO error tracked in FLOW-2247.
  • The empty-tools guard (logging a warning when response.tools[0] is undefined) is defensive programming to prevent a second class of crash if the backend ever sends a deferred_request with no tool calls.
  • Tests were written to verify the async error-handling path works end-to-end (error shown as dialog), not just that the code doesn't throw.

Rovo Dev code review: Rovo Dev couldn't review this pull request
Rovo Dev does not review pull requests created by bot accounts.

…ndled promise rejection

The call to processDeferredToolCallResponse in the deferred_request case of
processRovoDevResponse was not awaited, meaning any errors thrown inside it
(e.g. JSON.parse failures when processing ask_user_questions or exit_plan_mode
args) would escape as unhandled promise rejections instead of being caught and
surfaced as error dialogs via processError.

Changes:
- Added 'await' to the processDeferredToolCallResponse call so errors propagate
  correctly up the async call chain and are handled by the existing try/catch.
- Wrapped the deferred_request case in a block to avoid variable scoping issues
  with the const declaration.
- Added a guard for empty tools arrays in deferred_request payloads to prevent
  passing undefined to processDeferredToolCallResponse.
- Added three tests covering: error surfacing when args are invalid JSON, graceful
  handling of empty tools arrays, and correct display of ask_user_questions UI.
- Updated CHANGELOG.md with the fix description.

Resolves: FLOW-2247
@atlassian-cla-bot

Copy link
Copy Markdown

Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution.
If your email is listed below, please ensure that you sign the CLA with the same email address.

The following users still need to sign our CLA:
❌rayCodingNow

Already signed the CLA? To re-check, try refreshing the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant