[AutoDevNext] FLOW-2247 atlascode: Error:RovoDevChatProvider.processRovoDevResponse - #1881
Open
atlassian[bot] wants to merge 1 commit into
Conversation
…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
Bot
requested review from
Blastoplex,
amarg-at,
bwieger-atlassian-com,
cabella-dot,
ccallcottstevens,
cindy-atl,
dchiew-atl,
jwang19-atlassian,
marcomura,
matt-lassian,
mattcolman,
sdzh-atlassian and
teg-atlassian
as code owners
June 21, 2026 03:48
|
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. Already signed the CLA? To re-check, try refreshing the page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an unhandled promise rejection in
RovoDevChatProvider.processRovoDevResponsewhen handlingdeferred_requeststreaming events (FLOW-2247).Root Cause
In
processRovoDevResponse, thedeferred_requestcase calledprocessDeferredToolCallResponse(deferredTool)withoutawait. This meant any exception thrown inside that method (e.g.JSON.parsefailures when processingask_user_questionsorexit_plan_modeargs) 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: Addedawaitto theprocessDeferredToolCallResponsecall inprocessRovoDevResponse. Wrapped thedeferred_requestcase in a block ({ }) to avoid variable scoping issues with theconstdeclaration. Added a guard: ifresponse.toolsis empty (backend sendsdeferred_requestwith no calls), log a warning and skip rather than passingundefinedto 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 ofask_user_questionsUI 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
awaitfix is a one-line change but has significant impact: previously any error thrown insideprocessDeferredToolCallResponse(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.response.tools[0]is undefined) is defensive programming to prevent a second class of crash if the backend ever sends adeferred_requestwith no tool calls.Rovo Dev code review: Rovo Dev couldn't review this pull request
Rovo Dev does not review pull requests created by bot accounts.