Skip to content

feat: ACP CLI provider support with Claude and Codex#22

Merged
STRRL merged 2 commits intomasterfrom
bdclaw/bor-511-acp-cli-provider
Mar 10, 2026
Merged

feat: ACP CLI provider support with Claude and Codex#22
STRRL merged 2 commits intomasterfrom
bdclaw/bor-511-acp-cli-provider

Conversation

@STRRL
Copy link
Owner

@STRRL STRRL commented Mar 10, 2026

Summary

  • Integrate ACP (Agent Communication Protocol) providers for workspace analyze, supporting Claude Code and Codex backends
  • Use eino-acp library for provider command resolution instead of hardcoded command slices
  • Remove Gemini provider support, keeping only Claude and Codex

Test plan

  • make build passes
  • Unit tests for BuildACPCommand pass (go test ./pkg/analyzer/ -run TestBuildACP)
  • Manual test: lapp workspace analyze --topic <topic> --acp claude
  • Manual test: lapp workspace analyze --topic <topic> --acp codex

bdclaw2026 and others added 2 commits March 10, 2026 03:37
Drop Gemini ACP support, keeping only Claude and Codex providers.
Update eino-acp dependency and use its command builders instead of
hardcoded command slices.
@STRRL STRRL merged commit 5a6b00c into master Mar 10, 2026
2 checks passed
@STRRL STRRL deleted the bdclaw/bor-511-acp-cli-provider branch March 10, 2026 04:09
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the AI analysis capabilities of the lapp CLI tool by integrating the Agent Communication Protocol (ACP). The workspace analyze command now leverages ACP to interact with external AI agent backends, specifically Claude and Codex, providing a more flexible and extensible architecture for AI-powered log analysis. This change removes direct OpenRouter integration for analysis, shifting towards a provider-agnostic approach managed by ACP.

Highlights

  • ACP Provider Integration: Introduced support for Claude and Codex as ACP (Agent Communication Protocol) providers for the workspace analyze command, enabling flexible AI agent backends.
  • Refactored Agent Execution: Migrated the workspace analyze command to utilize the eino-acp library for dynamic provider command resolution, replacing previous hardcoded logic and OpenRouter-specific integrations.
  • Streamlined AI Backends: Removed explicit support for the Gemini provider, streamlining the available AI backends for analysis to Claude and Codex.
  • Documentation Updates: Updated the README.md to reflect the new workspace command structure, usage examples for ACP providers, and revised environment variable requirements.
  • Dependency Management: Updated existing Go modules and added new ones, including eino-acp and coder/acp-go-sdk, to support the new ACP-based architecture.
Changelog
  • README.md
    • Updated example commands for workspace create, workspace add-log, and workspace analyze.
    • Revised the "Environment Variables" section to reflect OPENROUTER_API_KEY usage for semantic labeling and added a note for provider-specific auth.
    • Modified the "Commands" table to list new workspace commands and remove old ingest, templates, query, analyze, and debug commands.
    • Updated the "Query / Analyze" section title to "Workspace Notes / Analyze".
  • cmd/lapp/workspace.go
    • Added a new analyzeWsACP variable to store the selected ACP provider.
    • Modified the workspaceAnalyzeCmd to include an --acp flag for selecting providers (claude|codex).
    • Updated the --model flag description to clarify it's for the ACP agent model.
    • Removed the OPENROUTER_API_KEY environment variable check from runWorkspaceAnalyze.
    • Updated the analyzer.Config to use Provider instead of APIKey.
  • go.mod
    • Updated github.com/cloudwego/eino from v0.7.35 to v0.8.0.
    • Updated github.com/cloudwego/eino-ext/adk/backend/local from v0.1.1 to v0.1.2-0.20260306073537-008f82264d85.
    • Added github.com/strrl/eino-acp v0.0.0-20260310040548-829a6c320793.
    • Added github.com/bmatcuk/doublestar/v4 v4.10.0 as an indirect dependency.
    • Updated github.com/bytedance/sonic and github.com/bytedance/sonic/loader versions.
    • Added github.com/coder/acp-go-sdk v0.6.3 as an indirect dependency.
    • Updated github.com/stretchr/objx and github.com/stretchr/testify versions.
  • go.sum
    • Updated checksums to reflect changes in go.mod, including new dependencies and version bumps.
  • pkg/analyzer/acp_tool_model.go
    • Added a new file defining acpToolCallingModel to adapt eino-acp.ChatModel to model.ToolCallingChatModel, making WithTools a no-op.
  • pkg/analyzer/analyzer.go
    • Removed imports related to bytes, encoding/json, io, net/http, openrouter, llmconfig, and otelhttp.
    • Updated Config struct to use Provider instead of APIKey.
    • Modified RunAgentWithPrompt to use BuildACPCommand for provider resolution and einoacp.NewChatModel for creating the chat model.
    • Replaced openrouter.NewChatModel and the fixupRoundTripper with ACP integration.
    • Adapted local.NewBackend to use newLocalBackendAdapter.
    • Changed fsmw.NewMiddleware to fsmw.New and updated its configuration.
    • Updated adk.ChatModelAgentConfig to use newACPToolCallingModel and Handlers instead of Middlewares.
    • Removed preflightCheck function and fixupRoundTripper struct/function.
  • pkg/analyzer/local_backend_adapter.go
    • Added a new file defining localBackendAdapter to implement filesystem.Backend and filesystem.StreamingShell interfaces using local.Local.
  • pkg/analyzer/provider.go
    • Added a new file defining ProviderClaude and ProviderCodex constants.
    • Implemented BuildACPCommand to resolve providers and construct the appropriate eino-acp command.
    • Implemented resolveProvider to normalize and validate provider names.
  • pkg/analyzer/provider_test.go
    • Added a new file containing unit tests for the BuildACPCommand function, covering valid and invalid provider scenarios.
