-
Notifications
You must be signed in to change notification settings - Fork 469
feat(mpp-idea): add live terminal, MCP config, file search and various improvements #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Renamed plugin to "AutoDev Next", updated vendor email, and revised description for clarity.
Introduce getUtf8FontFamily() for proper CJK/UTF-8 rendering on WASM using Noto Sans SC, while other platforms use system defaults. Also exclude heavy dependencies and large font assets from the IntelliJ plugin build to reduce size.
- Add DevInsCompilerService interface in mpp-core with global instance management - Add DefaultDevInsCompilerService using mpp-core's AST-based compiler - Add IdeaDevInsCompilerService in mpp-idea using devins-lang's PSI-based compiler - Modify KoogLLMService to accept optional compiler service injection - Update IdeaAgentViewModel to inject IDEA compiler for full IDE feature support - Add unit tests for DevInsCompilerService This enables mpp-idea to use the full-featured PSI-based DevInsCompiler with IDE capabilities (Symbol resolution, Refactor, Database, etc.) while CLI/Desktop continues using the cross-platform AST-based compiler.
- Create IdeaDiffActions.kt to encapsulate diff business logic - Reuse core module's PatchProcessor, DiffRepair, showSingleDiff() - Add action buttons to IdeaDiffRenderer (Accept/Reject/View Diff/Repair) - Update IdeaSketchRenderer to pass project parameter - Fix IdeaAnalysisComponents to use named parameters Related to #25
- Create IdeaCodeActions.kt with copy/insert/save methods - Update IdeaCodeBlockRenderer.kt with toolbar (Copy/Insert/Save buttons) - Pass project parameter to IdeaCodeBlockRenderer for action buttons Phase 2 of #25
- Create IdeaPlanActions.kt with parsePlan/copyToClipboard/pinToToolWindow methods - Create IdeaPlanRenderer.kt with plan sections, steps, status indicators - Add plan language support to IdeaSketchRenderer - Reuses core module's MarkdownPlanParser, AgentStateService Phase 3 of #25
- Create IdeaTerminalActions.kt with checkDangerousCommand/executeCommand methods - Create IdeaTerminalRenderer.kt with command display, execute button, output panel - Add bash/shell/sh/zsh language support to IdeaSketchRenderer - Reuses core module's ShellSafetyCheck, ProcessExecutor Phase 4 of #25
- Create IdeaDiagramActions.kt with copySourceToClipboard/saveDiagramToFile/validate methods - Create IdeaMermaidRenderer.kt with toolbar (copy/show code), validation warnings - Update IdeaSketchRenderer to use enhanced IdeaMermaidRenderer - Note: PlantUML excluded from mpp-idea due to size (~20MB) Phase 5 of #25
Introduce async shell execution with live terminal sessions. Shell commands now return a Pending result immediately, and session completion is monitored in the background. Renderers are updated to handle live terminal status and await session results.
Enable real-time shell command output in the IDEA timeline using live process monitoring. Adds a new UI bubble for live terminal sessions and updates shell execution to support async streaming and status reporting.
Adds a cancel button to terminate running shell processes in the live terminal timeline bubble. Also refines timeline logic to prevent duplicate shell command bubbles.
Introduce read-process, wait-process, and kill-process tools to manage long-running shell commands. ShellTool now supports background execution with session IDs, enabling users to read output, wait for completion, or terminate processes asynchronously.
Add support for capturing and sending the current output log to the AI when a live terminal process is cancelled by the user. This includes a new CancelEvent data class and updates to the cancellation flow in the UI and view model.
Problem: - When user clicks Cancel on LiveTerminal, the output was empty - This was because PtyShellExecutor.waitForSession was reading from the same inputStream as ProcessOutputCollector, causing conflicts Root Cause: - Two readers competing for the same PTY inputStream - ProcessOutputCollector in UI layer and waitForSession in core layer Solution: 1. Modified PtyShellExecutor.waitForSession to NOT read output - Only waits for process completion, no output reading - Avoids conflict with UI-layer output collectors 2. Enhanced ProcessOutputCollector to sync output to ShellSessionManager - Added sessionId parameter to ProcessOutputCollector - Syncs output chunks to ManagedSession.appendOutput() - Cancel event now gets actual output from collector buffer 3. Updated IdeaLiveTerminalBubble to use collector.getCurrentOutput() - More reliable than state-based output for cancel events 4. CLI renderer (CodingCli) already reads output independently - Not affected by waitForSession changes
Problem: - ShellSessionManager.kt in commonMain used JVM-specific Process class - This caused WASM build to fail with 'Unresolved reference: Process' Solution: 1. Changed LiveShellSession from data class to regular class 2. Added isAliveChecker and killHandler callback parameters to LiveShellSession 3. Updated ManagedSession to use callback-based process handlers 4. PtyShellExecutor now passes platform-specific handlers when creating session 5. ShellTool sets handlers on ManagedSession after registration This allows the shell session management to work across all platforms (JVM, JS, WASM) while still supporting platform-specific process operations.
…ring Problem: - When shell process completes, ToolOrchestrator.startSessionMonitoring was getting output from LiveShellSession.getStdout() which was empty - This is because PtyShellExecutor.waitForSession no longer reads output (to avoid conflict with UI's ProcessOutputCollector) Solution: - Get output from ShellSessionManager.getSession().getOutput() first - This output is synced by UI's ProcessOutputCollector in real-time - Fall back to LiveShellSession.getStdout() if not available Now when a shell command completes (or is cancelled), the output collected by the UI will be properly sent to the AI.
Problem: - PTY process was not configured properly, causing output stream to close prematurely or not be readable by ProcessOutputCollector - Missing critical PTY configuration options Solution: - Add setInitialColumns(240) and setInitialRows(80) for proper terminal size - Add setUnixOpenTtyToPreserveOutputAfterTermination(true) to keep output stream open after process completes - This matches the configuration used in ProcessExecutor.createInteractiveProcess Now the ProcessOutputCollector should be able to read output from PTY process.
Problem: - ProcessOutputCollector was trying to read both inputStream and errorStream - PTY processes combine stdout and stderr into a single stream (inputStream) - Reading both streams simultaneously caused race conditions and missing output - errorStream for PTY is empty/EOF, causing stderrJob to exit immediately Solution: - Remove separate stderr reader - only read from process.inputStream - PTY combines all output into inputStream, matching PtyShellExecutor behavior - Remove isError parameter from readStream() since PTY doesn't separate streams This matches the pattern used in PtyShellExecutor.executeWithPty() which only reads inputStream and sets stderr to empty string.
… terminal output - Add cancelledByUser flag to ManagedSession for tracking user-initiated cancellations - Add markSessionCancelledByUser() method to ShellSessionManager for non-suspend context - Register sessions to ShellSessionManager in ToolOrchestrator for cancel event handling - Sync output to ManagedSession in PtyShellExecutor.waitForSession() - Add AnsiStripper utility to clean ANSI escape sequences from terminal output - Strip ANSI codes before sending output to AI for cleaner, readable text - Update CodingAgentRenderer interface with cancelledByUser parameter - Update all renderer implementations (JewelRenderer, ComposeRenderer, CodingCliRenderer) - Include captured output in error messages when commands timeout or fail
…commands - Skip AnalysisAgent for cancelled commands in CodingAgentExecutor - Skip error rendering for user-cancelled scenarios - Preserve metadata in ToolExecutionResult.failure() for cancelled flag propagation - Apply same fix to DocumentAgentExecutor When user cancels a command (e.g., bootRun), the flow now: 1. Skips triggering AnalysisAgent for the cancelled output 2. Skips displaying extra 'Tool execution failed' error message 3. Only shows the concise cancellation confirmation This eliminates unnecessary double-messaging (Summary + Error) for intentional cancellations.
- Fix thread-safety in ShellSessionManager.markSessionCancelledByUser() with synchronized block
- Fix condition ordering in JewelRenderer: check cancelledByUser before exitCode == 0
- Add execution_time_ms to awaitManagedSession for metadata consistency
- Extract buildCancelledMessage helper to reduce code duplication
- Simplify statusMessage logic in CodingCli (remove redundant when branches)
- Add errorType to ComposeRenderer for cancelled results
- Fix spacing in AnsiStripper ('(' , ')' -> '(', ')')
- Remove duplicate inputStream reader in PtyShellExecutor to fix data race
synchronized is JVM-only. Direct access is safe because: - JS/WASM are single-threaded - On JVM, boolean assignment is atomic and cancelledByUser is only written once
- Add IdeaFileSearchPopup for adding files to context - Support searching project files using FilenameIndex - Prioritize recently opened files using EditorHistoryManager - Multi-select files with checkbox UI - Filter binary and ignored files - Update IdeaTopToolbar with file selection functionality - Add project parameter for file search - Add onFilesSelected callback for selected files - Show file search popup on Add File button click - Fix IdeaBottomToolbar right-side config button - Change from model config to MCP config dialog - MCP config dialog now opens directly from settings button - Update IdeaDevInInputArea in IdeaAgentApp - Add IdeaTopToolbar to input area - Manage selected files state - Append file paths to message on send (/file:path format)
- Fix EDT violation: move searchAllItems to background thread using Dispatchers.IO - Remove unused onMcpConfigClick parameter from IdeaBottomToolbar - Add History icon to IdeaComposeIcons for recently opened files menu
- Restructure IdeaFileSearchPopup to use Box container with trigger button - Add IdeaContextManager for context state management - Simplify popup content with search field at top - Add recent files display and file/folder search - Add new icons: CheckBox, CheckBoxOutlineBlank, Remove - Update IdeaTopToolbar to use new popup API
- Add isDirectory field to SelectedFileItem - Use /dir: command for directories, /file: for files - Add Search icon to IdeaComposeIcons - Improve search field UI with icon and better padding - Update placeholder text to 'Search files and folders...'
- Use PsiCompiledFile interface instead of ClsFileImpl implementation class - This fixes NoClassDefFoundError in some IDE configurations - Remove unnecessary null check for content
Extract IdeaDevInInputArea composable from IdeaAgentApp.kt into its own file for better modularity and code organization. No functional changes.
- Add unified border around IdeaDevInInputArea for cohesive look - IdeaTopToolbar now supports horizontal scroll in collapsed mode - Add expand/collapse button to toggle between horizontal and vertical file list - FileChipExpanded shows full path in expanded mode - Use animateContentSize for smooth expand/collapse animation - Remove duplicate ExpandLess/ExpandMore icon definitions
…ement 1. Restyle IdeaMcpConfigDialog to match IdeaModelConfigDialog pattern: - Use styled Box container with rounded corners and proper background - Add proper tab selector with visual feedback - Improve spacing and visual hierarchy - Add Escape key handling for dialog dismissal - Extract IdeaMcpConfigDialogContent for reusability 2. Implement prompt enhancement feature: - Create IdeaPromptEnhancer service for AI-powered prompt optimization - Load domain dictionary from project's .autodev/domain.csv - Load README for project context - Use LLM to enhance prompts with domain-specific vocabulary - Add loading state indicator on enhancement button - Integrate with IdeaBottomToolbar and IdeaDevInInputArea
1. Add replaceText() method to IdeaDevInInput for setting text content - Renamed from setText() to avoid conflict with EditorTextField.setText() - Uses WriteCommandAction for proper document modification 2. Fix prompt enhancement in IdeaDevInInputArea: - Use IntelliJ Logger instead of KLogger (not available in mpp-idea) - Move logger to file-level to avoid Composable context issues - Use Dispatchers.IO for LLM calls - Use ApplicationManager.invokeLater for EDT updates - Add proper logging for debugging 3. Add logging to IdeaPromptEnhancer: - Log enhancement progress and results - Log model configuration and LLM response details - Log errors with stack traces
…n IDE - Create IdeaMcpConfigDialogWrapper using IntelliJ's DialogWrapper - Dialog now appears centered in the IDE window like IdeaModelConfigDialog - Proper z-index handling when used with SwingPanel components - Update IdeaBottomToolbar to use IdeaMcpConfigDialogWrapper.show() - Mark old IdeaMcpConfigDialog as deprecated
Add step to maximize available disk space in GitHub Actions by using jlumbroso/free-disk-space before fetching sources.
1. IdeaPromptEnhancer: - Log only metadata (length) instead of user prompt content to avoid sensitive info leakage - Fix domain dictionary fallback logic to properly check both paths - Add debug logging for file loading failures - Fix regex to handle code blocks without trailing newline 2. IdeaMcpConfigDialog: - Add proper @deprecated annotation with ReplaceWith suggestion 3. IdeaBottomToolbar: - Remove unused kotlinx.coroutines.launch import 4. IdeaDevInInputArea: - Extract duplicate send logic into buildAndSendMessage helper function - Use isProcessingRef to fix stale closure issue in SwingPanel listener - Remove redundant withContext(Dispatchers.Main) + invokeLater combination
1. McpServersTab improvements: - Add header row with title and real-time JSON validation status - Show validation status indicator (Loading/Invalid JSON/Valid JSON) - Add styled error container with icon for error details - Add border around JSON editor with error state styling - Add footer with example hint and Save & Reload button with icon - Use CircularProgressIndicator for loading states 2. Fix Icon component usage: - Change 'key =' to 'imageVector =' for all Icon components - Replace IdeaComposeIcons.Schedule with IdeaComposeIcons.History 3. UI consistency: - Match the design patterns from ToolConfigDialog.kt - Use consistent spacing, colors, and typography
…ement 1. Create IdeaToolConfigService: - Project-level service for managing tool configuration state - Provides StateFlow for observing config changes - Uses configVersion counter to trigger UI recomposition - Centralized save/load with notification to listeners 2. Update IdeaToolLoadingStatusBar: - Add project parameter - Observe configVersion from IdeaToolConfigService - Recompute toolStatus when config version changes 3. Update IdeaAgentViewModel: - Use IdeaToolConfigService for loading tool config - Get fresh config from service in getToolLoadingStatus() 4. Update IdeaMcpConfigDialog: - Add project parameter to IdeaMcpConfigDialogContent - Use IdeaToolConfigService.saveAndUpdateConfig() for auto-save - Notify listeners when tools are toggled 5. Register service in plugin.xml This ensures the status bar updates when MCP tools are enabled/disabled in the configuration dialog.
Problem: DevInsProgramRunner was implementing Disposable and registering a MessageBusConnection with 'this' as parent, but the runner itself was never properly disposed, causing memory leak warnings. Solution: - Remove Disposable interface from DevInsProgramRunner - Connect to project's message bus instead of application's - Register the connection with the project as parent disposable - This ensures proper cleanup when the project is closed The connection is now tied to the project lifecycle instead of the runner's lifecycle, which is the correct pattern for ProgramRunner implementations.
|
Caution Review failedThe pull request is closed. WalkthroughThis PR introduces asynchronous shell execution with live terminal rendering, a compiler service abstraction layer, and comprehensive IDE UI enhancements including context management, prompt optimization, and interactive renderers for diffs, plans, and diagrams. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as User/LLM
participant CodingAgent as CodingAgentExecutor
participant ToolOrch as ToolOrchestrator
participant ShellExec as LiveShellExecutor
participant SessionMgr as ShellSessionManager
participant Renderer as CodingAgentRenderer
participant Monitor as Session Monitor<br/>(background)
Client->>CodingAgent: Execute tool call (shell cmd)
CodingAgent->>ToolOrch: Execute shell tool
alt Async Mode (wait=false)
ToolOrch->>ShellExec: startLiveExecution()
ShellExec->>SessionMgr: registerSession()
SessionMgr-->>ShellExec: ManagedSession
ShellExec-->>ToolOrch: LiveShellSession
ToolOrch-->>CodingAgent: ToolResult.Pending
ToolOrch->>Monitor: startSessionMonitoring() [background]
CodingAgent-->>Client: Pending (session running)
Monitor->>SessionMgr: getSession()
Monitor->>ShellExec: waitForSession()
ShellExec-->>Monitor: ✓ exit code & output
Monitor->>Renderer: updateLiveTerminalStatus()
Renderer->>Renderer: Update timeline item
Renderer-->>Monitor: Emit ToolResult
Monitor->>SessionMgr: removeSession()
else Sync Mode (wait=true)
ToolOrch->>ShellExec: startLiveExecution()
ShellExec->>ShellExec: Wait for completion
ShellExec-->>ToolOrch: ToolResult.Success/Error
ToolOrch-->>CodingAgent: ToolResult.Success/Error
CodingAgent-->>Client: Final result
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (55)
Comment |
Summary
This PR includes multiple improvements and new features for the mpp-idea module and related components.
Key Changes
Live Terminal Support
MCP Config Dialog
File Search Popup
Input Area Improvements
Actions and Renderers
Bug Fixes
CI/CD
Other
Pull Request opened by Augment Code with guidance from the PR author
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.