-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ACP CLI provider support with Claude and Codex #22
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,18 +8,15 @@ AI-native log pattern discovery: cluster logs cheaply, semantify templates with | |||||
| # Build | ||||||
| go build ./cmd/lapp/ | ||||||
|
|
||||||
| # Ingest logs (stdin or file) | ||||||
| cat app.log | go run ./cmd/lapp/ ingest - --db lapp.duckdb | ||||||
| go run ./cmd/lapp/ ingest /var/log/syslog --db lapp.duckdb | ||||||
| # Create a workspace | ||||||
| go run ./cmd/lapp/ workspace create app-incident | ||||||
|
|
||||||
| # View discovered templates | ||||||
| go run ./cmd/lapp/ templates --db lapp.duckdb | ||||||
| # Add logs to the workspace (semantic labeling via OpenRouter) | ||||||
| go run ./cmd/lapp/ workspace add-log --topic app-incident /var/log/syslog | ||||||
|
|
||||||
| # Query logs by template | ||||||
| go run ./cmd/lapp/ query --template D1 --db lapp.duckdb | ||||||
|
|
||||||
| # AI-powered analysis (requires OPENROUTER_API_KEY) | ||||||
| go run ./cmd/lapp/ analyze app.log "why are there connection timeouts?" | ||||||
| # AI-powered analysis (agent backend via ACP provider) | ||||||
| go run ./cmd/lapp/ workspace analyze --topic app-incident "why are there connection timeouts?" --acp claude | ||||||
| go run ./cmd/lapp/ workspace analyze --topic app-incident "what failed?" --acp codex | ||||||
| ``` | ||||||
|
|
||||||
| ## How It Works | ||||||
|
|
@@ -40,27 +37,26 @@ Parser Chain (first match wins) | |||||
| DuckDB Store (log_entries: line_number, raw, template_id, template) | ||||||
| │ | ||||||
| ▼ | ||||||
| Query / Analyze | ||||||
| Workspace Notes / Analyze | ||||||
| ``` | ||||||
|
|
||||||
| **Core idea**: Drain clusters logs into templates cheaply (no API cost), then LLM semantifies the templates in a single call. This follows the IBM "Label Broadcasting" pattern — cluster first (90%+ volume reduction), apply LLM to representatives, broadcast labels back. | ||||||
|
|
||||||
| ## Environment Variables | ||||||
|
|
||||||
| - `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) | ||||||
| - `.env` file is auto-loaded | ||||||
|
|
||||||
| ## Commands | ||||||
|
|
||||||
| | Command | Description | | ||||||
| |---|---| | ||||||
| | `ingest <file>` | Parse log file, store in DuckDB | | ||||||
| | `templates` | Show discovered templates with counts | | ||||||
| | `query --template <id>` | Filter logs by template ID | | ||||||
| | `analyze <file> [question]` | AI-powered log analysis | | ||||||
| | `debug workspace <file>` | Build analysis workspace without LLM | | ||||||
| | `debug run <dir> [question]` | Run AI agent on existing workspace | | ||||||
| | `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`) | | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The description for the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The command table says Useful? React with 👍 / 👎. |
||||||
|
|
||||||
| ## Development | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package analyzer | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/cloudwego/eino/components/model" | ||
| "github.com/cloudwego/eino/schema" | ||
| einoacp "github.com/strrl/eino-acp" | ||
| ) | ||
|
|
||
| var _ model.ToolCallingChatModel = (*acpToolCallingModel)(nil) | ||
|
|
||
| // acpToolCallingModel adapts eino-acp ChatModel to ToolCallingChatModel. | ||
| // ACP agents manage tools in their own runtime, so WithTools is a no-op. | ||
| type acpToolCallingModel struct { | ||
| base *einoacp.ChatModel | ||
| } | ||
|
|
||
| func newACPToolCallingModel(base *einoacp.ChatModel) model.ToolCallingChatModel { | ||
| return &acpToolCallingModel{base: base} | ||
| } | ||
|
|
||
| func (m *acpToolCallingModel) Generate(ctx context.Context, input []*schema.Message, opts ...model.Option) (*schema.Message, error) { | ||
| return m.base.Generate(ctx, input, opts...) | ||
| } | ||
|
|
||
| func (m *acpToolCallingModel) Stream(ctx context.Context, input []*schema.Message, opts ...model.Option) (*schema.StreamReader[*schema.Message], error) { | ||
| return m.base.Stream(ctx, input, opts...) | ||
| } | ||
|
|
||
| func (m *acpToolCallingModel) WithTools(_ []*schema.ToolInfo) (model.ToolCallingChatModel, error) { | ||
| return m, nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line mentions
Geminias an example for provider-specific authentication. However, the pull request description states that Gemini support has been removed, and the implementation only supportsclaudeandcodex. To avoid confusion, please remove the reference to Gemini.