Skip to content

Comments

llmclient: add agentic client for code reviews#520

Open
academo wants to merge 7 commits intomainfrom
academo/replace-gemini-cli
Open

llmclient: add agentic client for code reviews#520
academo wants to merge 7 commits intomainfrom
academo/replace-gemini-cli

Conversation

@academo
Copy link
Collaborator

@academo academo commented Feb 17, 2026

this PR adds a basic agent client that can use openai/anthropic/google apis to answer questions about code.

The agent is barebones and it is not yet used anywhere. The idea is introduce the client here and then move code-diff to use it directly instead of the gemini-cli

AgenticClient

The agentic client runs a tool-calling loop where the LLM can explore code using read-only tools, then submits structured answers via submit_answer.

Tools: list_directory, read_file, grep, git (allowlisted subcommands), submit_answer

Providers: Google (Gemini), Anthropic (Claude), OpenAI

sequenceDiagram
    participant Caller
    participant AgenticClient
    participant LLM
    participant Tools

    Caller->>AgenticClient: CallLLM(prompt, repoPath, opts)
    AgenticClient->>LLM: system prompt + user prompt + tool definitions

    loop until submit_answer or 100 tool calls
        LLM-->>AgenticClient: tool call(s)
        alt submit_answer
            AgenticClient->>AgenticClient: collect answer
            AgenticClient-->>LLM: "Answer recorded"
        else read_file / list_directory / grep / git
            AgenticClient->>Tools: execute tool (sandboxed to repoPath)
            Tools-->>AgenticClient: result
            AgenticClient-->>LLM: tool result
        end
    end

    Note over LLM,AgenticClient: LLM sends message with no tool calls → done
    AgenticClient-->>Caller: []AnswerSchema
Loading

@@ -0,0 +1,49 @@
package storage
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

please keep an eye for "testdata" files. like this one. all this file content is fake an irrelevant.

@academo academo requested review from s4kh and xnyo February 17, 2026 16:35
@@ -0,0 +1,320 @@
package llmclient
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is a real file

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team Feb 17, 2026
@academo academo requested a review from s4kh February 18, 2026 09:43
Copy link
Member

@xnyo xnyo left a comment

Choose a reason for hiding this comment

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

Awesome work! I have some comments but I really like this idea, much much better than the Gemini CLI approach we currently have 🥇 🙌

@academo academo requested a review from xnyo February 19, 2026 13:38
Copy link
Member

@xnyo xnyo left a comment

Choose a reason for hiding this comment

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

LGTM, awesome work! 🙌 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔬 In review

Development

Successfully merging this pull request may close these issues.

3 participants