Skip to content

Conversation

@ssdeanx
Copy link
Owner

@ssdeanx ssdeanx commented Jan 15, 2026

  • Changed several type definitions from type to interface for better extensibility in components such as PieSlice, ConfirmationContextValue, and QueueMessagePart.
  • Updated function parameters and return types to use more consistent array syntax (e.g., Array<Type> instead of Type[]) in components like DataTableProps and AttachmentsContext.
  • Refactored various components to use void for fire-and-forget function calls, ensuring no promises are returned where void is expected, particularly in ChatProvider and WorkflowActions.
  • Removed unnecessary ESLint disable comments to clean up the code and improve readability.
  • Adjusted default parameter values to use shorthand syntax in hooks like useDebounce and useToggle.
  • Improved conditional return statements for clarity and consistency across multiple components.
  • Removed a test template file that was no longer needed.
  • Updated ESLint configuration to enhance type checking and ensure better adherence to coding standards.

Summary by Sourcery

Refine TypeScript types and React component contracts for stronger type safety while tightening ESLint configuration for stricter, type-aware linting across the codebase.

Enhancements:

  • Convert multiple React and domain model type aliases to interfaces and normalize array typing for shared contexts, UI components, and tooling utilities.
  • Clean up conditional returns, default parameter values, and callback signatures in hooks and components for clearer, more consistent control flow and APIs.
  • Adjust logging and tracing payloads in the weather tool and improve typing around agent/tool rendering and network/chat contexts.

Build:

  • Rework ESLint flat config to layer in TypeScript recommended and type-checked presets, extend browser globals with Node globals, and delegate unused-variable checks to @typescript-eslint rules.

Tests:

  • Tighten test typings and expectations in tool tests, including more explicit collection types and safer assertions.

Chores:

  • Remove obsolete ESLint disable comments, prefer type-only imports where appropriate, and delete an unused test template file.

- Changed several type definitions from `type` to `interface` for better extensibility in components such as `PieSlice`, `ConfirmationContextValue`, and `QueueMessagePart`.
- Updated function parameters and return types to use more consistent array syntax (e.g., `Array<Type>` instead of `Type[]`) in components like `DataTableProps` and `AttachmentsContext`.
- Refactored various components to use `void` for fire-and-forget function calls, ensuring no promises are returned where void is expected, particularly in `ChatProvider` and `WorkflowActions`.
- Removed unnecessary ESLint disable comments to clean up the code and improve readability.
- Adjusted default parameter values to use shorthand syntax in hooks like `useDebounce` and `useToggle`.
- Improved conditional return statements for clarity and consistency across multiple components.
- Removed a test template file that was no longer needed.
- Updated ESLint configuration to enhance type checking and ensure better adherence to coding standards.
Copilot AI review requested due to automatic review settings January 15, 2026 13:46
@continue
Copy link

continue bot commented Jan 15, 2026

All Green - Keep your PRs mergeable

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts


Unsubscribe from All Green comments

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 15, 2026

Reviewer's Guide

Refactors TypeScript types and React components for improved type-safety and consistency, and tightens ESLint configuration to leverage TypeScript’s recommended and type-checked rules while cleaning up obsolete comments and templates.

Updated class diagram for chat and prompt context types

classDiagram
    direction LR

    class AttachmentsContext {
        <<interface>>
        Array~FileUIPart_and_id~ files
        add(files: Array~File~ | FileList) void
        remove(id: string) void
        clear() void
        fileInputRef: RefObject~HTMLInputElement_or_null~
    }

    class TextInputContext {
        <<interface>>
        value: string
        setInput(v: string) void
        clear() void
    }

    class PromptInputControllerProps {
        <<interface>>
        textInput: TextInputContext
        attachments: AttachmentsContext
        __registerFileInput(inputRef: RefObject~HTMLInputElement_or_null~, open: function) void
    }

    class PromptInputMessage {
        <<interface>>
        text: string
        files: Array~FileUIPart~
    }

    class QueuedTask {
        <<interface>>
        id: string
        title: string
        description: string
        status: string
        createdAt: Date
        completedAt: Date
        error: string
    }

    class WebPreviewData {
        <<interface>>
        id: string
        url: string
        title: string
        code: string
        language: string
        html: string
        editable: boolean
        showConsole: boolean
        height: number
    }

    class ChatContextValue {
        <<interface>>
        %% state
        isLoading: boolean
        isStreaming: boolean
        chatError: Error
        %% actions
        sendMessage(text: string, files: Array~File~) void
        stopGeneration() void
        clearMessages() void
        selectAgent(agentId: string) void
        selectModel(modelId: string) void
        dismissError() void
        setFocusMode(enabled: boolean) void
        addTask(task: Omit~QueuedTask,id~) string
        updateTask(taskId: string, updates: Partial~QueuedTask~) void
        removeTask(taskId: string) void
        approveConfirmation(confirmationId: string) void
        rejectConfirmation(confirmationId: string, reason: string) void
        createCheckpoint(messageIndex: number, label: string) string
        restoreCheckpoint(checkpointId: string) void
        removeCheckpoint(checkpointId: string) void
        setWebPreview(preview: WebPreviewData) void
        setThreadId(threadId: string) void
        setResourceId(resourceId: string) void
    }

    class AgentArtifactProps {
        <<interface>>
        artifact: ArtifactData
        onClose() void
        onCodeUpdate(artifactId: string, newCode: string) void
    }

    class AgentWebPreviewProps {
        <<interface>>
        preview: WebPreviewData
        onClose() void
        onCodeChange(code: string) void
        defaultTab: string
        height: string|number
    }

    class AgentCodeSandboxProps {
        <<interface>>
        code: string
        title: string
        dependencies: Record~string,string~
        onClose() void
        onCodeChange(code: string) void
        editable: boolean
    }

    class AgentConfirmationProps {
        <<interface>>
        tool: ToolUIPart
        state: string
        severity: ConfirmationSeverity
        className: string
        onApprove(approvalId: string) void
        onReject(approvalId: string) void
    }

    class AgentToolsProps {
        <<interface>>
        tools: Array~ChatToolInvocationState_or_DynamicToolUIPart~
        className: string
    }

    class DataTableProps_T_ {
        <<interface>>
        columns: Array~Column_T_~
        data: Array~T~
        searchPlaceholder: string
        searchKey: keyof_T_
    }

    ChatContextValue --> QueuedTask : uses
    ChatContextValue --> WebPreviewData : manages

    PromptInputControllerProps --> TextInputContext : aggregates
    PromptInputControllerProps --> AttachmentsContext : aggregates

    AgentArtifactProps --> WebPreviewData : related via UI
    AgentWebPreviewProps --> WebPreviewData : renders

    DataTableProps_T_ --> Column_T_ : contains
Loading

Updated class diagram for queue, confirmation, and shared UI contexts

