Conversation
commit: |
Summary of ChangesHello, 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 introduces a significant architectural shift in the AI agent system, moving towards a more robust and modular design. The core change involves implementing an orchestrator agent that intelligently delegates tasks to specialized subagents, such as a Strategy Advisor and a Writer. This refactor aims to improve the clarity, maintainability, and scalability of AI-driven workflows. Concurrently, a new evaluation framework has been integrated, allowing for systematic assessment and scoring of AI-generated content and strategies against predefined fixtures. This enhancement provides a structured approach to measure and improve agent performance, ensuring higher quality and more consistent outputs. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring of the AI agent architecture, moving from a monolithic agent to a more structured, hierarchical system with an orchestrator and specialized sub-agents. Key changes include the removal of the SeoPlannerWorkflow and the introduction of a sophisticated, multi-phase writer agent pipeline. A comprehensive evaluation framework for content and strategy generation has also been added, which is a great step towards ensuring AI output quality. The tool definitions have been updated to use the ai SDK's jsonSchema helper, improving consistency. My review has identified a bug in a utility function and a potential UI improvement for data refetching after a destructive action. Overall, this is a high-quality refactoring that greatly improves the agent system's design and maintainability.
packages/api-seo/src/lib/ai/utils/format-business-background.ts
Outdated
Show resolved
Hide resolved
apps/seo/src/routes/_authed/$organizationSlug/-components/project-chat-panel.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Refactors the SEO product’s AI/chat and workflow architecture toward an orchestrator + subagent model, while removing the legacy “planner/plan-keyword” workflow path. Also tightens AI tool schema wiring around jsonSchema(...), adds new evaluation scaffolding, introduces soft-delete DB operations, and bumps shared dependency versions across the monorepo.
Changes:
- Replace legacy strategist/writer agent + planner workflow with a ToolLoopAgent orchestrator and a Strategy Advisor subagent, and update workflows/routes accordingly.
- Introduce JSON schema exports for project settings (for AI tool validation) and remove ArkType→JSON-schema transformer utilities.
- Add new DB soft-delete operations for SEO strategies/drafts and add eval framework files for content/strategy scoring.
Reviewed changes
Copilot reviewed 82 out of 83 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/task/package.json | Bumps @types/node and @t3-oss/env-core. |
| packages/google-apis/package.json | Bumps @types/node and @t3-oss/env-core. |
| packages/emails/package.json | Bumps @types/node. |
| packages/db/src/operations/seo/strategy-operations.ts | Adds softDeleteStrategy DB operation. |
| packages/db/src/operations/seo/content-operations.ts | Adds softDeleteDraft DB operation. |
| packages/db/package.json | Bumps @types/node and @t3-oss/env-core. |
| packages/dataforseo/src/index.ts | Extracts exported request arg types for DataForSEO helpers. |
| packages/dataforseo/package.json | Bumps @types/node and @t3-oss/env-core. |
| packages/core/src/schemas/task-parsers.ts | Removes seo-plan-keyword task schemas from unions. |
| packages/core/src/schemas/project-parsers.ts | Adds explicit JSON Schemas for settings; adjusts ArkType validators. |
| packages/core/src/schema/arktype-json-schema-transformer.ts | Deletes ArkType JSON schema transformer utility. |
| packages/content/package.json | Bumps @types/node. |
| packages/auth/package.json | Bumps @types/node and @t3-oss/env-core. |
| packages/api-user-vm/package.json | Bumps @types/node and @t3-oss/env-core. |
| packages/api-seo/src/workflows/strategy-suggestions-workflow.ts | Switches suggestion generation to Strategy Advisor agent + telemetry/auth helper. |
| packages/api-seo/src/workflows/onboarding-workflow.ts | Moves AI outputs to jsonSchema(...) and updates web tools factory usage. |
| packages/api-seo/src/workflows/index.ts | Removes planner workflow binding/export. |
| packages/api-seo/src/types.ts | Updates chat message typing to agent-based message inference; removes planner workflow typing. |
| packages/api-seo/src/routes/task.ts | Removes planner workflow instance lookup for seo-plan-keyword. |
| packages/api-seo/src/routes/chat.sendMessage.ts | Switches chat streaming to orchestrator agent; updates step logging. |
| packages/api-seo/src/lib/workspace/constants.ts | Adjusts default writing settings (custom instructions now empty). |
| packages/api-seo/src/lib/task.ts | Removes seo-plan-keyword workflow creation. |
| packages/api-seo/src/lib/dataforseo/utils.ts | Reuses exported DataForSEO request arg types to reduce duplication. |
| packages/api-seo/src/lib/content/write-content-draft.ts | Removes automatic seo-plan-keyword task creation on “suggested” status. |
| packages/api-seo/src/lib/ai/writer-agent.ts | Deletes legacy writer agent implementation. |
| packages/api-seo/src/lib/ai/utils/wrapped-language-model.ts | Adds wrapper for injecting tool input examples via middleware. |
| packages/api-seo/src/lib/ai/utils/store-optimized-or-original-image.ts | Makes Cloudflare binding resolution dynamic/optional. |
| packages/api-seo/src/lib/ai/utils/review.ts | Adds Gemini-based article review utility with structured output. |
| packages/api-seo/src/lib/ai/utils/project-context.ts | Adds shared project-context formatter utility. |
| packages/api-seo/src/lib/ai/utils/format-business-background.ts | Updates business background formatting for prompts. |
| packages/api-seo/src/lib/ai/utils/auth-init.ts | Adds workflow auth initialization helper. |
| packages/api-seo/src/lib/ai/utils/agent-telemetry.ts | Adds token/cost telemetry summarizers for agent invocations. |
| packages/api-seo/src/lib/ai/tools/web-tools.ts | Reworks tool schemas to jsonSchema(...) + input examples; renames factory. |
| packages/api-seo/src/lib/ai/tools/utils.ts | Deletes tool-definition/skills formatting helper. |
| packages/api-seo/src/lib/ai/tools/todo-tool.ts | Deletes legacy todo tool. |
| packages/api-seo/src/lib/ai/tools/strategy-tools.ts | Deletes legacy strategy tools wrapper. |
| packages/api-seo/src/lib/ai/tools/skill-tools.ts | Deletes legacy “skills” meta-tools. |
| packages/api-seo/src/lib/ai/tools/settings-tools.ts | Reworks schemas to jsonSchema(...) and adds wrapped OpenAI model usage. |
| packages/api-seo/src/lib/ai/tools/screenshot-script.ts | Deletes local screenshot script. |
| packages/api-seo/src/lib/ai/tools/planner-tools.ts | Deletes legacy planner tools. |
| packages/api-seo/src/lib/ai/tools/internal-links-tool.ts | Reworks internal-links tool to jsonSchema(...) and project-derived locale. |
| packages/api-seo/src/lib/ai/tools/image-tools.ts | Reworks image tools schemas; normalizes media types; input examples. |
| packages/api-seo/src/lib/ai/tools/google-search-console-tool.ts | Reworks GSC tool schema to jsonSchema(...) + input examples. |
| packages/api-seo/src/lib/ai/tools/file-tool.ts | Deletes legacy file workspace tool. |
| packages/api-seo/src/lib/ai/tools/dataforseo-tool.ts | Reworks DataForSEO tools to jsonSchema(...) + examples + defaults. |
| packages/api-seo/src/lib/ai/tools/data-analysis-agent-tool.ts | Deletes legacy data analysis subagent tool. |
| packages/api-seo/src/lib/ai/tools/create-article-tool.ts | Deletes legacy create-article tool. |
| packages/api-seo/src/lib/ai/tools/ask-question-tool.ts | Adds ask-questions tool using jsonSchema(...) + examples. |
| packages/api-seo/src/lib/ai/strategist-agent.ts | Deletes legacy strategist agent. |
| packages/api-seo/src/lib/ai/instructions/strategy-advisor.ts | Adds Strategy Advisor system prompt/instructions. |
| packages/api-seo/src/lib/ai/instructions/orchestrator.ts | Adds orchestrator system prompt/instructions. |
| packages/api-seo/src/lib/ai/arktype-json-schema.ts | Deletes ArkType→AI JSON schema adapter. |
| packages/api-seo/src/lib/ai/agents/strategy-advisor.ts | Adds ToolLoopAgent-based Strategy Advisor agent construction. |
| packages/api-seo/src/lib/ai/agents/orchestrator.ts | Adds ToolLoopAgent-based orchestrator with advise/write delegation tools. |
| packages/api-seo/src/eval/types.ts | Adds shared eval framework types. |
| packages/api-seo/src/eval/strategy/score.ts | Adds LLM-judge strategy scorer + pairwise comparison. |
| packages/api-seo/src/eval/strategy/fixtures/index.ts | Adds strategy eval fixtures. |
| packages/api-seo/src/eval/content/score.ts | Adds mixed deterministic + LLM-judge content scorer. |
| packages/api-seo/src/context.ts | Removes planner workflow from API context typing. |
| packages/api-seo/package.json | Bumps @types/node and @t3-oss/env-core. |
| packages/api-core/package.json | Bumps @types/node. |
| apps/www/package.json | Bumps @types/node and @t3-oss/env-core. |
| apps/seo/wrangler.jsonc | Removes planner workflow bindings across envs. |
| apps/seo/src/server.ts | Removes planner workflow export wiring. |
| apps/seo/src/routes/_authed/admin/route.tsx | Deletes old admin route file. |
| apps/seo/src/routeTree.gen.ts | Updates generated routes for admin index route location. |
| apps/seo/package.json | Bumps @types/node and @t3-oss/env-core. |
| apps/seo-www/package.json | Bumps @types/node and @t3-oss/env-core. |
| apps/seo-contact/package.json | Bumps @types/node and @t3-oss/env-core. |
| AGENTS.md | Updates repo guidance, including AI tool schema convention. |
| .cursor/rules/base-rules.mdc | Removes Cursor base rules doc. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
packages/api-seo/src/lib/ai/utils/format-business-background.ts
Outdated
Show resolved
Hide resolved
|
Cloudflare Preview URL for WWW 🎈 : https://pr-403.rectangularlabs.com (custom domain) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b81f7aad9
ℹ️ 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".
No description provided.