Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @GPSxtreme, 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!
I've updated the project to use the latest version of the @iqai/adk library, which is a significant dependency upgrade. This change also includes the integration of @openrouter/ai-sdk-provider, providing more flexibility in choosing and configuring LLM models. To accommodate these updates and improve overall code organization, I've refactored the agent structure, breaking down larger agent files into smaller, more focused sub-agents with dedicated tool management. This refactoring streamlines the main application logic, making it more modular and easier to maintain.
Highlights
- ADK Version Upgrade: The core dependency
@iqai/adkhas been upgraded to version0.1.20, bringing in the latest features and improvements from the ADK. - Flexible LLM Integration: The project now integrates
@openrouter/ai-sdk-provider, allowing for more flexible LLM model selection and potentially leveraging various AI providers through a unified interface. The default LLM model has also been updated togemini-2.5-flash. - Agent Structure Refactoring: The agent architecture has undergone a significant refactoring. Previously monolithic agent files (
notifier.ts,watcher.ts,atp-logger.ts) have been removed and their logic re-organized into asub-agentsdirectory structure, each with its ownagent.tsandtools.tsfiles. This enhances modularity and maintainability. - Simplified Agent Initialization and Execution: The main
sophiaAgentandrunnerlogic have been simplified. Toolset initialization and session management are now handled internally by the respective sub-agents or the ADK'sInMemorySessionService, leading to cleaner entry points and reduced boilerplate.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 or fill out our survey to provide feedback.
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
-
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. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring to update the @iqai/adk to version 0.1.20. The changes improve the project's structure by making it more modular and align the implementation with the latest ADK features, such as LlmAgent and the new toolset initializers. The agent instructions are also clearer and more robust. However, I've identified a high-severity issue concerning a mismatch between the data fetching timeframe and the agent's scheduled execution interval, which could lead to major inefficiencies and potential data duplication.
| SOPHIA'S IQ.WIKI PROFILE ADDRESS: ${env.SOPHIA_ADDRESS} | ||
|
|
||
| Your only work is to do the below: | ||
| - call the GET_USER_WIKI_ACTIVITIES tool with timeframe as 14 hours (pass it as seconds) |
There was a problem hiding this comment.
The instruction specifies a timeframe of 14 hours for fetching wiki activities. However, the agent is scheduled to run every 10 minutes by default (as per CRON_SCHEDULE in src/env.ts). This large timeframe will cause the agent to re-process the same activities on each run, leading to significant inefficiency and potentially duplicate logs and notifications if there's no downstream deduplication. The timeframe should be aligned with the execution interval. A slightly larger interval than the cron schedule, like 15 minutes, would be more appropriate to prevent missing activities while avoiding large overlaps.
| - call the GET_USER_WIKI_ACTIVITIES tool with timeframe as 14 hours (pass it as seconds) | |
| - call the GET_USER_WIKI_ACTIVITIES tool with timeframe as 15 minutes (pass it as seconds) |
src/agents/sophia/agent.ts
Outdated
| "watcher", | ||
| ) | ||
| .withQuickSession("sophia", "uid_1234") | ||
| .withSessionService(sessionService) |
There was a problem hiding this comment.
no need to pass sessionService if its just inMemorySession, agent builder by default passes it
There was a problem hiding this comment.
Forgot to remove it 😞
| import { env, model } from "../../../../env"; | ||
| import { getTelegramTools } from "../../../telegram-agent/tools"; |
There was a problem hiding this comment.
can use @/env and @/agents/telegram-agent/tools
| import { env, model } from "../../../../env"; | ||
| import { getIqWikiTools } from "./tools"; | ||
|
|
||
| export async function watcherAgent(): Promise<LlmAgent> { |
There was a problem hiding this comment.
I think this can be better named, its not watching per say, just checking iq wiki
There was a problem hiding this comment.
lets name this something else, runner collides with our runner concept in adk
…ame. Initialize telegram agent with iqWiki tools and enhance agent description. Adjust wikis-checker to use a 10-minute timeframe for activities.
…package.json and pnpm-lock.yaml
Closes #3 when this PR merged
Changes