Conversation
- Added `numResults` and `sortBy` parameters to `googleSearchTool`, `amazonSearchTool`, `walmartSearchTool`, `ebaySearchTool`, and `homeDepotSearchTool` to allow users to specify the number of results and sorting preferences. - Updated metadata logging to reflect the new `numResults` and `sortBy` parameters in the respective tools. - Refactored the `technical-analysis.tool.ts` to improve input handling by introducing default values for various parameters in the `ichimokuCloudTool`, `fibonacciTool`, `pivotPointsTool`, and other analysis tools. - Enhanced `text-analysis.tool.ts` to handle operations more flexibly by introducing a default operations array. - Introduced a new `urlValidationTool` and `urlManipulationTool` with comprehensive input and output schemas for validating and manipulating URLs, including detailed logging for input and output stages. - Created utility functions for URL manipulation, including adding, updating, and removing query parameters, with improved type safety using Zod schemas. - Added a new file `nestedAgents.ts` to provide a utility function for adapting nested agents to the expected type for parent registries, ensuring compatibility with stricter request-context generics.
There was a problem hiding this comment.
Sorry @ssdeanx, your pull request is larger than the review limit of 150000 diff characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🤖 Hi @ssdeanx, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
🤖 I'm sorry @ssdeanx, but I was unable to process your request. Please see the logs for more details. |
There was a problem hiding this comment.
Pull request overview
This is a large PR that combines several themes: hardening Mastra tool/eval type safety by removing any casts and adding default values for nullable inputs, introducing a nestedAgents type adapter for agent registration, extensive UI component cleanup (import reordering, closed: → data-[state=closed]: CSS fixes, context memoization, removing biome suppression comments), deleting many app/api/mastra/ proxy routes, and updating workspace scripts' import paths.
Changes:
- Introduced
asNestedAgents()adapter and applied it across all agent/network registrations to fix Mastra nested-agent typing issues; hardened toolexecutefunctions with explicit default values for nullable parameters. - Cleaned eval scorers to remove
anycasts, standardize judge model strings, and add proper type narrowing; removed(scorer as any).run()from tests. - Deleted ~15
app/api/mastra/proxy API routes and performed extensive UI component refactoring (import ordering, CSS data-attribute selectors, context value memoization, component reordering).
Reviewed changes
Copilot reviewed 173 out of 175 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/mastra/agents/nestedAgents.ts |
New boundary adapter for nested agent type compatibility |
src/mastra/networks/*.ts, src/mastra/agents/*.ts, src/mastra/a2a/*.ts |
Apply asNestedAgents() to all child agent registrations |
src/mastra/tools/*.ts (multiple) |
Add default values for nullable inputs, replace z.any() with z.unknown(), tighten hook typing |
src/mastra/evals/scorers/*.ts |
Remove any casts, add typed interfaces, standardize judge model strings |
src/mastra/evals/tests/*.ts |
Remove (scorer as any).run() pattern |
src/components/ai-elements/*.tsx (many) |
Import reordering, closed: → data-[state=closed]:, context memoization, component reordering |
src/mastra/tools/confirmation.tool.ts |
Changed suspend flow to always return { confirmed: false } after suspend |
src/mastra/harness.ts |
Added asHarnessAgent cast, removed initialState and defaultModelId |
src/mastra/mcp/index.ts |
Commented out knowledgeIndexingAgent |
app/api/mastra/** (many) |
Deleted proxy API routes for agents, tools, threads, traces, vectors, logs, memory, workflows |
src/mastra/public/workspace/**/*.tsx |
Updated import paths from @/components/ to @/src/components/ or @/ui/ |
memory-bank/*.md, **/AGENTS.md |
Documentation updates reflecting changes |
Comments suppressed due to low confidence (1)
app/api/mastra/agents/route.ts:1
- Many API routes under
app/api/mastra/have been deleted (agents, tools, threads, traces, vectors, logs, memory, workflows, observability). These were backend proxy routes usingMastraClient. If any frontend code or external consumers depend on these endpoints, they will break. Ensure that all references to these routes have been migrated to directMastraClientusage or another approach before merging.
You can also share your feedback on Copilot code review. Take the survey.
| | { | ||
| id: string; | ||
| approved: true; | ||
| reason?: string; | ||
| } |
| const [formatted, setFormatted] = useState(""); | ||
|
|
||
| // avoid calling Date.now() during render — compute relative time in an effect | ||
| const hasChildren = children !== undefined && children !== null; | ||
| const updateFormatted = useCallback(() => { | ||
| setFormatted(formatRelativeDate(date)); | ||
| }, [date]); | ||
|
|
||
| useEffect(() => { | ||
| if (hasChildren) {return;} | ||
|
|
||
| const update = () => { | ||
| const days = Math.round( | ||
| (date.getTime() - Date.now()) / (1000 * 60 * 60 * 24) | ||
| ); | ||
| setRelative(relativeTimeFormat.format(days, "day")); | ||
| }; | ||
|
|
||
| update(); | ||
|
|
||
| // refresh periodically so the relative label stays up-to-date | ||
| const id = window.setInterval(update, 60 * 60 * 1000); | ||
| return () => window.clearInterval(id); | ||
| }, [date, hasChildren]); | ||
|
|
||
| const display = children ?? (relative || date.toISOString()); | ||
| updateFormatted(); | ||
| }, [updateFormatted]); |
| {...props} | ||
| > | ||
| {children ?? suggestion} | ||
| {children || suggestion} |
| a2aCoordinator: a2aCoordinatorAgent, | ||
| codingCoordinator: codingA2ACoordinator, | ||
| knowledgeIndexing: knowledgeIndexingAgent, | ||
| // knowledgeIndexing: knowledgeIndexingAgent, |
| // Core Research Tools | ||
| fetchTool, | ||
| webScraperTool, | ||
| // webScraperTool, |
| storage: pgStore, | ||
| // State management | ||
| stateSchema: harnessStateSchema, |
| log.level === "log" && "text-foreground" | ||
| )} | ||
| key={`${log.timestamp.getTime()}-${index}`} | ||
| key={`${log.timestamp.getTime()}-${log.level}-${log.message}`} |
| : "text-foreground/90" | ||
| )} | ||
| key={`${frame.raw}-${index}`} | ||
| key={frame.raw} |
|
Important Review skippedToo many files! This PR contains 174 files, which is 24 over the limit of 150. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (174)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
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 significant enhancements to the system's capabilities for searching and manipulating URLs, alongside a comprehensive effort to bolster type safety, streamline input handling, and improve logging across a wide array of tools and agent configurations. It marks a strategic shift in API interaction patterns and expands the frontend's direct access to core Mastra client functionalities, ensuring a more robust and maintainable codebase. Highlights
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 major refactoring by removing numerous redundant API routes (e.g., for harness, agents, logs, memory, tools, traces, vectors, and workflows) as frontend functionalities now directly leverage the @mastra/client-js library. The lib/hooks/use-mastra-query.ts and lib/hooks/use-mastra.ts files have been significantly expanded to expose the full dataset, evaluation, and scorer API surface of @mastra/client-js to React Query and generic React consumers, respectively. Additionally, dependency versions in package.json have been updated, and various UI components have been refactored for improved type safety, consistency, and accessibility, including changes to CodeBlock for Shiki highlighting, CommitTimestamp for relative date formatting, JSXPreview for robust streaming error handling, PromptInput to support screenshot attachments, and several other components to refine prop handling and class names. A new nestedAgents.ts utility was added to src/mastra/agents to manage nested agent typing, and numerous Mastra tools and evaluation scorers have undergone a strict type cleanup, removing any types, adding explicit default values, and normalizing hook placements and output schemas for better reliability and maintainability.
numResultsandsortByparameters togoogleSearchTool,amazonSearchTool,walmartSearchTool,ebaySearchTool, andhomeDepotSearchToolto allow users to specify the number of results and sorting preferences.numResultsandsortByparameters in the respective tools.technical-analysis.tool.tsto improve input handling by introducing default values for various parameters in theichimokuCloudTool,fibonacciTool,pivotPointsTool, and other analysis tools.text-analysis.tool.tsto handle operations more flexibly by introducing a default operations array.urlValidationToolandurlManipulationToolwith comprehensive input and output schemas for validating and manipulating URLs, including detailed logging for input and output stages.nestedAgents.tsto provide a utility function for adapting nested agents to the expected type for parent registries, ensuring compatibility with stricter request-context generics.