classDiagram
    direction LR

    class QueueMessagePart {
        <<interface>>
        type: string
        text: string
        url: string
        fileName: string
        mediaType: string
    }

    class QueueMessage {
        <<interface>>
        id: string
        parts: Array~QueueMessagePart~
    }

    class QueueTodo {
        <<interface>>
        id: string
        title: string
        description: string
    }

    class ToolUIPartApproval {
        <<type>>
        id: string
        approved: boolean
        reason: string
    }

    class ConfirmationContextValue {
        <<interface>>
        approval: ToolUIPartApproval
        state: ToolUIPart_state_
    }

    class ConfirmationRequestProps {
        <<interface>>
        children: ReactNode
    }

    class ConfirmationAcceptedProps {
        <<interface>>
        children: ReactNode
    }

    class ConfirmationRejectedProps {
        <<interface>>
        children: ReactNode
    }

    class PieSlice {
        <<interface>>
        name: string
        value: number
        fill: string
    }

    class NavItem {
        <<interface>>
        title: string
        href: Route
        icon: ReactComponent
    }

    class AccordionContextValue {
        <<interface>>
        openItems: Array~string~
        toggle(value: string) void
        type: string
    }

    class RadioGroupContextValue {
        <<interface>>
        value: string
        onChange(value: string) void
        name: string
    }

    class SwitchProps {
        <<interface>>
        onCheckedChange(checked: boolean) void
    }

    class TabsProps {
        <<interface>>
        defaultValue: string
        value: string
        onValueChange(value: string) void
    }

    class ChainOfThoughtContextValue {
        <<interface>>
        isOpen: boolean
        setIsOpen(open: boolean) void
    }

    class CodeBlockContextType {
        <<interface>>
        code: string
    }

    class ContextSchema {
        <<interface>>
        usedTokens: number
        maxTokens: number
        usage: LanguageModelUsage
    }

    class LoaderIconProps {
        <<interface>>
        size: number
    }

    class MessageBranchContextType {
        <<interface>>
        currentBranch: number
        totalBranches: number
        goToPrevious() void
        goToNext() void
    }

    class PlanContextValue {
        <<interface>>
        isStreaming: boolean
    }

    class ReasoningContextValue {
        <<interface>>
        isStreaming: boolean
        isOpen: boolean
        setIsOpen(open: boolean) void
    }

    class TextShimmerProps {
        <<interface>>
        children: string
        as: ElementType
        className: string
    }

    class ToolHeaderProps {
        <<interface>>
        title: string
        type: ToolUIPart_type_
        state: ToolUIPart_state_
    }

    class WebPreviewContextValue {
        <<interface>>
        url: string
        setUrl(url: string) void
        consoleOpen: boolean
        setConsoleOpen(open: boolean) void
    }

    QueueMessage --> QueueMessagePart : contains

    ConfirmationContextValue --> ToolUIPartApproval : holds

    AccordionContextValue --> SwitchProps : related via UI usage
    RadioGroupContextValue --> TabsProps : coordinated inputs

    ChainOfThoughtContextValue --> ReasoningContextValue : related concerns
    PlanContextValue --> ReasoningContextValue : streaming state
Loading

File-Level Changes

Change Details Files
Strengthened ESLint configuration to use TypeScript’s flat recommended and type-checked presets and aligned core lint rules with TypeScript-aware equivalents.
  • Reorganized imports in eslint.config.js to include the new typescript-eslint package and globals merge.
  • Derived a tsTypeCheckedRecommended config from typescript-eslint flat/recommended-type-checked and applied it with appropriate file globs.
  • Spread both TypeScript flat recommended and type-checked configs into the exported config array before custom rules.
  • Extended languageOptions.globals to include both browser and node globals.
  • Replaced core no-unused-vars with @typescript-eslint/no-unused-vars and wired other rule overrides (no-undef, no-redeclare) to TypeScript-specific rules while keeping existing style/consistency rules.
eslint.config.js
Standardized TypeScript type declarations from type aliases to interfaces and normalized array syntax for better consistency and extensibility across UI components and hooks.
  • Converted several object-shaped type aliases (e.g., AttachmentsContext, TextInputContext, PromptInputControllerProps, QueueMessagePart, WebPreviewContextValue, context value types) to interfaces.
  • Replaced T[] style arrays with Array in props and state (e.g., AgentToolsProps.tools, AttachmentsContext.files, DataTableProps.columns, test helper arrays).
  • Typed imports updated to use import type where appropriate (e.g., LucideIcon, NextRequest, LLMStepResult) to improve tree-shaking and type-only usage.
  • Adjusted various context and props interfaces to remove redundant eslint-disable comments around function parameters now that no-unused-vars is satisfied by TypeScript-aware rules.
app/chat/components/chat.types.ts
src/components/ai-elements/prompt-input.tsx
src/components/ai-elements/confirmation.tsx
src/components/ai-elements/queue.tsx
src/components/ai-elements/chain-of-thought.tsx
src/components/ai-elements/code-block.tsx
src/components/ai-elements/context.tsx
src/components/ai-elements/loader.tsx
src/components/ai-elements/message.tsx
src/components/ai-elements/plan.tsx
src/components/ai-elements/reasoning.tsx
src/components/ai-elements/shimmer.tsx
src/components/ai-elements/tool.tsx
src/components/ai-elements/web-preview.tsx
app/dashboard/_components/data-table.tsx
src/mastra/tools/tests/json-to-csv.tool.test.ts
app/components/charts/PieWidget.tsx
app/admin/_components/admin-sidebar.tsx
app/dashboard/_components/empty-state.tsx
app/dashboard/_components/stat-card.tsx
app/api/contact/route.ts
Refined React component logic and event handlers to use void fire-and-forget semantics, clearer conditionals, and stricter types, especially around async clipboard and context operations.
  • Updated async handlers like copy-to-clipboard in chat-messages and agent-artifact to either wrap async work in an inner async function and call it with void, or to use promise chaining instead of returning a Promise from callbacks typed as void.
  • Ensured ChatProvider sendMessage, stopGeneration, and other callbacks like AgentWebPreview copy handlers call async functions with void to avoid promise-return type mismatches.
  • Tightened conditional early-returns with explicit braces in hooks and components (e.g., DataTable, useInterval, useTimeout, PromptInput drag/drop handlers, weather tool tests) for clarity and to satisfy stricter linting.
  • Simplified default parameter values in hooks like useDebounce and useToggle using shorthand syntax and kept effect guards explicit for null delays.
app/chat/components/chat-messages.tsx
app/chat/components/agent-artifact.tsx
app/chat/components/agent-web-preview.tsx
app/chat/providers/chat-context.tsx
hooks/use-utils.ts
hooks/use-debounce.ts
app/dashboard/_components/data-table.tsx
src/mastra/tools/tests/alpha-vantage.tool.test.ts
src/mastra/tools/tests/csv-to-json.tool.test.ts
Cleaned up ESLint suppression comments, improved type precision in contexts and tools, and adjusted logging to avoid misleading values.
  • Removed many // eslint-disable-next-line no-unused-vars and similar comments where TypeScript-aware rules now handle unused parameters safely (e.g., ChatContextValue, NetworkContextValue, UI contexts, Switch/Tabs/Accordion/Radio props).
  • Updated weather-tool logging to log the raw toolCallId instead of calling includes('get-weather') and explicitly passed tracingContext when constructing the tracer.
  • Improved runtime typings and casts for AgentTool rendering in chat-messages, using MastraDataPart and LLMStepResult while ensuring cast is used only at the boundary.
  • Minor formatting/whitespace fixes and comment adjustments across Convex generated files and tests without altering behavior.
app/chat/providers/chat-context-types.ts
app/networks/providers/network-context.tsx
src/mastra/lib/http-client.ts
ui/accordion.tsx
ui/radio-group.tsx
ui/switch.tsx
ui/tabs.tsx
app/chat/components/agent-confirmation.tsx
app/chat/components/agent-web-preview.tsx
app/chat/components/chat-messages.tsx
src/mastra/tools/weather-tool.ts
convex/_generated/api.d.ts
convex/_generated/api.js
convex/_generated/server.js
app/workflows/providers/workflow-context.tsx
src/mastra/tools/tests/url-tool.test.ts
app/workflows/components/workflow-actions.tsx
Removed unused test template and aligned generated or template-based files with current linting expectations.
  • Deleted an obsolete test template simple-utility.template.ts that is no longer needed.
  • Normalized ESLint headers in Convex generated files from blanket eslint-disable to minimal/no suppression, relying on the project’s updated ESLint config instead.
