Conversation
ssdeanx
commented
Apr 16, 2026
- Refactored weather tool to utilize linked abort controllers for improved signal handling during execution.
- Added utility functions for creating and resolving abort signals to streamline abort handling in the weather tool.
- Introduced a new Agent Builder page for creating stored agents with live provider, model, and tool metadata.
- Implemented form state management for agent creation, including validation for required fields.
- Added runtime chat catalog to manage agent configurations and features dynamically based on live metadata.
- Created a tool status component to display the state of various tool parts with appropriate icons and labels.
- Added market update and global conflicts markdown files to provide real-time data and insights.
- Refactored weather tool to utilize linked abort controllers for improved signal handling during execution. - Added utility functions for creating and resolving abort signals to streamline abort handling in the weather tool. - Introduced a new Agent Builder page for creating stored agents with live provider, model, and tool metadata. - Implemented form state management for agent creation, including validation for required fields. - Added runtime chat catalog to manage agent configurations and features dynamically based on live metadata. - Created a tool status component to display the state of various tool parts with appropriate icons and labels. - Added market update and global conflicts markdown files to provide real-time data and insights.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Sorry @ssdeanx, your pull request is larger than the review limit of 150000 diff characters
|
🤖 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. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 56 minutes and 11 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (58)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Overview
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Reviewed by grok-code-fast-1:optimized:free · 213,821 tokens |
Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request implements a significant refactor of the chat system to use live runtime metadata for agents and models instead of static configurations, alongside a major visual overhaul of the chat UI components and theme. Key changes include the introduction of a runtime chat catalog, hardening of Mastra query hooks to align with the client SDK, and the addition of an agent builder page. Feedback includes improving validation logic in the agent builder to ensure a user ID is present before saving, fixing a syntax error in a Handlebars template within the LibSQL configuration, and correcting a logging statement in the document chunking tool to record the boolean state of the abort signal rather than the object itself.
| const canSave = | ||
| name.trim().length > 0 && | ||
| instructions.trim().length > 0 && | ||
| selectedProviderId.length > 0 && | ||
| selectedModelId.length > 0 && | ||
| (selectedProvider?.connected ?? false) |
There was a problem hiding this comment.
The canSave validation logic should include a check for userId to ensure that the agent creation request has a valid authorId before attempting to save. If userId is undefined (e.g., user not logged in), the mutation might fail or create an agent without an owner.
| const canSave = | |
| name.trim().length > 0 && | |
| instructions.trim().length > 0 && | |
| selectedProviderId.length > 0 && | |
| selectedModelId.length > 0 && | |
| (selectedProvider?.connected ?? false) | |
| const canSave = | |
| name.trim().length > 0 && | |
| instructions.trim().length > 0 && | |
| selectedProviderId.length > 0 && | |
| selectedModelId.length > 0 && | |
| (selectedProvider?.connected ?? false) && | |
| !!userId |
| # Additional Context | ||
| {{#each additionalContext}} | ||
| - {{this}} | ||
| - {{/each}} |
| toolCallId, | ||
| messageCount: messages.length, | ||
| aborted: abortSignal?.aborted ?? false, | ||
| aborted: resolveAbortSignal(abortSignal), |
There was a problem hiding this comment.
The aborted property is logging the AbortSignal object itself instead of its boolean state. It should use .aborted to be consistent with other logging statements in this file and to ensure the log output is serializable and useful.
| aborted: resolveAbortSignal(abortSignal), | |
| aborted: resolveAbortSignal(abortSignal).aborted, |
| @@ -0,0 +1,48 @@ | |||
| # Market Update - 2026-05-15 | |||
| @@ -0,0 +1,100 @@ | |||
| # Global Wars and Conflicts Update - 2026-05-15 | |||
There was a problem hiding this comment.
Csslint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Stylelint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Pull request overview
This PR improves cancellation handling across multiple Mastra tools, migrates the chat UI toward runtime-derived agent/model metadata (including a new agent builder page), and updates shared chat/workflow UI styling and memory/vector configuration.
Changes:
- Standardize tool abort-signal handling via shared helpers and propagate abort state into tool execution/logging.
- Add runtime chat catalog +
/chat/builderfor creating stored agents using live provider/model/tool metadata. - Update chat/workflow UI shells and global styling tokens; adjust LibSQL memory to use FastEmbed + warmup.
Reviewed changes
Copilot reviewed 57 out of 59 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mastra/tools/weather-tool.ts | Uses linked abort controller + normalized abort logging. |
| src/mastra/tools/url-tool.ts | Uses linked abort controller + normalized abort logging; adds parent abort support in helpers. |
| src/mastra/tools/serpapi-news-trends.tool.ts | Normalizes abort logging; adds extra hooks/logs for lite/news/trends tools. |
| src/mastra/tools/fetch.tool.ts | Threads abort signal into downstream search/fetch helpers; adds abort helper. |
| src/mastra/tools/document-chunking.tool.ts | Normalizes abort logging for chunking/reranking tools. |
| src/mastra/tools/binance-crypto-market.tool.ts | Normalizes abort logging in Binance spot market tool. |
| src/mastra/tools/alpha-vantage.tool.ts | Uses linked abort controller; forwards abort signal into httpFetch calls. |
| src/mastra/tools/abort-signal.utils.ts | Adds shared helpers for linked AbortController + resolving signals for logging. |
| src/mastra/public/workspace/war.md | Adds workspace markdown content for global conflicts update. |
| src/mastra/public/workspace/investing.md | Adds workspace markdown content for market update. |
| src/mastra/index.ts | Reorders/updates Mastra editor configuration and related comments. |
| src/mastra/config/mongodb.ts | Expands observationalMemory configuration shape. |
| src/mastra/config/libsql.ts | Switches LibSQL embedding to FastEmbed base + warmup; aligns index dimension/name; updates working-memory template. |
| src/mastra/config/lance.ts | Expands observationalMemory configuration shape for Lance memory. |
| src/mastra/config/AGENTS.md | Documents the LibSQL FastEmbed warmup + index dimension alignment change. |
| src/mastra/agents/researchAgent.ts | Enables TokenLimiter with a larger limit in processors. |
| src/components/ai-elements/tool.tsx | Refactors status badge logic into a shared component; updates tool UI styling. |
| src/components/ai-elements/tool-status.tsx | New shared tool status badge component. |
| src/components/ai-elements/task.tsx | Updates task UI styling for the chat surface. |
| src/components/ai-elements/sources.tsx | Updates sources UI styling and link card treatment. |
| src/components/ai-elements/sandbox.tsx | Switches status badge import to the new shared component. |
| src/components/ai-elements/reasoning.tsx | Updates reasoning UI styling; internalizes the hook. |
| src/components/ai-elements/plan.tsx | Updates plan UI styling (header/content/footer/trigger). |
| package.json | Bumps/introduces dependencies (Next, AI SDK, FastEmbed, adapters, etc.). |
| memory-bank/progress.md | Adds progress notes for FastEmbed bootstrap + chat shell redesign. |
| memory-bank/activeContext.md | Adds active context notes for FastEmbed warmup + shell redesign. |
| lib/mastra-client.ts | Introduces MASTRA_API_BASE_URL constant and uses it in client creation. |
| app/layout.tsx | Removes global mesh-gradient class from <body>. |
| app/globals.css | Updates theme tokens and adds chat-specific surface utilities/styles. |
| app/chat/workflows/page.tsx | Wraps workflows page in shared chat shell + provider composition. |
| app/chat/workflows/_components/workflow-header.tsx | Updates workflow header styling and navigation copy. |
| app/chat/workflows/_components/workflow-canvas.tsx | Updates workflow canvas surface styling and panel treatments. |
| app/chat/providers/chat-context.tsx | Moves to runtime agent ids + runtime-derived agent config; adds provider readiness metadata. |
| app/chat/providers/chat-context-types.ts | Aligns types with runtime chat catalog model/agent config. |
| app/chat/lib/runtime-chat-catalog.ts | New runtime-first catalog to infer agent categories/features + model display metadata. |
| app/chat/components/main-sidebar.tsx | Updates sidebar UI and adds builder navigation entry. |
| app/chat/components/code-layout.tsx | Adopts shared chat shell styling and SidebarProvider usage. |
| app/chat/components/chat-sidebar.tsx | Uses runtime category labels and displays runtime capability counts. |
| app/chat/components/chat-settings-shell.tsx | Updates settings shell styling and active-state treatments. |
| app/chat/components/chat-page-shell.tsx | Adds fullBleed support and refines shell layout/styling. |
| app/chat/components/chat-messages.tsx | Updates message styling; surfaces provider readiness + capability badges and warning state. |
| app/chat/components/chat-layout.tsx | Applies chat shell background utilities and refined panel styling. |
| app/chat/components/chat-input.tsx | Adds provider readiness UI, status badge, and refined composer styling. |
| app/chat/components/chat-header.tsx | Switches agent/model selection to runtime-derived data and updates header styling. |
| app/chat/components/agent-workflow.tsx | Refines workflow preview panel styling. |
| app/chat/components/agent-tools.tsx | Refines tool panel spacing and progress message styling. |
| app/chat/components/agent-sources.tsx | Switches favicon rendering to next/image and updates layout imports. |
| app/chat/components/agent-queue.tsx | Refines queue header styling and badges. |
| app/chat/components/agent-plan.tsx | Adds progress badge and refines plan styling. |
| app/chat/components/agent-launchpad.tsx | Refines launchpad cards styling and layout spacing. |
| app/chat/components/agent-confirmation.tsx | Refines confirmation UI styling for request/accepted/rejected states. |
| app/chat/components/agent-checkpoint.tsx | Refines checkpoint container/button styling. |
| app/chat/components/agent-chain-of-thought.tsx | Refines chain-of-thought header styling and badge shape. |
| app/chat/components/agent-artifact.tsx | Refines artifact compact card and editor FAB styling. |
| app/chat/builder/page.tsx | New agent builder page wired to live providers/tools + stored-agent creation mutation. |
| app/chat/AGENTS.md | Updates internal docs for runtime catalog cutover and UI shell consolidation. |
| .gitignore | Adds ignores for workspace artifacts and Playwright MCP outputs. |
| const canSave = | ||
| name.trim().length > 0 && | ||
| instructions.trim().length > 0 && | ||
| selectedProviderId.length > 0 && | ||
| selectedModelId.length > 0 && |
There was a problem hiding this comment.
canSave does not include authentication state, so the form can enable saving even when userId is undefined. Consider requiring a logged-in user (or otherwise handling unauthenticated creation) before allowing the save action.
| authorId: userId, | ||
| metadata: { | ||
| createdFrom: 'chat-builder', | ||
| }, | ||
| } |
There was a problem hiding this comment.
authorId is set from userId, but userId can be undefined. This can send an invalid payload to the stored-agent API. Gate saving on auth, or only include authorId when defined (depending on the backend contract).
| onInputStart: ({ toolCallId, messages, abortSignal }) => { | ||
|
|
||
|
|
||
| log.info('Fetch tool input streaming started', { |
There was a problem hiding this comment.
There are stray blank lines at the start of onInputStart which will typically fail lint/format rules and adds noise to diffs. Remove the empty lines so the handler starts directly with the log statement.
| # Additional Context | ||
| {{#each additionalContext}} | ||
| - {{this}} | ||
| - {{/each}} | ||
| `, |
There was a problem hiding this comment.
The working-memory template has an invalid Handlebars closing tag (- {{/each}}). This will either render incorrectly or fail template parsing at runtime. Replace it with a proper {{/each}} line (and keep the bullet list only for the {{this}} rows).
| arcade: new ArcadeToolProvider({ | ||
| apiKey: process.env.ARCADE_API_KEY!, | ||
| }), |
There was a problem hiding this comment.
ArcadeToolProvider is created with process.env.ARCADE_API_KEY!, which will throw on startup when the env var is not set. Prefer gating provider creation on env var presence (or omitting the provider) so local/dev boots don't fail when unconfigured.
| async function checkUrlReachability( | ||
| url: string, | ||
| timeout = 5000, | ||
| userAgent?: string | ||
| userAgent?: string, | ||
| parentAbortSignal?: AbortSignal |
There was a problem hiding this comment.
checkUrlReachability / getUrlMetadata accept a parentAbortSignal, but the call sites in this file do not pass a signal, so cancellations won't propagate to these requests. Either thread the tool-level abort signal through the callers or remove the unused parameter to avoid misleading cancellation support.
| log.info('MDocument chunker tool input streaming started', { | ||
| toolCallId, | ||
| messageCount: messages.length, | ||
| aborted: abortSignal?.aborted ?? false, | ||
| aborted: resolveAbortSignal(abortSignal), | ||
| hook: 'onInputStart', |
There was a problem hiding this comment.
aborted: resolveAbortSignal(abortSignal) logs an AbortSignal object instead of a boolean. This will serialize inconsistently and break log queries expecting a boolean. Use resolveAbortSignal(abortSignal).aborted here.
| chunkingStrategy: input.chunkingStrategy, | ||
| generateEmbeddings: input.generateEmbeddings, | ||
| messageCount: messages.length, | ||
| aborted: abortSignal?.aborted ?? false, | ||
| abort: resolveAbortSignal(abortSignal).aborted, | ||
| hook: 'onInputAvailable', |
There was a problem hiding this comment.
The log field name flips from aborted to abort in onInputAvailable, which makes log queries/dashboards inconsistent. Keep the same key name (e.g., aborted) across hooks.
| log.info('Binance spot market-data completed', { | ||
| toolCallId, | ||
| toolName, | ||
| count, | ||
| abortSignal: abortSignal?.aborted, | ||
| aborted: resolveAbortSignal(abortSignal).aborted, |
There was a problem hiding this comment.
onInput* logs use the abortSignal key, but onOutput uses aborted. If observability tooling relies on stable attribute names, this becomes a breaking change. Keep the same key name across the tool's log payloads.
| toolProviders: { | ||
| composio: new ComposioToolProvider({ | ||
| apiKey: process.env.COMPOSIO_API_KEY!, | ||
| }), |
There was a problem hiding this comment.
ComposioToolProvider is created with process.env.COMPOSIO_API_KEY!, which will throw on startup when the env var is not set. Prefer gating provider creation on env var presence (or omitting the provider) so local/dev boots don't fail when unconfigured.