Skip to content

Conversation

@phodal
Copy link
Member

@phodal phodal commented Dec 1, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added command-line interface for executing coding tasks with custom rendering
    • Redesigned model configuration dialog with improved dropdown menus
    • Terminal output now displays execution time and exit codes
  • Improvements

    • Enhanced popup rendering for better UI consistency
  • Documentation

    • Added guidance for Swing/Compose component integration
  • Chores

    • Version updated to 0.3.3

✏️ Tip: You can customize this high-level summary in your review settings.

Update mppVersion in gradle.properties to use the latest release.
Switch model selector dropdown to Jewel's PopupMenu for correct z-index with SwingPanel. Enable custom popup rendering to fix Compose/Swing overlay issues. Auto-increment config names to avoid duplicates when saving.
Extend LiveTerminalItem to include exit code, execution time, and output parameters for enhanced terminal session details.
…ogWrapper

Replaces the PromptOptimizationDialog with a new ModelConfigDialogWrapper and updates related usages for improved dialog management.
Refine and update agent documentation for clarity and accuracy.
Revamp English and Chinese system prompts for CodingAgentTemplate with improved structure, clearer guidelines, and more concise instructions, inspired by Augment Agent's design. This enhances usability and agent behavior consistency.
Revise task completion and tool usage strategies for clarity and efficiency in both English and Chinese. Emphasize focus, minimal exploration, and step-by-step guidance.
Introduce a new Gradle task and CLI entrypoint to run CodingAgent tasks from the command line. Includes a console renderer and configuration via ~/.autodev/config.yaml. Also clarifies CodingAgentTemplate completion instructions.
@phodal phodal merged commit 82b8d18 into unit-mesh:master Dec 1, 2025
3 of 4 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Dec 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces a new CLI tool for running the CodingAgent, refactors IDE dialog components to use Jewel's PopupMenu renderer, creates a DialogWrapper-based model config dialog, removes the prompt optimization dialog, updates prompt templates with additional context, and bumps versions across the project.

Changes

Cohort / File(s) Summary
Documentation & Configuration
AGENTS.md, gradle.properties, mpp-ui/package.json
Adds Swing/Compose z-index guidance to docs; bumps MPP version from 0.3.2 to 0.3.3 and npm package version accordingly.
Prompt Template Updates
mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodingAgentTemplate.kt
Enhances EN and ZH coding agent prompts with additional contextual guidance, Augment Agent structure references, and formatting adjustments.
IDE Dialog Refactoring
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt, IdeaModelConfigDialogWrapper.kt, IdeaModelSelector.kt
Replaces Compose Popup-based dropdowns with Jewel's PopupMenu; extracts dialog content to reusable IdeaModelConfigDialogContent; adds new IdeaModelConfigDialogWrapper for IDE DialogWrapper integration with auto-generated config names and default model preloading.
IDE Dialog Removal
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaPromptOptimizationDialog.kt
Removes entire composable dialog file for prompt optimization (LaunchedEffect-based enhancement, two-pane preview, and apply/dismiss logic).
IDE Integration Updates
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt, IdeaAgentToolWindowFactory.kt
Switches model config dialog from composable to DialogWrapper via IdeaModelConfigDialogWrapper.show; adds unique config name generation via ConfigManager; enables JewelFlags.useCustomPopupRenderer for Jewel-based popup rendering.
CLI Tool Implementation
mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt
Introduces new CodingCli object with main entry point and CodingCliRenderer for running CodingAgent from terminal; loads ~/.autodev/config.yaml, initializes LLM service, parses task and iteration limits from system properties, and renders iteration headers, LLM outputs, tool calls, results, and token info.
Terminal UI & Build Updates
mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt, mpp-ui/build.gradle.kts
Expands LiveTerminalItem signature to include exitCode, executionTimeMs, and output parameters; adds new runCodingCli Gradle task to launch CodingCli (declared twice, resulting in duplication).

Sequence Diagram

sequenceDiagram
    participant User as User/CLI
    participant CodingCli
    participant ConfigMgr as ConfigManager
    participant LLMSvc as LLMService
    participant Agent as CodingAgent
    participant Renderer as CodingCliRenderer
    participant FS as Filesystem

    User->>CodingCli: main(args)
    CodingCli->>CodingCli: Parse projectPath, task, maxIterations
    CodingCli->>ConfigMgr: Load ~/.autodev/config.yaml
    ConfigMgr-->>CodingCli: NamedModelConfig
    CodingCli->>LLMSvc: Initialize with active config
    LLMSvc-->>CodingCli: Ready
    CodingCli->>Agent: Create CodingAgent with LLMSvc
    CodingCli->>Renderer: Attach renderer callback
    
    rect rgb(240, 250, 240)
    note over CodingCli, Renderer: Execution Loop
    loop Each iteration
        CodingCli->>Renderer: renderIterationHeader(current, max)
        CodingCli->>Agent: Execute task step
        Agent->>LLMSvc: Query LLM
        LLMSvc-->>Agent: Response chunks
        Agent->>Renderer: renderLLMResponseChunk(chunk)
        
        opt Has tool call
            Agent->>Renderer: renderToolCall(toolName, params)
            Agent->>FS: Execute tool
            FS-->>Agent: Result
            Agent->>Renderer: renderToolResult(name, success, output)
        end
    end
    end
    
    CodingCli->>Renderer: renderTaskComplete()
    Renderer-->>User: Final status & results
    CodingCli->>User: Exit
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Dialog refactoring complexity: Integration of Jewel's PopupMenu requires understanding of custom popup renderer semantics and state management across multiple dialog variants (composable, wrapper, legacy).
  • CodingCli implementation: Intricate setup involving YAML config loading, LLM service initialization, agent lifecycle, and multi-phase rendering callbacks; verify rendering logic completeness.
  • Signature changes: LiveTerminalItem expanded with three new optional parameters; confirm all call sites and Android implementation are updated consistently.
  • Build script duplication: runCodingCli task declared twice in build.gradle.kts—needs verification that this is intentional or should be consolidated.
  • Deprecation pathway: Verify IdeaModelConfigDialogLegacy references are properly deprecated and updated across call sites.

Possibly related PRs

  • feat: add basic MPP IDEA support #471 #473: Directly overlaps on IDEA plugin changes (IdeaAgentApp, IdeaAgentToolWindowFactory, Jewel popup/PopupMenu handling, dialog refactoring) indicating sequential or related work.
  • Feat task tracking UI 959ce #466: Updates the same CodingAgentTemplate.kt prompt constants (EN and ZH versions), suggesting coordinated prompt engineering iterations.

Poem

🐰 A rabbit's verse on PopupMenus and CLIs:

With PopupMenus now, our dialogs stand tall,
And CodingCli leaps where agents once crawled,
From YAML configs, the LLMs take flight,
While Jetbrains bridges compose day and night—
Our codebase hops forward with each blessed change! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bbe9401 and 2af4664.

📒 Files selected for processing (13)
  • AGENTS.md (1 hunks)
  • gradle.properties (1 hunks)
  • mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodingAgentTemplate.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt (6 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialogWrapper.kt (1 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelSelector.kt (2 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaPromptOptimizationDialog.kt (0 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt (3 hunks)
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentToolWindowFactory.kt (2 hunks)
  • mpp-ui/build.gradle.kts (3 hunks)
  • mpp-ui/package.json (1 hunks)
  • mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt (1 hunks)
  • mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

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