test-templates/simple-utility.template.ts
convex/_generated/api.d.ts
convex/_generated/api.js
convex/_generated/server.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Summary by CodeRabbit

  • New Features

    • Chat messages render richer nested data sections and a stable tool-calling display.
    • Weather output now includes a unit field.
  • Bug Fixes

    • Improved error handling for message sending and clipboard operations.
    • Form submission now resets input and handles errors gracefully.
  • Refactor

    • Modernized internal type declarations and import organization.
  • Chores

    • Removed unused lint directives and imports; consistent formatting applied.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Converted many type aliases to interfaces, split/imported type-only vs runtime imports, removed inline ESLint suppression comments, adjusted some async/fire-and-forget call sites, updated some public type shapes (added fields), and overhauled eslint.config.js.

Changes

Cohort / File(s) Summary
Type alias → interface conversions & small API additions
app/admin/_components/admin-sidebar.tsx, app/components/charts/PieWidget.tsx, src/components/ai-elements/*
Replaced numerous exported type aliases with interface declarations; some interfaces add fields (e.g., description on NavItem, modelId, duration, setConsoleOpen, optional className). No runtime logic changes.
Chat components & message rendering
app/chat/components/*, app/chat/providers/*, app/chat/components/chat-messages.tsx, app/chat/components/chat.types.ts
Adjusted handler shapes (method → function props), reworked copy handlers/event wrappers, added type guards and new nested data-part rendering paths in chat-messages, and made several send/stop calls fire-and-forget. Significant UI rendering logic added in chat-messages.
Networks features & UI
app/networks/*, app/networks/components/network-chat.tsx, app/networks/components/*
Enhanced Mastra payload normalization, refined state mapping, improved error handling on aiSendMessage, added clipboard try/catch, and some Tailwind class adjustments. Several files change data extraction and rendering.
Workflows & react-flow call safety
app/workflows/*
Wrapped reactFlow fitView in an async safe wrapper and converted some send/stop calls to fire-and-forget with .catch handling.
ESLint config overhaul
eslint.config.js
Major refactor: restructured imports, added typescript-eslint spreads, created tsTypeCheckedRecommended composition, consolidated rules, and expanded languageOptions.globals. Exports now composed via spreads.
Import restructuring & cleanup
app/api/contact/route.ts, app/components/*, src/mastra/*, src/mastra/tools/*
Split some combined imports into type-only vs runtime imports; removed several unused imports (e.g., google), and adjusted a few test typings.
Storage/tracing simplification
src/mastra/config/pg-storage.ts
Removed maskSensitiveMessageData, removed tracingContext parameter and span creation from generateEmbeddings, simplified message formatting logic.
Hooks / utilities small tweaks
hooks/*
Removed explicit parameter type annotations for defaults and minor formatting/early-return brace additions.
Formatting / lint cleanup / tests / templates
ui/*, src/mastra/tools/tests/*, test-templates/simple-utility.template.ts
Removed inline ESLint suppression comments, minor brace/formatting fixes in tests, and deleted one test template.

Sequence Diagram(s)

(Skipped — changes are primarily type declarations, lint/config refactors, and localized component updates rather than a new multi-component control flow.)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PR #67: Edits the same AdminSidebar NavItem shape (adds description / type changes).
  • PR #55: Related ESLint configuration edits and dependency alignment overlapping with eslint.config.js changes.
  • PR #41: Also modifies ESLint configuration exports and ignores; likely overlaps with the ESLint overhaul.

Suggested reviewers

  • sourcery-ai

"🐰
I hopped through type fields, changed alias to face,
split imports with care, put lint rules in place.
No logic disturbed, just typings refined—
A tidy-code burrow, neat changes aligned."

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the pull request—a comprehensive refactor for improved type safety and consistency.
Description check ✅ Passed The description clearly aligns with the changeset, detailing specific refactoring categories including type conversions, array syntax normalization, void handling, ESLint cleanup, and configuration updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop


📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 84087b3 and 761a2d8.

📒 Files selected for processing (10)
  • app/chat/components/agent-confirmation.tsx
  • app/chat/components/chat-messages.tsx
  • app/chat/components/nested-agent-chat.tsx
  • app/networks/components/network-chat.tsx
  • app/networks/components/network-info-panel.tsx
  • app/networks/components/network-routing-panel.tsx
  • app/networks/providers/network-context.tsx
  • app/workflows/components/workflow-actions.tsx
  • app/workflows/providers/workflow-context.tsx
  • src/mastra/config/pg-storage.ts

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🤖 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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ssdeanx, 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 focuses on a comprehensive refactoring effort to enhance the codebase's type safety, consistency, and adherence to modern TypeScript and ESLint best practices. The changes primarily involve standardizing type definitions, refining asynchronous function handling, and cleaning up ESLint directives, all aimed at improving code maintainability and developer experience without altering core functionality.

Highlights

  • Type Definition Refactoring: Converted several type aliases to interface declarations for improved extensibility and consistency across components like PieSlice, ConfirmationContextValue, and QueueMessagePart.
  • Type Syntax Consistency: Standardized array type syntax from Type[] to Array<Type> in various components, including DataTableProps and AttachmentsContext, for better readability and consistency.
  • ESLint Rule Enforcement & Cleanup: Removed numerous unnecessary // eslint-disable-next-line comments, particularly no-unused-vars, to clean up the codebase and allow ESLint to enforce stricter coding standards. The ESLint configuration itself was also updated to enhance type checking.
  • Asynchronous Operation Handling: Ensured 'fire-and-forget' asynchronous function calls explicitly use void (e.g., void aiSendMessage()) to prevent unintended promise returns where void is expected, notably in ChatProvider and AgentWebPreview.
  • Conditional Return Statements: Improved clarity and consistency of conditional return statements by wrapping single-line if body statements in curly braces across multiple components and hooks.
  • Default Parameter Shorthand: Adjusted default parameter values in hooks like useDebounce and useToggle to use shorthand syntax.
  • File Removal: Removed an outdated test template file (test-templates/simple-utility.template.ts) that was no longer needed.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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. 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

  1. 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.

@github-actions
Copy link

🤖 I'm sorry @ssdeanx, but I was unable to process your request. Please see the logs for more details.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In chat-messages.tsx when rendering AgentTool, you're now hardcoding type={partType as unknown as 'data-tool-agent'} and casting nestedPart to MastraDataPart; this drops the actual runtime partType (e.g. data-tool-workflow, data-tool-network) and may cause incorrect behavior or styling — consider passing through the real partType and using a narrower union or a type guard instead of forcing it to 'data-tool-agent'.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `chat-messages.tsx` when rendering `AgentTool`, you're now hardcoding `type={partType as unknown as 'data-tool-agent'}` and casting `nestedPart` to `MastraDataPart`; this drops the actual runtime `partType` (e.g. `data-tool-workflow`, `data-tool-network`) and may cause incorrect behavior or styling — consider passing through the real `partType` and using a narrower union or a type guard instead of forcing it to `'data-tool-agent'`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves type safety and consistency throughout the codebase. The migration from type to interface, removal of unnecessary ESLint disable comments, and consistent use of void for fire-and-forget async calls are all valuable changes. The updated ESLint configuration is a great step towards enforcing higher code quality. I've identified a few areas for improvement, primarily a conflict between the new array type syntax (Array<T>) and the updated ESLint rule that enforces T[]. Addressing these points will ensure the codebase is fully consistent with its new linting standards.


interface DataTableProps<T> {
columns: Column<T>[]
columns: Array<Column<T>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While the PR description mentions a move to Array<Type>, the updated ESLint configuration in this same PR enforces the T[] syntax via the @typescript-eslint/array-type rule with { default: 'array-simple' }. This change introduces a linting error. To resolve this conflict and adhere to the new configuration, please use the T[] syntax.

Suggested change
columns: Array<Column<T>>
columns: Column<T>[]

export type AttachmentsContext = {
files: (FileUIPart & { id: string })[]
export interface AttachmentsContext {
files: Array<FileUIPart & { id: string }>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change to Array<Type> syntax conflicts with the updated ESLint rule @typescript-eslint/array-type which is configured to enforce T[] (array-simple). This will cause a linting error. Please use the T[] syntax to align with the project's linting rules. This feedback applies to all similar array type changes in this file.

    files: (FileUIPart & { id: string })[]


it('handles empty array', async () => {
const data: Record<string, any>[] = []
const data: Array<Record<string, any>> = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The use of Array<Record<string, any>> is inconsistent with the new ESLint rule @typescript-eslint/array-type which is set to enforce T[] (array-simple). This will cause a linting error. Please use the T[] syntax for consistency.

Suggested change
const data: Array<Record<string, any>> = []
const data: Record<string, any>[] = []

Comment on lines +128 to +129
// eslint-disable-next-line object-shorthand
tracingContext: tracingContext,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The eslint-disable-next-line object-shorthand comment was added to allow writing tracingContext: tracingContext. However, the object-shorthand rule is enabled in the ESLint config to enforce using shorthand for properties where the key and variable name are the same. Disabling this rule here goes against the project's coding style. Please use the shorthand syntax.

Suggested change
// eslint-disable-next-line object-shorthand
tracingContext: tracingContext,
tracingContext,

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the codebase to improve type safety and consistency by enforcing TypeScript and ESLint best practices. The changes align the code with the project's ESLint configuration, particularly the consistent-type-definitions, consistent-type-imports, array-type, curly, and object-shorthand rules.

Changes:

  • Converted multiple type aliases to interface declarations for better extensibility and consistency
  • Updated imports to use type keyword prefix for type-only imports
  • Standardized array type syntax using Array<T> for complex types
  • Added braces to single-statement conditionals following the curly: 'all' rule
  • Removed unnecessary ESLint disable comments throughout the codebase
  • Enhanced type safety by using proper type assertions and void operator for fire-and-forget promises
  • Removed unused imports and a test template file

Reviewed changes

Copilot reviewed 50 out of 53 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
eslint.config.js Enhanced TypeScript type checking with recommended-type-checked config and added node globals
ui/*.tsx Removed ESLint disable comments for callback parameters
hooks/*.ts Changed default parameter syntax and added braces to early returns
src/components/ai-elements/*.tsx Converted type aliases to interfaces, updated array syntax, and improved type imports
app/chat/providers/*.tsx Added void operator for fire-and-forget promises, removed ESLint disables
app/chat/components/*.tsx Improved type assertions and converted async callback pattern
app/dashboard/_components/*.tsx Updated to type-only imports and changed array syntax
src/mastra/tools/*.ts Fixed type imports and corrected shorthand syntax
src/mastra/config/*.ts Removed unused google import
convex/_generated/*.js Removed unnecessary ESLint disable comments
test-templates/ Removed unused test template file
Comments suppressed due to low confidence (1)

app/chat/components/chat-messages.tsx:203

  • This change from async/await to promise chain reduces code readability compared to the original async/await pattern. While it avoids the async function callback issue, it makes error handling less clear. The original pattern with async/await was more modern and easier to understand.
    const handleCopy = useCallback(() => {
        navigator.clipboard
            .writeText(text)
            .then(() => {
                setCopied(true)
                setTimeout(() => setCopied(false), 2000)
            })
            .catch((err) => {
                console.error('Failed to copy:', err)
            })
    }, [text])

Comment on lines +128 to +129
// eslint-disable-next-line object-shorthand
tracingContext: tracingContext,
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ESLint disable comment contradicts the purpose of this refactoring PR. The object-shorthand rule is set to 'error' in the ESLint config (line 85), which should enforce using tracingContext instead of tracingContext: tracingContext. Either remove the disable comment and use the shorthand syntax, or if the longhand is intentional for clarity, add a comment explaining why the shorthand is disabled.

Copilot generated this review using guidance from repository custom instructions.

useEffect(() => {
if (delay === null) return
if (delay === null) {return}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curly braces placement is inconsistent with proper formatting. According to the ESLint config's curly: ['error', 'all'] rule, the opening brace should be on the same line with proper spacing, but the return statement should be on its own line. This should be formatted as if (delay === null) {\n return\n} for readability and consistency.

Copilot generated this review using guidance from repository custom instructions.

useEffect(() => {
if (delay === null) return
if (delay === null) {return}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same formatting issue as Comment 2. The return statement should be on its own line: if (delay === null) {\n return\n}.

Copilot generated this review using guidance from repository custom instructions.
// Let provider know about our hidden file input so external menus can call openFileDialog()
useEffect(() => {
if (!usingProvider) return
if (!usingProvider) {return}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same formatting issue. The return statement should be on its own line for consistency with the ESLint curly: ['error', 'all'] rule.

Copilot generated this review using guidance from repository custom instructions.
useEffect(() => {
const form = formRef.current
if (!form) return
if (!form) {return}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same formatting issue. The return statement should be on its own line.

Copilot generated this review using guidance from repository custom instructions.
import { createVectorQueryTool, createGraphRAGTool } from '@mastra/rag'
import { google } from '@ai-sdk/google'
import { embedMany } from 'ai'
import type { UIMessage } from 'ai'
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'UIMessage' is defined but never used.

Copilot uses AI. Check for mistakes.
retries?: number
// eslint-disable-next-line no-unused-vars

retryDelay?: (retryCount: number, error: any) => number
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected any. Specify a different type.

Copilot uses AI. Check for mistakes.

// Ensure at least one progress call included the expected in-progress message and metadata
const hasInProgressCall = mockWriter.custom.mock.calls.some(
(c: any) => {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected any. Specify a different type.

Copilot uses AI. Check for mistakes.

it('handles empty array', async () => {
const data: Record<string, any>[] = []
const data: Array<Record<string, any>> = []
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected any. Specify a different type.

Copilot uses AI. Check for mistakes.
mockContext
)

const successResult = result as any
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected any. Specify a different type.

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (13)
hooks/use-utils.ts (2)

71-76: Minor formatting inconsistency.

The braces satisfy the curly: ['error', 'all'] rule, but the compressed formatting {return} is unusual. Consider adding spaces for readability: { return } or expanding to multiple lines for consistency with the rest of the codebase.

✨ Suggested formatting
-        if (delay === null) {return}
+        if (delay === null) { return }

Or multi-line:

-        if (delay === null) {return}
+        if (delay === null) {
+            return
+        }

86-91: Same formatting note as useInterval.

The same compressed brace formatting {return} appears here. Consider applying consistent formatting across both hooks.

app/workflows/components/workflow-actions.tsx (2)

27-34: Implement the SVG export functionality or remove placeholder code.

The TODO comment indicates incomplete functionality, and the console.log appears to be debug/placeholder code. Consider either:

  1. Implementing the actual SVG export using React Flow's export utilities
  2. Removing or hiding this button until the feature is implemented

Would you like me to generate an implementation for the SVG export functionality? React Flow provides getNodes(), getEdges(), and viewport utilities that can be used to export the workflow as SVG.


36-46: Consider fallback handling for the VSCode protocol.

The vscode://file protocol only works when VSCode is installed and configured to handle the protocol. Consider adding:

  1. User feedback if the window.open fails or the protocol isn't supported
  2. A fallback option (e.g., display the file path to copy, or link to a web-based viewer)
  3. Detection or configuration to check if VSCode is available
💡 Example: Add basic error feedback
 const handleViewCode = useCallback(() => {
     if (!workflowConfig) {
         return
     }
-    // Open workflow source code
     const workflowPath = `/src/mastra/workflows/${workflowConfig.id
         .replace(/([A-Z])/g, '-$1')
         .toLowerCase()
         .replace(/^-/, '')}.ts`
-    window.open(`vscode://file${workflowPath}`, '_blank')
+    const opened = window.open(`vscode://file${workflowPath}`, '_blank')
+    if (!opened) {
+        console.warn('Failed to open VSCode. Path:', workflowPath)
+        // Optionally show user-facing toast/notification
+    }
 }, [workflowConfig])
app/dashboard/_components/data-table.tsx (1)

24-35: Inconsistent array type syntax within the same interface.

Line 25 uses Array<Column<T>> while line 26 still uses T[]. If the PR objective is to standardize on Array<Type> syntax, consider updating data to Array<T> for consistency within this interface.

Suggested fix for consistency
 interface DataTableProps<T> {
     columns: Array<Column<T>>
-    data: T[]
+    data: Array<T>
     searchPlaceholder?: string
     searchKey?: keyof T
     onRowClick?: (row: T) => void
     selectedId?: string
     getRowId?: (row: T) => string
     pageSize?: number
     emptyMessage?: string
     className?: string
 }
src/components/ai-elements/confirmation.tsx (1)

14-36: Redundant union branch in ToolUIPartApproval.

The union branch at lines 25-29 ({ id: string; approved: true; reason?: string }) is redundant. It's fully covered by the branch at lines 20-24 ({ id: string; approved: boolean; reason?: string }), since boolean already includes true. The AI summary indicates this branch was intended to be removed.

🔧 Suggested fix
 type ToolUIPartApproval =
     | {
           id: string
           approved?: never
           reason?: never
       }
     | {
           id: string
           approved: boolean
           reason?: string
       }
-    | {
-          id: string
-          approved: true
-          reason?: string
-      }
-
     | {
           id: string
           approved: false
           reason?: string
       }
     | undefined
src/mastra/tools/tests/csv-to-json.tool.test.ts (1)

95-141: Inconsistent indentation in test case.

The should emit progress events test case uses 8-space indentation instead of the 2-space indentation used consistently throughout the rest of this file and codebase. This should be fixed for consistency.

🔧 Proposed fix
   it('should emit progress events', async () => {
-        // Arrange
-        const csvData = 'name,value\nTest,100'
-        const mockWriter: any = {
-          custom: vi.fn(),
-          write: vi.fn(),
-        }
-        const mockSpan: any = {
-          update: vi.fn(),
-          end: vi.fn(),
-          error: vi.fn(),
-        }
-        const mockTracingContext: any = {
-          currentSpan: {
-            createChildSpan: vi.fn().mockReturnValue(mockSpan),
-          },
-        }
-
-        // Act
-        await csvToJsonTool.execute!(
-          {
-            csvData,
-            options: {
-              delimiter: ',',
-              columns: true,
-              trim: true,
-              skip_empty_lines: true,
-            },
-          },
-          {
-            writer: mockWriter,
-            tracingContext: mockTracingContext,
-            abortSignal: new AbortController().signal,
-          }
-        )
-
-        // Assert
-        expect(mockWriter.custom).toHaveBeenCalledWith(
-          expect.objectContaining({
-            type: 'data-tool-progress',
-            data: expect.objectContaining({
-              status: 'in-progress',
-            }),
-            id: 'csv-to-json',
-          })
-        )
-      })
+    // Arrange
+    const csvData = 'name,value\nTest,100'
+    const mockWriter: any = {
+      custom: vi.fn(),
+      write: vi.fn(),
+    }
+    const mockSpan: any = {
+      update: vi.fn(),
+      end: vi.fn(),
+      error: vi.fn(),
+    }
+    const mockTracingContext: any = {
+      currentSpan: {
+        createChildSpan: vi.fn().mockReturnValue(mockSpan),
+      },
+    }
+
+    // Act
+    await csvToJsonTool.execute!(
+      {
+        csvData,
+        options: {
+          delimiter: ',',
+          columns: true,
+          trim: true,
+          skip_empty_lines: true,
+        },
+      },
+      {
+        writer: mockWriter,
+        tracingContext: mockTracingContext,
+        abortSignal: new AbortController().signal,
+      }
+    )
+
+    // Assert
+    expect(mockWriter.custom).toHaveBeenCalledWith(
+      expect.objectContaining({
+        type: 'data-tool-progress',
+        data: expect.objectContaining({
+          status: 'in-progress',
+        }),
+        id: 'csv-to-json',
+      })
+    )
+  })
app/api/contact/route.ts (1)

41-49: PII logged to console violates data privacy guidelines.

The contact form logs personally identifiable information (email, full name) directly to the console. Per coding guidelines, PII should never be logged. Consider masking or omitting sensitive fields, or use a structured logging service that can redact PII automatically.

🔒 Proposed fix
         // Store in database or send email
         // Option 1: Log for now (replace with actual implementation)
         console.log('Contact form submission:', {
-            name: `${data.firstName} ${data.lastName}`,
-            email: data.email,
-            company: data.company || 'N/A',
+            hasName: Boolean(data.firstName && data.lastName),
+            hasEmail: Boolean(data.email),
+            hasCompany: Boolean(data.company),
             inquiryType: data.inquiryType || 'general',
             subject: data.subject,
-            message: data.message,
+            messageLength: data.message.length,
             timestamp: new Date().toISOString(),
         })

Based on coding guidelines: "Never include passwords, API keys, tokens, or personally identifiable information (PII) in code or logs."

ui/accordion.tsx (1)

24-31: Consider removing the leftover blank line in AccordionProps.

Same issue as above - the blank line at line 28 disrupts the interface definition readability.

✨ Suggested cleanup
 export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
     type?: 'single' | 'multiple'
     defaultValue?: string | string[]
     value?: string | string[]
-
     onValueChange?: (value: string | string[]) => void
     collapsible?: boolean
 }
app/networks/providers/network-context.tsx (1)

67-85: Consider removing leftover blank lines in the interface definition.

The ESLint disable comment removal is appropriate, but the remaining blank lines at lines 81 and 83 create inconsistent spacing within the NetworkContextValue interface. Other members don't have blank lines between them.

✨ Suggested cleanup
 export interface NetworkContextValue {
     selectedNetwork: NetworkId
     networkConfig: NetworkConfig | undefined
     networkStatus: NetworkStatus
     routingSteps: RoutingStep[]
     progressEvents: ProgressEvent[]
     messages: UIMessage[]
     streamingOutput: string
     streamingReasoning: string
     toolInvocations: ToolInvocationState[]
     sources: Source[]
     error: string | null
     stopExecution: () => void
     clearHistory: () => void
-
     selectNetwork: (networkId: NetworkId) => void
-
     sendMessage: (text: string) => void
 }
app/chat/providers/chat-context.tsx (1)

573-686: Large context value is appropriately memoized.

The extensive dependency array is necessary given the number of values and callbacks exposed by this context. The use of useMemo prevents unnecessary re-renders of consumers. Consider in the future whether this context could be split into smaller, more focused contexts (e.g., ChatActionsContext, ChatStateContext) to reduce coupling and improve performance for consumers that only need a subset of values.

app/chat/providers/chat-context-types.ts (2)

64-70: Duplicate WebPreviewData interface with different fields.

This WebPreviewData interface is missing several optional fields present in app/chat/components/chat.types.ts (lines 98-108): html, editable, showConsole, and height. Consider consolidating these into a single source of truth to avoid type mismatches.


41-46: Critical type mismatch: QueuedTask definitions differ between files used inconsistently across the codebase.

The QueuedTask interface is defined in both chat-context-types.ts (incomplete) and chat.types.ts (complete with createdAt, completedAt, error fields). This causes a type safety violation: chat-context.tsx uses the incomplete definition when managing queuedTasks, but agent-queue.tsx imports the complete definition and accesses task.createdAt and task.error fields that don't exist in the declared type. The same issue exists with WebPreviewData.

Consolidate both interface definitions to a single canonical location and update all imports to use that source. Ensure the unified type includes all fields required by consuming components.

🤖 Fix all issues with AI agents
In `@app/chat/components/agent-artifact.tsx`:
- Around line 62-73: The handleCopy handler currently swallows clipboard errors
(in doCopy's catch it does "void err"); update the catch to log the error like
the other component to aid debugging — inside the doCopy catch block for
navigator.clipboard.writeText(editedCode) replace the silent discard with a
console.error('Failed to copy:', err) (or the project's logger if preferred) and
keep the existing setCopied/setTimeout behavior unchanged; reference handleCopy
and the inner doCopy async function to locate the change.

In `@app/chat/components/agent-confirmation.tsx`:
- Around line 31-34: The interface that declares className, onApprove and
onReject has unnecessary blank lines; remove the extra empty lines so the
properties are contiguous (e.g., className followed immediately by onApprove and
onReject) to match typical TypeScript formatting and improve readability.

In `@app/chat/components/chat.types.ts`:
- Around line 1-111: Convert remaining bracket-style array types to generic
Array<T> for consistency: change TaskStep[] in AgentTaskData.steps to
Array<TaskStep>, change PlanStep[] | string[] in AgentPlanData.steps to
Array<PlanStep> | Array<string>, change AgentSuggestionsProps.suggestions from
string[] to Array<string>, and change InlineCitationRender from ReactNode[] to
Array<ReactNode>; update only the type annotations (no runtime logic).

In `@app/chat/providers/chat-context-types.ts`:
- Around line 105-145: The interface in chat-context-types.ts has extra blank
lines left by removed ESLint comments; clean up the spacing by removing
consecutive empty lines between method signatures (e.g., sendMessage,
stopGeneration, clearMessages, selectAgent, selectModel, dismissError,
setFocusMode, addTask, updateTask, removeTask, approveConfirmation,
rejectConfirmation, createCheckpoint, restoreCheckpoint, removeCheckpoint,
setWebPreview, setThreadId, setResourceId) so each method is separated
consistently (single blank line or none) to improve readability.

In `@app/components/api-components.tsx`:
- Around line 3-4: Fix the minor import formatting: ensure the type-only import
reads with proper spacing around the brace (ReactNode -> ReactNode }) and make
semicolon usage consistent between imports. Update the import lines so they use
the same semicolon convention and spacing—e.g., change the type import to
"import type { ReactNode } from 'react';" and match the useState import
punctuation/semicolons accordingly in app/components/api-components.tsx.

In `@app/dashboard/_components/data-table.tsx`:
- Around line 85-87: The comparator is using loose equality checks ("aVal ==
null" / "bVal == null"); replace these with explicit strict checks to satisfy
the guideline by testing both null and undefined (e.g., aVal === null || aVal
=== undefined and similarly for bVal) in the same comparator block (the function
around the existing aVal/bVal comparisons) so the null/undefined handling
remains equivalent but uses strict operators.

In `@eslint.config.js`:
- Line 2: Remove the duplicate import and consolidate to the unified
typescript-eslint export: drop the tseslint from
'@typescript-eslint/eslint-plugin' import and use the existing typescriptEslint
import (from 'typescript-eslint') everywhere; update the plugins object to
reference typescriptEslint.plugin (or the plugin property on the unified import)
and adjust any configs that referenced tseslint to use typescriptEslint.plugin
and typescriptEslint.parser as needed so only the single typescriptEslint symbol
is used for plugin/parser/config references.
- Around line 57-58: Remove the redundant globalIgnores call by deleting the
globalIgnores(['dist', 'node_modules']) entry; the ignores array already
contains 'dist/**' and 'node_modules/**', so keep the { ignores } export and
remove the globalIgnores(...) invocation to avoid duplicate patterns (refer to
the ignores array and the globalIgnores function call).
- Around line 52-54: The code is accessing typescript-eslint configs via the
nonexistent typescriptEslint.plugin.configs path; update the accessors to use
the v8 API: replace
typescriptEslint.plugin.configs['flat/recommended-type-checked'] with
typescriptEslint.configs.recommendedTypeChecked when building
tsTypeCheckedRecommended, and likewise replace
typescriptEslint.plugin.configs['flat/recommended'] with
typescriptEslint.configs.recommended where the standard recommended config is
referenced; keep the existing mapping logic that sets cfg.files when absent (the
tsTypeCheckedRecommended mapping and any use of the previous 'flat/recommended'
reference should be updated to the new identifiers).

In `@src/components/ai-elements/prompt-input.tsx`:
- Line 590: Replace compressed single-line conditional returns with the
multi-line brace style used elsewhere for consistency: change occurrences like
"if (!usingProvider) {return}" to a multi-line block with braces and a semicolon
on the return, and apply the same change for the other occurrences noted (the
checks using usingProvider at the other locations). Update the conditional
statements referencing the usingProvider variable so they follow the project's
multi-line if { ... } formatting.

In `@src/mastra/lib/http-client.ts`:
- Around line 16-17: Change the explicit any on the retryDelay callback
parameter to a safer type: replace "retryDelay?: (retryCount: number, error:
any) => number" with either "retryDelay?: (retryCount: number, error: unknown)
=> number" and narrow/cast inside the implementation, or import and use
AxiosError (e.g., "import type { AxiosError } from 'axios'" and then
"retryDelay?: (retryCount: number, error: AxiosError) => number") so the
retryDelay signature in http-client.ts no longer uses any.

In `@src/mastra/tools/tests/alpha-vantage.tool.test.ts`:
- Line 633: The single-line if statement in the test (the condition checking
"!data || typeof data.message !== 'string'") has braces but lacks spacing for
readability; update that statement to include spaces after the opening brace and
before the closing brace (i.e., change "{return false}" to "{ return false }")
so it complies with curly style and improves readability in the
alpha-vantage.tool.test assertion.

In `@src/mastra/tools/weather-tool.ts`:
- Around line 128-129: The object property currently uses the form
"tracingContext: tracingContext" with an accompanying "//
eslint-disable-next-line object-shorthand" comment; remove the eslint-disable
comment and convert the property to use object shorthand by replacing the
explicit key:value with just "tracingContext" where the object is constructed
(look for the object that contains the tracingContext property in
weather-tool.ts).

In `@ui/accordion.tsx`:
- Around line 7-12: The interface AccordionContextValue has an extraneous blank
line between the openItems member and the toggle member; remove that blank line
so members are listed consecutively (openItems, toggle, type) in the
AccordionContextValue interface to match typical formatting and eliminate the
awkward spacing.

Comment on lines +62 to 73
const handleCopy = useCallback(() => {
const doCopy = async () => {
try {
await navigator.clipboard.writeText(editedCode)
setCopied(true)
setTimeout(() => setCopied(false), 2000)
} catch (err) {
void err
}
}
void doCopy()
}, [editedCode])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent error handling compared to similar copy logic elsewhere.

The error is silently discarded with void err (Line 69), but in agent-web-preview.tsx (Line 155-157), the same copy operation logs the error with console.error('Failed to copy:', err). Consider logging the error for debugging consistency.

Proposed fix
     const handleCopy = useCallback(() => {
         const doCopy = async () => {
             try {
                 await navigator.clipboard.writeText(editedCode)
                 setCopied(true)
                 setTimeout(() => setCopied(false), 2000)
             } catch (err) {
-                void err
+                console.error('Failed to copy:', err)
             }
         }
         void doCopy()
     }, [editedCode])
🤖 Prompt for AI Agents
In `@app/chat/components/agent-artifact.tsx` around lines 62 - 73, The handleCopy
handler currently swallows clipboard errors (in doCopy's catch it does "void
err"); update the catch to log the error like the other component to aid
debugging — inside the doCopy catch block for
navigator.clipboard.writeText(editedCode) replace the silent discard with a
console.error('Failed to copy:', err) (or the project's logger if preferred) and
keep the existing setCopied/setTimeout behavior unchanged; reference handleCopy
and the inner doCopy async function to locate the change.

Comment on lines 1 to 111
import type { DynamicToolUIPart } from 'ai'
import type { ReactNode } from 'react'
import type { ToolInvocationState as ChatToolInvocationState } from '../providers/chat-context-types'

export interface Citation {
id: string
number: string
title: string
url: string
description?: string
quote?: string
id: string
number: string
title: string
url: string
description?: string
quote?: string
}

export interface AgentToolsProps {
tools: Array<ChatToolInvocationState | DynamicToolUIPart>
className?: string
tools: Array<ChatToolInvocationState | DynamicToolUIPart>
className?: string
}

export type TaskStepStatus = 'pending' | 'running' | 'completed' | 'error'

export interface TaskStep {
id: string
text: string
status: TaskStepStatus
file?: {
name: string
icon?: string
}
id: string
text: string
status: TaskStepStatus
file?: {
name: string
icon?: string
}
}

export interface AgentTaskData {
title: string
steps: TaskStep[]
title: string
steps: TaskStep[]
}

export interface ArtifactData {
id: string
title: string
description?: string
type: 'code' | 'markdown' | 'json' | 'text' | 'html' | 'react'
language?: string
content: string
id: string
title: string
description?: string
type: 'code' | 'markdown' | 'json' | 'text' | 'html' | 'react'
language?: string
content: string
}

export interface PlanStep {
text: string
completed?: boolean
text: string
completed?: boolean
}

export interface AgentPlanData {
title: string
description: string
steps: PlanStep[] | string[]
isStreaming?: boolean
currentStep?: number
title: string
description: string
steps: PlanStep[] | string[]
isStreaming?: boolean
currentStep?: number
}

export interface ReasoningStep {
id: string
label: string
description?: string
status: 'complete' | 'active' | 'pending'
searchResults?: string[]
duration?: number
id: string
label: string
description?: string
status: 'complete' | 'active' | 'pending'
searchResults?: string[]
duration?: number
}

export interface AgentSuggestionsProps {
suggestions: string[]
// eslint-disable-next-line no-unused-vars
onSelect: (suggestion: string) => void
disabled?: boolean
className?: string
suggestions: string[]
onSelect: (suggestion: string) => void
disabled?: boolean
className?: string
}

export interface AgentSourcesProps {
sources: Array<{ url: string; title: string }>
className?: string
maxVisible?: number
sources: Array<{ url: string; title: string }>
className?: string
maxVisible?: number
}

export interface AgentReasoningProps {
reasoning: string
isStreaming: boolean
duration?: number
className?: string
reasoning: string
isStreaming: boolean
duration?: number
className?: string
}

export type ConfirmationSeverity = 'info' | 'warning' | 'danger'

export interface QueuedTask {
id: string
title: string
description?: string
status: 'pending' | 'running' | 'completed' | 'failed'
createdAt?: Date
completedAt?: Date
error?: string
id: string
title: string
description?: string
status: 'pending' | 'running' | 'completed' | 'failed'
createdAt?: Date
completedAt?: Date
error?: string
}

export interface WebPreviewData {
id: string
url: string
title?: string
code?: string
language?: string
html?: string
editable?: boolean
showConsole?: boolean
height?: number
id: string
url: string
title?: string
code?: string
language?: string
html?: string
editable?: boolean
showConsole?: boolean
height?: number
}

export type InlineCitationRender = ReactNode[]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Formatting changes look good; consider completing array syntax standardization.

The formatting improvements and import reordering are consistent and non-breaking. All type-only imports correctly use import type, and interface definitions follow proper conventions.

However, there's a minor inconsistency with the PR's objective to standardize array typing to Array<Type> syntax:

  • Line 15 correctly uses: Array<ChatToolInvocationState | DynamicToolUIPart>
  • Lines 33 and 53 still use bracket notation: TaskStep[] and PlanStep[] | string[]
📝 Optional: Complete array syntax standardization

For full consistency with the standardization effort, consider updating the remaining array types:

 export interface AgentTaskData {
   title: string
-  steps: TaskStep[]
+  steps: Array<TaskStep>
 }
 export interface AgentPlanData {
   title: string
   description: string
-  steps: PlanStep[] | string[]
+  steps: Array<PlanStep> | Array<string>
   isStreaming?: boolean
   currentStep?: number
 }
🤖 Prompt for AI Agents
In `@app/chat/components/chat.types.ts` around lines 1 - 111, Convert remaining
bracket-style array types to generic Array<T> for consistency: change TaskStep[]
in AgentTaskData.steps to Array<TaskStep>, change PlanStep[] | string[] in
AgentPlanData.steps to Array<PlanStep> | Array<string>, change
AgentSuggestionsProps.suggestions from string[] to Array<string>, and change
InlineCitationRender from ReactNode[] to Array<ReactNode>; update only the type
annotations (no runtime logic).

Comment on lines 105 to 145
// Actions
// eslint-disable-next-line no-unused-vars

sendMessage: (text: string, files?: File[]) => void
stopGeneration: () => void
clearMessages: () => void
// eslint-disable-next-line no-unused-vars

selectAgent: (agentId: string) => void
// eslint-disable-next-line no-unused-vars

selectModel: (modelId: string) => void
dismissError: () => void
// eslint-disable-next-line no-unused-vars

setFocusMode: (enabled: boolean) => void

// Task management
// eslint-disable-next-line no-unused-vars

addTask: (task: Omit<QueuedTask, 'id'>) => string
// eslint-disable-next-line no-unused-vars

updateTask: (taskId: string, updates: Partial<QueuedTask>) => void
// eslint-disable-next-line no-unused-vars

removeTask: (taskId: string) => void

// Confirmation management
// eslint-disable-next-line no-unused-vars

approveConfirmation: (confirmationId: string) => void
// eslint-disable-next-line no-unused-vars

rejectConfirmation: (confirmationId: string, reason?: string) => void
// Checkpoint management
// eslint-disable-next-line no-unused-vars

createCheckpoint: (messageIndex: number, label?: string) => string
// eslint-disable-next-line no-unused-vars

restoreCheckpoint: (checkpointId: string) => void
// eslint-disable-next-line no-unused-vars

removeCheckpoint: (checkpointId: string) => void
// Web Preview management
// eslint-disable-next-line no-unused-vars

setWebPreview: (preview: WebPreviewData | null) => void
// Memory management
// eslint-disable-next-line no-unused-vars

setThreadId: (threadId: string) => void
// eslint-disable-next-line no-unused-vars

setResourceId: (resourceId: string) => void
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Remove excessive blank lines in interface methods.

The removed ESLint disable comments left behind blank lines between method signatures. While this doesn't affect functionality, multiple consecutive blank lines within an interface reduce readability. Consider removing some of these blank lines for cleaner formatting.

🤖 Prompt for AI Agents
In `@app/chat/providers/chat-context-types.ts` around lines 105 - 145, The
interface in chat-context-types.ts has extra blank lines left by removed ESLint
comments; clean up the spacing by removing consecutive empty lines between
method signatures (e.g., sendMessage, stopGeneration, clearMessages,
selectAgent, selectModel, dismissError, setFocusMode, addTask, updateTask,
removeTask, approveConfirmation, rejectConfirmation, createCheckpoint,
restoreCheckpoint, removeCheckpoint, setWebPreview, setThreadId, setResourceId)
so each method is separated consistently (single blank line or none) to improve
readability.

Comment on lines +3 to +4
import type { ReactNode} from 'react';
import { useState } from 'react'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Good separation of type-only imports.

Separating ReactNode as a type-only import aligns with the coding guidelines for using import type for type declarations.

Minor formatting note: Line 3 has inconsistent spacing (ReactNode} vs ReactNode }) and semicolon usage differs from line 4.

🔧 Optional formatting fix
-import type { ReactNode} from 'react';
-import { useState } from 'react'
+import type { ReactNode } from 'react'
+import { useState } from 'react'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { ReactNode} from 'react';
import { useState } from 'react'
import type { ReactNode } from 'react'
import { useState } from 'react'
🤖 Prompt for AI Agents
In `@app/components/api-components.tsx` around lines 3 - 4, Fix the minor import
formatting: ensure the type-only import reads with proper spacing around the
brace (ReactNode -> ReactNode }) and make semicolon usage consistent between
imports. Update the import lines so they use the same semicolon convention and
spacing—e.g., change the type import to "import type { ReactNode } from
'react';" and match the useState import punctuation/semicolons accordingly in
app/components/api-components.tsx.

// Let provider know about our hidden file input so external menus can call openFileDialog()
useEffect(() => {
if (!usingProvider) return
if (!usingProvider) {return}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Inconsistent single-line brace formatting.

The early returns and conditional statements use a compressed single-line format (if (cond) {return}) that differs from the multi-line style used elsewhere in this file (e.g., lines 186-188, 202-204). For consistency and readability, consider using the same multi-line format throughout.

♻️ Suggested formatting for consistency
-        if (!usingProvider) {return}
+        if (!usingProvider) {
+            return
+        }
-        if (!form) {return}
+        if (!form) {
+            return
+        }
-        if (!globalDrop) {return}
+        if (!globalDrop) {
+            return
+        }
-                    if (f.url) {URL.revokeObjectURL(f.url)}
+                    if (f.url) {
+                        URL.revokeObjectURL(f.url)
+                    }

Also applies to: 607-607, 631-631, 658-658

🤖 Prompt for AI Agents
In `@src/components/ai-elements/prompt-input.tsx` at line 590, Replace compressed
single-line conditional returns with the multi-line brace style used elsewhere
for consistency: change occurrences like "if (!usingProvider) {return}" to a
multi-line block with braces and a semicolon on the return, and apply the same
change for the other occurrences noted (the checks using usingProvider at the
other locations). Update the conditional statements referencing the
usingProvider variable so they follow the project's multi-line if { ... }
formatting.

Comment on lines +16 to 17

retryDelay?: (retryCount: number, error: any) => number
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Replace any with a proper type for the error parameter.

Removing the ESLint disable comment is good cleanup, but the error: any parameter on line 17 now violates the coding guideline to avoid explicit any types. Consider using unknown or the more specific AxiosError type.

♻️ Suggested fix
+import type { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios'
-import type { AxiosInstance, AxiosRequestConfig } from 'axios'
-    retryDelay?: (retryCount: number, error: any) => number
+    retryDelay?: (retryCount: number, error: AxiosError) => number

As per coding guidelines, use proper types or unknown instead of explicit any.

🤖 Prompt for AI Agents
In `@src/mastra/lib/http-client.ts` around lines 16 - 17, Change the explicit any
on the retryDelay callback parameter to a safer type: replace "retryDelay?:
(retryCount: number, error: any) => number" with either "retryDelay?:
(retryCount: number, error: unknown) => number" and narrow/cast inside the
implementation, or import and use AxiosError (e.g., "import type { AxiosError }
from 'axios'" and then "retryDelay?: (retryCount: number, error: AxiosError) =>
number") so the retryDelay signature in http-client.ts no longer uses any.

(c: any) => {
const data = c[0]?.data
if (!data || typeof data.message !== 'string') return false
if (!data || typeof data.message !== 'string') {return false}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Minor formatting suggestion for readability.

The curly braces addition correctly satisfies the curly: ['error', 'all'] ESLint rule. Consider adding spaces for better readability.

✨ Suggested formatting improvement
-                    if (!data || typeof data.message !== 'string') {return false}
+                    if (!data || typeof data.message !== 'string') {
+                        return false
+                    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!data || typeof data.message !== 'string') {return false}
if (!data || typeof data.message !== 'string') {
return false
}
🤖 Prompt for AI Agents
In `@src/mastra/tools/tests/alpha-vantage.tool.test.ts` at line 633, The
single-line if statement in the test (the condition checking "!data || typeof
data.message !== 'string'") has braces but lacks spacing for readability; update
that statement to include spaces after the opening brace and before the closing
brace (i.e., change "{return false}" to "{ return false }") so it complies with
curly style and improves readability in the alpha-vantage.tool.test assertion.

Comment on lines +128 to +129
// eslint-disable-next-line object-shorthand
tracingContext: tracingContext,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove ESLint disable comment and use object shorthand.

This contradicts the PR objective of removing unnecessary ESLint disable comments. Per coding guidelines, use object shorthand syntax instead of { name: name }.

Proposed fix
-            // eslint-disable-next-line object-shorthand
-            tracingContext: tracingContext,
+            tracingContext,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// eslint-disable-next-line object-shorthand
tracingContext: tracingContext,
tracingContext,
🤖 Prompt for AI Agents
In `@src/mastra/tools/weather-tool.ts` around lines 128 - 129, The object property
currently uses the form "tracingContext: tracingContext" with an accompanying
"// eslint-disable-next-line object-shorthand" comment; remove the
eslint-disable comment and convert the property to use object shorthand by
replacing the explicit key:value with just "tracingContext" where the object is
constructed (look for the object that contains the tracingContext property in
weather-tool.ts).

Comment on lines 7 to 12
interface AccordionContextValue {
openItems: string[]
// eslint-disable-next-line no-unused-vars

toggle: (value: string) => void
type: 'single' | 'multiple'
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider removing the leftover blank line in the interface.

The ESLint disable comment removal is good, but the remaining blank line at line 9 creates awkward spacing within the interface definition. Interface members are typically listed without blank lines between them unless there's a logical grouping.

✨ Suggested cleanup
 interface AccordionContextValue {
     openItems: string[]
-
     toggle: (value: string) => void
     type: 'single' | 'multiple'
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
interface AccordionContextValue {
openItems: string[]
// eslint-disable-next-line no-unused-vars
toggle: (value: string) => void
type: 'single' | 'multiple'
}
interface AccordionContextValue {
openItems: string[]
toggle: (value: string) => void
type: 'single' | 'multiple'
}
🤖 Prompt for AI Agents
In `@ui/accordion.tsx` around lines 7 - 12, The interface AccordionContextValue
has an extraneous blank line between the openItems member and the toggle member;
remove that blank line so members are listed consecutively (openItems, toggle,
type) in the AccordionContextValue interface to match typical formatting and
eliminate the awkward spacing.

- Refactor `AgentConfirmationProps` to remove unnecessary line breaks.
- Add new icons (`ActivityIcon`, `NetworkIcon`) to `chat-messages.tsx`.
- Implement type guards for various data parts in `chat-messages.tsx`.
- Create `AgentDataSection`, `WorkflowDataSection`, and `NetworkDataSection` components for rendering nested execution results.
- Update `NestedAgentChat` to handle form submission asynchronously and log errors.
- Modify `network-chat.tsx` to handle clipboard actions asynchronously.
- Improve error handling in `NetworkProvider` and `WorkflowProvider` for message sending and stopping execution.
- Remove deprecated `maskSensitiveMessageData` function from `pg-storage.ts`.
- Update `formatStorageMessages` to directly push messages to `messageData.parts` based on operation status.
@ssdeanx ssdeanx closed this Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants