Skip to content

Conversation

@jwang19-atlassian
Copy link
Contributor

@jwang19-atlassian jwang19-atlassian commented Jan 22, 2026

What Is This Change?

This pull request introduces support for agent modes in the Rovo Dev extension, including backend API integration, state management, and frontend messaging. It adds the ability to get and set the agent mode (ask, default, plan), retrieve available modes, and communicate these changes between the extension and the webview UI. The changes include new API client methods, interface definitions, state handling in the chat provider, message types, and corresponding tests and UI updates.

https://www.loom.com/share/af22caad395a4f5c8c3ccbcd1c9a4189

Agent Mode API Integration:

  • Added new methods to RovoDevApiClient for getting, setting, and listing agent modes (getAgentMode, setAgentMode, getAvailableModes), along with error handling and relevant interface definitions (AgentMode, RovoDevGetAgentModeResponse, etc.).

Agent Mode State Management:

  • Introduced agent mode state to RovoDevChatProvider, including initialization from the API, getters/setters, and public methods for interacting with agent mode and available modes.

Webview Messaging and UI Communication:

  • Extended RovoDevWebviewProvider to handle agent mode requests (get/set/current/available) and send completion messages to the webview.
  • Added new message types and payloads to RovoDevProviderMessageType and RovoDevProviderMessage for agent mode operations.

UI and Styling Updates:

  • Refactor PromptInputItems to separated component to improve readability
  • Adapt ADS components for new components and partial existed components

Internal Improvements:

  • Refactored VS Code API acquisition in the messaging API to ensure a singleton instance for message posting.

Dependency Update:

  • Added @atlaskit/primitives to package.json dependencies.

How Has This Been Tested?

Basic checks:

  • npm run lint
  • npm run test

@jwang19-atlassian jwang19-atlassian mentioned this pull request Jan 22, 2026
2 tasks
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
RovoDevLogger.error(new Error(`Failed to initialize agent mode: ${errorMessage}`));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔎 Code Design - Error Management

The error handling in setReady logs the error but continues execution, which might leave the agent mode in an inconsistent state.

Details

📖 Explanation: Consider setting a default fallback mode or rethrowing the error to ensure the application state remains consistent when agent mode initialization fails.

Uses AI. Verify results. Give Feedback

<Box
key={modeInfo.mode}
xcss={styles.modeItem}
onClick={() => setAgentMode(modeInfo.mode as AgentMode)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔎 Code Design - Model Structure

The RovoDevModeInfo.mode field uses string type which could allow invalid modes to be passed to setAgentMode that expects AgentMode union type.

Details

📖 Explanation: The type cast as AgentMode could fail at runtime if the API returns a mode not in the AgentMode union, leading to unexpected behavior in the application.

Uses AI. Verify results. Give Feedback

break;

case RovoDevViewResponseType.GetAvailableAgentModes:
const modes = await this._chatProvider.getAvailableAgentModes();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The agent modes should be sent to the front end on initialization so the user is not waiting for the modes after page load

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.

3 participants