-
Notifications
You must be signed in to change notification settings - Fork 5
Gemini agent core logic #57
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
Conversation
Greptile OverviewGreptile SummaryThis PR removes Claude and Codex agent implementations along with the agent factory pattern, consolidating on a single Key Changes:
Critical Issues:
The architectural simplification is sound, but the PR is incomplete - existing code still references deleted classes, making this a breaking change that will prevent the application from building or running. Confidence Score: 0/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client as Client/Frontend
participant Agent as GeminiAgent
participant ContentGen as VercelAIContentGenerator
participant Provider as AI Provider (Anthropic/OpenAI/Google/etc)
participant MCP as MCP Server (BrowserOS)
participant GeminiClient as GeminiClient (from gemini-cli-core)
Client->>Agent: create(config)
activate Agent
Agent->>Agent: Resolve config (BROWSEROS provider if needed)
Agent->>ContentGen: new VercelAIContentGenerator(config)
Agent->>GeminiClient: Initialize with ContentGenerator
Agent->>MCP: Connect to MCP server (if configured)
Agent-->>Client: GeminiAgent instance
deactivate Agent
Client->>Agent: execute(message, honoStream, signal)
activate Agent
Agent->>ContentGen: setHonoStream(honoStream)
loop Max 100 turns
Agent->>GeminiClient: sendMessageStream(parts, signal)
activate GeminiClient
GeminiClient->>ContentGen: generateContentStream(request)
activate ContentGen
ContentGen->>Provider: streamText(model, messages, tools)
loop Stream chunks
Provider-->>ContentGen: text/tool-call chunks
ContentGen->>ContentGen: Convert to Gemini format
ContentGen->>Client: Write to honoStream (AI SDK format)
end
ContentGen-->>GeminiClient: GenerateContentResponse
deactivate ContentGen
alt Has tool calls
GeminiClient-->>Agent: ToolCallRequest events
deactivate GeminiClient
loop Each tool call
Agent->>GeminiClient: executeToolCall(config, requestInfo)
activate GeminiClient
GeminiClient->>MCP: Execute tool
MCP-->>GeminiClient: Tool result
GeminiClient-->>Agent: Tool response parts
deactivate GeminiClient
end
Note over Agent: Continue loop with tool results
else No tool calls
Note over Agent: Break loop - execution complete
end
end
Agent-->>Client: Execution complete
deactivate Agent
|
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.
Additional Comments (2)
-
packages/agent/src/index.ts, line 13-16 (link)syntax: Exports reference deleted files - breaks module compilation
The
AgentFactory,registerAgents, andBaseAgentexports reference files that were deleted in this PR, causing build errors. -
packages/agent/src/session/SessionManager.ts, line 10-16 (link)syntax: SessionManager imports deleted classes but doesn't use new GeminiAgent
The imports reference
AgentFactoryandBaseAgentwhich were deleted. This file needs updates to work with the newGeminiAgentimplementation.
19 files reviewed, 2 comments
felarof99
left a comment
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.
Looks good, some minor fixes.
|
LGTM |
Removed unnecessary code of claude agent, formatters etc
Refactoring of vercel ai sdk with unncessary changes