Activity
  • The author has confirmed that make build passes.
  • Unit tests for the BuildACPCommand function have been verified to pass.
  • Manual testing for lapp workspace analyze with Claude and Codex ACP providers is pending.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request integrates ACP (Agent Communication Protocol) providers for the workspace analyze command, replacing direct OpenRouter integration with a more flexible system supporting claude and codex backends via the eino-acp library. While the refactoring and new unit tests are positive, it introduces a critical security vulnerability by enabling automatic approval for AI agent actions with shell execution capabilities and exposure to untrusted input, which allows for arbitrary command execution via prompt injection. The most urgent fix is to disable auto-approval for sensitive tools and implement stricter controls over the agent's execution environment. Additionally, minor documentation inconsistencies were found in README.md regarding the gemini provider.

Comment on lines +108 to 112
chatModel, err := einoacp.NewChatModel(ctx, &einoacp.Config{
Command: command,
Cwd: absDir,
AutoApprove: true,
})

Choose a reason for hiding this comment

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

security-critical critical

The AI agent is configured with AutoApprove: true, which allows it to execute tools without any human intervention. Combined with the fact that the agent is provided with an execute tool (which can run shell commands) and processes untrusted input from both the user's question and the log files, this creates a critical security risk. An attacker could use prompt injection (either directly via the question or indirectly via a malicious log line) to trick the agent into executing arbitrary shell commands on the user's machine. This could lead to full system compromise, data exfiltration, or other malicious activities.

To remediate this, you should set AutoApprove: false to ensure that any sensitive action, especially shell command execution, requires explicit user approval. Additionally, consider restricting the execute tool to a safe subset of commands or running it within a restricted sandbox environment.

Suggested change
chatModel, err := einoacp.NewChatModel(ctx, &einoacp.Config{
Command: command,
Cwd: absDir,
AutoApprove: true,
})
chatModel, err := einoacp.NewChatModel(ctx, &einoacp.Config{
Command: command,
Cwd: absDir,
AutoApprove: false,
})

Comment on lines 148 to 150
if question != "" {
userMessage = "Analyze the log files in the workspace. The user's question: " + question
}

Choose a reason for hiding this comment

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

security-high high

The user-supplied question is directly concatenated into the userMessage sent to the AI agent. This is a classic prompt injection vector. An attacker could provide a malicious question designed to override the agent's instructions and force it to perform unauthorized actions, such as using the execute tool to run arbitrary commands. While natural language input is difficult to sanitize perfectly, you should implement safeguards to detect and prevent common prompt injection patterns, and more importantly, ensure that the agent's capabilities are strictly limited and require human approval for sensitive actions.

- `OPENROUTER_API_KEY`: Required for `analyze` and `debug run` commands
- `OPENROUTER_API_KEY`: Required for semantic labeling in `workspace add-log`
- `MODEL_NAME`: Override default LLM model (default: `google/gemini-3-flash-preview`)
- Provider-specific auth for ACP agent CLI (for example Claude/Codex/Gemini CLI login credentials)

Choose a reason for hiding this comment

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

medium

This line mentions Gemini as an example for provider-specific authentication. However, the pull request description states that Gemini support has been removed, and the implementation only supports claude and codex. To avoid confusion, please remove the reference to Gemini.

Suggested change
- Provider-specific auth for ACP agent CLI (for example Claude/Codex/Gemini CLI login credentials)
- Provider-specific auth for ACP agent CLI (for example Claude/Codex CLI login credentials)

| `workspace create <topic>` | Create a workspace under `~/.lapp/workspaces/` |
| `workspace list` | List all workspace topics |
| `workspace add-log --topic <topic> <file>` | Add log file and rebuild patterns/notes |
| `workspace analyze --topic <topic> [question]` | Run AI analysis (`--acp claude|codex|gemini`) |

Choose a reason for hiding this comment

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

medium

The description for the workspace analyze command lists gemini as a supported provider. According to the pull request description and the implementation, Gemini support has been removed. Please update the documentation to only list the currently supported providers (claude and codex).

Suggested change
| `workspace analyze --topic <topic> [question]` | Run AI analysis (`--acp claude|codex|gemini`) |
| `workspace analyze --topic <topic> [question]` | Run AI analysis (`--acp claude|codex`) |

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd613eca30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

| `workspace create <topic>` | Create a workspace under `~/.lapp/workspaces/` |
| `workspace list` | List all workspace topics |
| `workspace add-log --topic <topic> <file>` | Add log file and rebuild patterns/notes |
| `workspace analyze --topic <topic> [question]` | Run AI analysis (`--acp claude|codex|gemini`) |

Choose a reason for hiding this comment

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

P2 Badge Remove unsupported Gemini provider from analyze docs

The command table says workspace analyze supports --acp ...|gemini, but BuildACPCommand only accepts claude and codex and returns an error for anything else (pkg/analyzer/provider.go), so users following this README path will hit a hard runtime failure when trying Gemini. Please keep the documented provider list consistent with the actual accepted values.

Useful? React with 👍 / 👎.

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.

2 participants