Skip to content

feat: enhance agent workflows and configurations#61

Merged
ssdeanx merged 1 commit intomainfrom
develop
Dec 17, 2025
Merged

feat: enhance agent workflows and configurations#61
ssdeanx merged 1 commit intomainfrom
develop

Conversation

@ssdeanx
Copy link
Owner

@ssdeanx ssdeanx commented Dec 17, 2025

  • Updated OTEL configuration in instrumentation.ts to prevent double instrumentation.
  • Refactored Dane agent to use new webScraperTool and updated model to 'google/gemini-3-flash-preview'.
  • Commented out unused tools in editorAgent.ts and noteTakerAgent.ts for clarity.
  • Removed outdated agent-experiments.ts file and added new experiments with logging for various agents.
  • Improved error handling in repo-ingestion-workflow.ts for better clarity on scan results.
  • Updated target audience checks in content-review-workflow.ts for more robust validation.
  • Adjusted output processor limits in weather-agent.ts for performance optimization.
  • Cleaned up whitespace in changelog.ts and other workflow files for consistency.

Summary by Sourcery

Improve agent configurations, observability, and workflow robustness across the Mastra system.

New Features:

  • Gate Vercel OTEL registration behind a VERCEL_OTEL_ENABLED flag so Mastra remains the primary telemetry configuration by default.
  • Update the Dane agent to use the latest Gemini flash model with enhanced thinking configuration and a web scraper tool.

Bug Fixes:

  • Harden repo ingestion GitHub scan result handling to better validate response shapes and surface clearer errors.
  • Ensure repo ingestion file fetches fail fast when content is missing or empty instead of silently proceeding.
  • Make content review prompts more robust by only injecting target audience text when it is non-empty and well-formed.
  • Reduce the weather agent token limit to prevent excessive output and potential performance issues.

Enhancements:

  • Move agent experiment utilities into the evals namespace and switch experiment logging from console output to structured logger events while disabling scorers.
  • Comment out unused tools for several agents and workflows to simplify configurations without removing future integration points.
  • Apply minor whitespace and formatting cleanups across workflows and agents for consistency.

- Updated OTEL configuration in instrumentation.ts to prevent double instrumentation.
- Refactored Dane agent to use new webScraperTool and updated model to 'google/gemini-3-flash-preview'.
- Commented out unused tools in editorAgent.ts and noteTakerAgent.ts for clarity.
- Removed outdated agent-experiments.ts file and added new experiments with logging for various agents.
- Improved error handling in repo-ingestion-workflow.ts for better clarity on scan results.
- Updated target audience checks in content-review-workflow.ts for more robust validation.
- Adjusted output processor limits in weather-agent.ts for performance optimization.
- Cleaned up whitespace in changelog.ts and other workflow files for consistency.
Copilot AI review requested due to automatic review settings December 17, 2025 21:19
@continue
Copy link

continue bot commented Dec 17, 2025

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 Dec 17, 2025

Reviewer's Guide

Refines observability and multiple agents/workflows: makes Vercel OTEL registration opt-in to avoid double instrumentation, modernizes the Dane agent configuration and tools, tightens validation and error handling in workflows, scales back unused tools, and adds structured logging to agent evaluation experiments while reducing scorer usage.

Sequence diagram for agent experiment logging and scorer usage changes

sequenceDiagram
  actor Dev
  participant ExperimentRunner as runContentStrategistExperiment
  participant Logger as log
  participant Eval as runEvals
  participant Agent as contentStrategistAgent

  Dev->>ExperimentRunner: invoke()
  ExperimentRunner->>Logger: info("Running Content Strategist Experiment")

  ExperimentRunner->>Eval: runEvals({target: Agent, data: prompts, scorers: []})
  Eval-->>ExperimentRunner: results

  ExperimentRunner->>Logger: info("Content Strategist Experiment Results", {results})
  ExperimentRunner-->>Dev: results
Loading

Updated class diagram for Dane agent configuration and tools

classDiagram
  class DaneContext {
    string userId
    string sessionId
    string organizationId
  }

  class Agent {
    <<library>>
  }

  class Dane {
    <<Agent instance>>
    +string id
    +string name
    +string model
    +object tools
    +object memory
    +TokenLimiterProcessor[] outputProcessors
    +object providerConfig
  }

  class TokenLimiterProcessor {
    +TokenLimiterProcessor(maxTokens number)
    +number maxTokens
  }

  class execaTool {
    <<tool>>
  }

  class browserTool {
    <<tool>>
  }

  class webScraperTool {
    <<tool>>
  }

  class listEvents {
    <<tool>>
  }

  class GoogleGenerativeAIProviderOptions {
    +boolean includeThoughts
    +string thinkingLevel
    +string[] responseModalities
  }

  Agent <|.. Dane
  Dane --> DaneContext
  Dane --> TokenLimiterProcessor
  Dane --> execaTool
  Dane --> browserTool
  Dane --> webScraperTool
  Dane --> listEvents
  Dane --> GoogleGenerativeAIProviderOptions

  class GoogleModelConfig {
    +string modelId
    +GoogleGenerativeAIProviderOptions options
  }

  Dane --> GoogleModelConfig

  %% Updated properties
  Dane : model = "google/gemini-3-flash-preview"
  GoogleGenerativeAIProviderOptions : includeThoughts = true
  GoogleGenerativeAIProviderOptions : thinkingLevel = "high"
  GoogleGenerativeAIProviderOptions : responseModalities = ["TEXT"]
Loading

Flow diagram for updated repo ingestion scan and ingest error handling

graph TD
  A["scanStep start"] --> B["Call githubRepoScanner.scan"]
  B --> C["Receive scanResultRaw"]

  C --> D{"isScanSuccess(scanResultRaw)?<br/>r is object and has success"}

  D -->|"no"| E["Set errorMessage = 'unknown error'"]
  E --> F["Throw Error 'Failed to scan GitHub repo: unknown error'"]

  D -->|"yes"| G{"scanResultRaw.success and scanResultRaw.tree exists?"}
  G -->|"no"| H["Set errorMessage = scanResultRaw.error or 'unknown error'"]
  H --> I["Throw Error 'Failed to scan GitHub repo: ' + errorMessage"]
  G -->|"yes"| J["Proceed with scanResultRaw.tree"]

  J --> K["ingestStep start"]
  K --> L["Fetch file content from GitHub"]
  L --> M["Cast to successResult"]
  M --> N{"successResult.success and<br/>content is not null/undefined/empty?"}

  N -->|"no"| O["Throw Error 'Failed to fetch file from GitHub: ' + successResult.error"]
  N -->|"yes"| P["Use successResult.content for ingestion"]
  P --> Q["Complete ingestion"]
Loading

Flow diagram for content review workflow target audience handling

graph TD
  A["researchTopicStep start"] --> B["Read inputData.targetAudience"]
  B --> C{targetAudience is not undefined
  and not null
  and trimmed length > 0?}

  C -->|"yes"| D["Include 'targeting {targetAudience}' in research prompt"]
  C -->|"no"| E["Omit targeting clause from research prompt"]

  D --> F["Call agent.stream with prompt"]
  E --> F

  F --> G["draftContentStep"]
  G --> H["Check targetAudience with same non-empty validation"]

  H -->|"yes"| I["Include 'Target Audience: {targetAudience}' in drafting prompt"]
  H -->|"no"| J["Omit target audience from drafting prompt"]

  I --> K["Generate content"]
  J --> K
Loading

File-Level Changes

Change Details Files
Make Vercel OTEL initialization opt-in to avoid double instrumentation and defer to Mastra config by default.
  • Introduce VERCEL_OTEL_ENABLED flag derived from process.env
  • Gate registerOTel invocation behind the flag, otherwise return early as a no-op
  • Document the OTEL ownership model and interaction with Mastra in a top-level comment
  • Retain serviceName "ai" when Vercel OTEL is enabled
instrumentation.ts
Improve repo ingestion workflow error handling and type guards around GitHub scan and file fetch results.
  • Tighten scan result type guard to use unknown instead of any and handle null explicitly
  • Compute a clearer error message depending on whether the scan result matches the success shape
  • Expand file fetch validation to treat null, undefined, and empty-string content as failure before proceeding
src/mastra/workflows/repo-ingestion-workflow.ts
Refine agent configurations (Dane, editor, note taker, telephone, weather) to use updated models, tools, and safer defaults.
  • Switch Dane agent model to 'google/gemini-3-flash-preview' and adjust Google thinking config to use thinkingLevel 'high' instead of thinkingBudget
  • Replace Dane agent googleSearch tool with webScraperTool and wire in new import
  • Comment out tools array for editorAgent and telephone-game agents and for Slack toolset usage in the changelog workflow to reflect unused/disabled tools
  • Update noteTakerAgent instructions variable name and remove pgQueryTool import/use, leaving tools commented out
  • Reduce weather agent TokenLimiterProcessor token limit from 1048576 to 128000 for performance
src/mastra/agents/dane.ts
src/mastra/agents/editorAgent.ts
src/mastra/agents/noteTakerAgent.ts
src/mastra/agents/weather-agent.ts
src/mastra/workflows/changelog.ts
src/mastra/workflows/telephone-game.ts
Move agent experiments into evals module and add structured logging while disabling scorers for now.
  • Relocate agent-experiments.ts into src/mastra/evals and adjust imports accordingly
  • Replace console.log usage with logger.log/info calls including structured metadata and JSON-stringified results
  • Temporarily set scorers arrays to empty in all run*Experiment functions to run experiments without scoring
src/mastra/experiments/agent-experiments.ts
src/mastra/evals/agent-experiments.ts
Harden content-review workflow prompts around optional targetAudience field and clean minor whitespace issues in workflows.
  • Replace simple truthy check on targetAudience with explicit non-null, non-undefined, non-empty-string checks in research and draft steps
  • Apply whitespace-only cleanups in changelog and financial-report workflows for consistency
src/mastra/workflows/content-review-workflow.ts
src/mastra/workflows/changelog.ts
src/mastra/workflows/financial-report-workflow.ts

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Summary by CodeRabbit

  • New Features

    • Added conditional feature flag for observability configuration control.
  • Improvements

    • Updated agent configurations and capabilities across multiple agents.
    • Enhanced logging system with structured logging integration.
    • Improved input validation and error handling in workflow processes.
    • Refined prompt generation for conditional audience targeting in content workflows.

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

Walkthrough

The PR modifies instrumentation setup with a feature flag, updates multiple agents and workflows with tool removals or replacements, consolidates logging approaches, and strengthens type safety in result handling across evals and workflows.

Changes

Cohort / File(s) Summary
Instrumentation & Telemetry
src/instrumentation.ts
Added VERCEL_OTEL_ENABLED feature flag to conditionally enable Vercel's OTEL registration; register() now short-circuits to no-op when flag is not "true", relying on Mastra's configuration instead.
Agent Tool & Configuration Updates
src/mastra/agents/dane.ts, src/mastra/agents/editorAgent.ts, src/mastra/agents/noteTakerAgent.ts, src/mastra/agents/weather-agent.ts, src/mastra/agents/telephone-game.ts
Removed explicit tool configurations and imports; dane.ts replaced googleSearch with webScraperTool and updated Google provider to use thinkingLevel: 'high' and newer model; weather-agent.ts reduced token limit and removed scorers; other agents removed tools or updated instructions references.
Workflow Refinements
src/mastra/workflows/changelog.ts, src/mastra/workflows/content-review-workflow.ts, src/mastra/workflows/financial-report-workflow.ts, src/mastra/workflows/repo-ingestion-workflow.ts
Changelog and telephone-game workflows removed Slack tool usage; content-review-workflow conditionally includes Target Audience in prompts; repo-ingestion-workflow strengthened type guards for scan results and file content validation; financial-report-workflow minor whitespace edit.
Evaluation Configuration
src/mastra/evals/agent-experiments.ts
Replaced console.log with log.info for tracing; removed scorer imports and disabled scoring across all experiments by setting scorers to empty arrays.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Agent configuration changes across 5 files require verification that tool removals and replacements don't break dependent workflows or cause runtime failures
  • Type guard refinements in repo-ingestion-workflow.ts need careful review to ensure error handling correctly propagates and edge cases (null, undefined, empty strings) are properly handled
  • Conditional prompt logic in content-review-workflow.ts should be validated to ensure trimmed audience checks function as intended
  • Scorer and logging migrations (agent-experiments.ts) need confirmation that disabling scorers and switching to log.info doesn't break telemetry or test infrastructure

Possibly related PRs

Poem

🐰 With tools reshaped and flags now true,
We scrape the web with agents new!
Type guards stand tall, logs now bright,
Workflows dance through day and night—
A tidy warren, tests delight!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: enhance agent workflows and configurations' accurately summarizes the main changes across multiple agent files and workflows in the pull request.
Description check ✅ Passed The description comprehensively covers the changes in the PR, including OTEL configuration updates, agent refactoring, tool management, logging improvements, error handling, and performance optimizations.
✨ 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

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 introduces a series of enhancements aimed at improving the robustness, performance, and maintainability of various agent-based workflows. It refines OpenTelemetry instrumentation to prevent conflicts, updates a core agent with a more advanced model and tool, and strengthens error handling in critical data ingestion processes. Additionally, it streamlines experiment configurations and includes general code cleanups to ensure a more consistent and reliable codebase.

Highlights

  • OTEL Configuration Refinement: The OpenTelemetry setup in instrumentation.ts has been updated to prevent double instrumentation. Vercel's registerOTel is now conditionally enabled based on the VERCEL_OTEL_ENABLED environment flag, ensuring Mastra's configuration remains the single source of truth unless explicitly overridden.
  • Dane Agent Enhancement: The dane agent has been refactored to utilize the new webScraperTool in place of googleSearch. Its underlying model has also been upgraded to 'google/gemini-3-flash-preview', and the thinkingConfig was adjusted to thinkingLevel: 'high' for improved reasoning.
  • Agent Tool Cleanup: Unused tools arrays in editorAgent.ts and noteTakerAgent.ts have been commented out, improving code clarity and indicating potential future removal of these configurations.
  • Experiment Management Streamlining: The agent-experiments.ts file was renamed to agent-evals.ts to better reflect its purpose. All experiment logging now uses log.info for consistent output, and specific scorers have been removed from experiment configurations.
  • Improved Error Handling in Repo Ingestion: Error handling in repo-ingestion-workflow.ts has been significantly improved for GitHub repository scanning and file fetching. The type guard for scan results is more robust, and error messages are now clearer, providing better insights into failures.
  • Robust Target Audience Validation: The content-review-workflow.ts now includes more robust checks for the targetAudience parameter, ensuring that undefined, null, or empty string values are handled gracefully when constructing prompts.
  • Weather Agent Performance Optimization: The weatherAgent's outputProcessors limit has been adjusted from 1048576 to 128000. This change aims to optimize performance by reducing the maximum token limit for output processing.
  • Codebase Consistency: Minor whitespace cleanups were performed across changelog.ts, financial-report-workflow.ts, and telephone-game.ts to maintain consistent code formatting throughout the project.
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.

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 there - I've reviewed your changes - here's some feedback:

  • In repo-ingestion-workflow.ts, the updated check now treats an empty string content as a failure; if zero‑byte or intentionally empty files are valid, consider distinguishing null/undefined from '' instead of rejecting all empty content.
  • Several agents/workflows now have tools or toolsets.slack commented out (e.g., editorAgent, noteTakerAgent, changelog stepA2, telephone-game); it may be clearer and less error‑prone to keep these as explicit empty arrays/objects with a brief comment rather than commented configuration.
  • In noteTakerAgent, the instructions constant was renamed to instructions1 without an apparent need; consider reverting to a clearer name like instructions or noteTakerInstructions to avoid confusion about multiple instruction variants.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `repo-ingestion-workflow.ts`, the updated check now treats an empty string `content` as a failure; if zero‑byte or intentionally empty files are valid, consider distinguishing `null/undefined` from `''` instead of rejecting all empty content.
- Several agents/workflows now have `tools` or `toolsets.slack` commented out (e.g., `editorAgent`, `noteTakerAgent`, `changelog` stepA2, `telephone-game`); it may be clearer and less error‑prone to keep these as explicit empty arrays/objects with a brief comment rather than commented configuration.
- In `noteTakerAgent`, the `instructions` constant was renamed to `instructions1` without an apparent need; consider reverting to a clearer name like `instructions` or `noteTakerInstructions` to avoid confusion about multiple instruction variants.

## Individual Comments

### Comment 1
<location> `src/mastra/agents/dane.ts:202` </location>
<code_context>
     }
   },
-  model: googleAIFlashLite,
+  model: 'google/gemini-3-flash-preview',
   memory: pgMemory,
   tools: {
</code_context>

<issue_to_address>
**suggestion:** Model string and the `google.chat(...)` configuration point at different model versions.

The agent now uses `'google/gemini-3-flash-preview'`, but `defaultOpts` still calls `google.chat('gemini-2.5-flash-preview-09-2025')`. This mismatch can cause confusion or inconsistent behavior (e.g., metrics referring to a different model). Consider keeping these values in sync or deriving both from a shared constant.

Suggested implementation:

```typescript
            includeThoughts: true,
            thinkingLevel: 'high',
          },
          responseModalities: ['TEXT'],
        } satisfies GoogleGenerativeAIProviderOptions,
      }
    }
  },
  model: `google/${GOOGLE_FLASH_MODEL_ID}`,
  memory: pgMemory,
  tools: {

```

```typescript
      provider: google.chat(GOOGLE_FLASH_MODEL_ID),

```

```typescript
const GOOGLE_FLASH_MODEL_ID = 'gemini-3-flash-preview';

export const dane =

```
</issue_to_address>

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.

}
},
model: googleAIFlashLite,
model: 'google/gemini-3-flash-preview',
Copy link

Choose a reason for hiding this comment

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

suggestion: Model string and the google.chat(...) configuration point at different model versions.

The agent now uses 'google/gemini-3-flash-preview', but defaultOpts still calls google.chat('gemini-2.5-flash-preview-09-2025'). This mismatch can cause confusion or inconsistent behavior (e.g., metrics referring to a different model). Consider keeping these values in sync or deriving both from a shared constant.

Suggested implementation:

            includeThoughts: true,
            thinkingLevel: 'high',
          },
          responseModalities: ['TEXT'],
        } satisfies GoogleGenerativeAIProviderOptions,
      }
    }
  },
  model: `google/${GOOGLE_FLASH_MODEL_ID}`,
  memory: pgMemory,
  tools: {
      provider: google.chat(GOOGLE_FLASH_MODEL_ID),
const GOOGLE_FLASH_MODEL_ID = 'gemini-3-flash-preview';

export const dane =

@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
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 introduces a series of enhancements and refactorings across various agent workflows and configurations. The changes include preventing double OTEL instrumentation, updating agent models and tools, improving logging by switching to a structured logger, and hardening error handling in workflows. My review focuses on improving code clarity, maintainability, and consistency. I've suggested simplifying some verbose conditional checks, renaming a variable for better descriptiveness, and fixing an indentation issue.

Comment on lines +5 to +12
const instructions1 = `
You are an AI note assistant tasked with providing concise, structured summaries of their content... // omitted for brevity
`;

export const noteTakerAgent = new Agent({
id: "noteTakerAgent",
name: "Note Taker Agent",
instructions: instructions,
instructions: instructions1,
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 variable instructions has been renamed to instructions1. This name is not descriptive and could be confusing for future maintenance. It would be better to use a name that clearly indicates its purpose, such as noteTakerInstructions, or simply instructions if it's the only one in the file.

Suggested change
const instructions1 = `
You are an AI note assistant tasked with providing concise, structured summaries of their content... // omitted for brevity
`;
export const noteTakerAgent = new Agent({
id: "noteTakerAgent",
name: "Note Taker Agent",
instructions: instructions,
instructions: instructions1,
const noteTakerInstructions = `
You are an AI note assistant tasked with providing concise, structured summaries of their content... // omitted for brevity
`;
export const noteTakerAgent = new Agent({
id: "noteTakerAgent",
name: "Note Taker Agent",
instructions: noteTakerInstructions,

Comment on lines +121 to +122
log.info('Learning Extraction Experiment Results:', { results: JSON.stringify(results, null, 2) })
return results
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's an indentation issue here. The log.info and return statements are over-indented, which affects code readability and consistency with the rest of the file.

Suggested change
log.info('Learning Extraction Experiment Results:', { results: JSON.stringify(results, null, 2) })
return results
log.info('Learning Extraction Experiment Results:', { results: JSON.stringify(results, null, 2) })
return results


const prompt = `Research the topic "${inputData.topic}" for a ${inputData.contentType}
${inputData.targetAudience ? `targeting ${inputData.targetAudience}` : ''}.
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `targeting ${inputData.targetAudience}` : ''}.
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 condition to check for targetAudience is quite verbose. It can be simplified for better readability. Using optional chaining (?.) with trim() provides a more concise and idiomatic way to check for a non-empty string, as it correctly handles undefined and null values.

Suggested change
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `targeting ${inputData.targetAudience}` : ''}.
${inputData.targetAudience?.trim() ? `targeting ${inputData.targetAudience}` : ''}.

Research Summary: ${inputData.research.summary}
Key Points to Cover: ${inputData.research.keyPoints.join(', ')}
${inputData.targetAudience ? `Target Audience: ${inputData.targetAudience}` : ''}
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `Target Audience: ${inputData.targetAudience}` : ''}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This condition to check for targetAudience is verbose and duplicated. It can be simplified for better readability and consistency. Using optional chaining (?.) with trim() is a more concise way to achieve the same result.

Suggested change
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `Target Audience: ${inputData.targetAudience}` : ''}
${inputData.targetAudience?.trim() ? `Target Audience: ${inputData.targetAudience}` : ''}


const successResult = result as { success: boolean; content?: string; encoding?: string; sha?: string; size?: number; error?: string };
if (!successResult.success || !successResult.content) {
if (!successResult.success || successResult.content === null || successResult.content === undefined || successResult.content === '') {
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 condition to check for successResult.content is more verbose than necessary. The !successResult.content check is sufficient as it correctly handles null, undefined, and empty strings (''), which are all falsy in TypeScript. This makes the code more concise and idiomatic.

Suggested change
if (!successResult.success || successResult.content === null || successResult.content === undefined || successResult.content === '') {
if (!successResult.success || !successResult.content) {

@ssdeanx ssdeanx merged commit 65c10fe into main Dec 17, 2025
61 of 65 checks passed
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: 4

Caution

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

⚠️ Outside diff range comments (4)
src/mastra/workflows/financial-report-workflow.ts (2)

144-144: Remove extra whitespace in parameter list.

Line 144 has inconsistent spacing between parameters.

-  execute: async ({ inputData,  writer }) => {
+  execute: async ({ inputData, writer }) => {

249-249: Add missing semicolons for consistency.

Lines 249, 387, 449, and 553 are missing semicolons after }) in writer.custom() calls, while other similar calls elsewhere include them. Ensure consistency across all writer.custom() invocations.

-      })
+      });

Apply this pattern to all affected lines (249, 387, 449, 553).

Also applies to: 387-387, 449-449, 553-553

src/mastra/workflows/changelog.ts (1)

309-319: Critical: Prompt references disabled Slack tool, causing inconsistent behavior.

The prompt on line 309 instructs the agent to "send this to this slack channel" using slack_post_message, but the Slack tool is commented out on line 317. This creates a mismatch where the agent is instructed to perform an action it cannot execute, potentially leading to errors or confusion.

Apply this diff to remove the Slack reference from the prompt:

-            Finally send this to this slack channel: "${channelId}" with the tool slack_post_message

Alternatively, if Slack posting is needed, re-enable the tool:

-//          slack: tools,
+          slack: tools,
src/mastra/agents/dane.ts (1)

3-3: Minor: Remove unused googleSearch import.

The googleSearch tool is imported on line 3 but no longer used after being replaced by webScraperTool in the tools object.

Apply this diff to remove the unused import:

-import { browserTool, googleSearch } from '../tools/browser-tool'
+import { browserTool } from '../tools/browser-tool'
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fa1f47 and 339ed9f.

📒 Files selected for processing (11)
  • instrumentation.ts (1 hunks)
  • src/mastra/agents/dane.ts (2 hunks)
  • src/mastra/agents/editorAgent.ts (1 hunks)
  • src/mastra/agents/noteTakerAgent.ts (1 hunks)
  • src/mastra/agents/weather-agent.ts (1 hunks)
  • src/mastra/evals/agent-experiments.ts (7 hunks)
  • src/mastra/workflows/changelog.ts (4 hunks)
  • src/mastra/workflows/content-review-workflow.ts (2 hunks)
  • src/mastra/workflows/financial-report-workflow.ts (1 hunks)
  • src/mastra/workflows/repo-ingestion-workflow.ts (2 hunks)
  • src/mastra/workflows/telephone-game.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (18)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

**/*.{js,jsx,ts,tsx}: Use next/dynamic for dynamic imports to load components only when needed, improving initial load time.
Use next/image component for automatic image optimization, including lazy loading and responsive images.
Use React.memo to prevent unnecessary re-renders of components.
Use the <Link prefetch> tag to prefetch pages that are likely to be visited.
Use getServerSideProps, getStaticProps, or server components for fetching data on the server-side.
Use SWR or React Query for client-side data fetching and caching.
Use CSS Modules, Styled Components, or Tailwind CSS for component-level styling. Prefer Tailwind CSS for rapid development.
Use React Context, Zustand, Jotai, or Recoil for managing global state. Avoid Redux unless necessary.
Use react-hook-form for managing forms and validation.
Only fetch the data that is needed by the component to avoid over-fetching.
Avoid long-running synchronous operations in the main thread to prevent blocking.
Always use setState or hooks to update state instead of mutating state directly.
Include a complete dependency array in useEffect hooks to prevent unexpected behavior.
Avoid writing server-side code in client components to prevent exposing secrets or causing unexpected behavior.
Use try...catch blocks for handling errors in asynchronous operations.
Implement error boundary components using getDerivedStateFromError or componentDidCatch lifecycle methods.
Sanitize user input to prevent Cross-Site Scripting (XSS) attacks. Be especially careful when rendering HTML directly from user input.
Store authentication tokens in HTTP-only cookies or local storage securely.
Implement role-based access control to restrict access to sensitive resources.
Clean up event listeners and timers in useEffect hooks to avoid memory leaks.
Only update state when necessary to reduce the number of re-renders and improve performance.
Use immutable data structures and avoid mutating data directly to prevent unexpected...

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

Use parameterized queries or an ORM to prevent SQL injection attacks.

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{ts,tsx,js,jsx,py,java,cs,rb,go,rs,cpp,c,h,hpp,swift,kotlin,php,scala,clj,groovy,lua,sh,bash}

📄 CodeRabbit inference engine (.github/instructions/self-explanatory-code-commenting.instructions.md)

**/*.{ts,tsx,js,jsx,py,java,cs,rb,go,rs,cpp,c,h,hpp,swift,kotlin,php,scala,clj,groovy,lua,sh,bash}: Write code that speaks for itself. Comment only when necessary to explain WHY, not WHAT. Avoid obvious comments that state what the code literally does.
Avoid redundant comments that simply repeat what the code is doing
Keep comments accurate and up-to-date with code changes. Remove or update outdated comments that no longer match the implementation.
Write comments for complex business logic that explain the WHY behind specific calculations or business rules
Document non-obvious algorithms with comments explaining the algorithm choice and its reasoning
Add comments explaining what regex patterns match, especially for complex patterns
Document API constraints, rate limits, gotchas, and external dependencies with explanatory comments
Avoid commenting out dead code. Use version control instead of maintaining commented code blocks.
Do not maintain code change history or modification logs as comments. Rely on git history and commit messages instead.
Avoid decorative divider comments (e.g., lines of equals signs or asterisks) for section separation
Ensure comments are placed appropriately above or adjacent to the code they describe
Write comments using proper grammar, spelling, and professional language
Prefer self-documenting code with clear variable/function names over adding comments to explain unclear code

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/instructions/self-explanatory-code-commenting.instructions.md)

**/*.{ts,tsx,js,jsx}: Document public APIs with TSDoc/JSDoc comments including parameter descriptions, return types, examples, and thrown exceptions
Add TSDoc comments to configuration constants and environment variables explaining their source, reasoning, or constraints
Use TSDoc annotation tags (TODO, FIXME, HACK, NOTE, WARNING, PERF, SECURITY, BUG, REFACTOR, DEPRECATED) to mark special comments
Include file headers with @fileoverview, @author, @copyright, and @license tags to document file purpose and ownership
Document function parameters with @param tags, return values with @returns tags, and exceptions with @throws tags in TSDoc comments
Use @see tags in TSDoc comments to reference related functions, methods, or documentation
Include @example tags in public API documentation with code examples showing typical usage

Use ESLint configuration from eslint.config.cjs with TypeScript rules and Prettier integration

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/self-explanatory-code-commenting.instructions.md)

**/*.{ts,tsx}: Document interface and type definitions with TSDoc comments explaining their purpose and usage context
Document interface properties with /** */ comments explaining each field's purpose and constraints
Document generic type parameters with @template tags explaining what each type parameter represents
Use type guards with comments explaining the runtime validation logic being performed
Document advanced/complex TypeScript types with explanatory comments about their purpose and use cases

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
src/mastra/**/*

📄 CodeRabbit inference engine (src/AGENTS.md)

mastra modules can import from utils, but must not import from app or cli (except types)

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
src/mastra/workflows/**/*.ts

📄 CodeRabbit inference engine (src/mastra/AGENTS.md)

Add workflows under src/mastra/workflows to orchestrate multi-step flows

src/mastra/workflows/**/*.ts: Define workflows using Mastra DSL patterns (e.g., .then(), .branch(), .parallel(), .foreach(), .dowhile()) and demonstrate the appropriate pattern for your use case
Use tools and agents as building blocks in workflows; prefer composition over duplication
Use sequential pattern (.then()) for workflows with dependent steps executed in order (e.g., weatherWorkflow, stockAnalysisWorkflow, changelogWorkflow)
Use parallel pattern (.parallel()) for workflows that fetch or process multiple independent data sources concurrently (e.g., financialReportWorkflow)
Use conditional branch pattern (.branch()) for workflows that need to route to different processing paths based on input conditions (e.g., documentProcessingWorkflow for PDF handling)
Use loop pattern (.dowhile()) for workflows that need iterative refinement until a condition is met (e.g., contentReviewWorkflow)
Use iteration pattern (.foreach()) for workflows that process multiple items concurrently (e.g., researchSynthesisWorkflow for topic research)
Use human-in-the-loop pattern with suspend() and resume() for workflows requiring human approval or input (e.g., learningExtractionWorkflow)
Pipe agent response streams to the step writer using response.fullStream.pipeTo(writer) to enable text chunk streaming in workflow steps
Use inputSchema and outputSchema with Zod for type-safe step definitions in workflows
Call .commit() on workflow definitions after constructing them to finalize and register the workflow
Add tests and e2e test harnesses to validate workflow integrations

Define workflows using the Mastra DSL for multi-step orchestration

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
src/mastra/{tools,workflows}/**/*.ts

📄 CodeRabbit inference engine (src/mastra/AGENTS.md)

Use RequestContext (per-request) or agent-specific runtime context types (e.g. EditorRuntimeContext) to enforce access control in tools and workflows

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

For Next.js projects, always utilize the next-devtools-mcp server for all Next.js related queries

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{js,ts,jsx,tsx,java,py,cs,go,rb,php,swift,kt,scala,rs,cpp,c,h}

📄 CodeRabbit inference engine (.github/instructions/code-review-generic.instructions.md)

**/*.{js,ts,jsx,tsx,java,py,cs,go,rb,php,swift,kt,scala,rs,cpp,c,h}: Use descriptive and meaningful names for variables, functions, and classes
Apply Single Responsibility Principle: each function/class does one thing well
Follow DRY (Don't Repeat Yourself): eliminate code duplication
Keep functions small and focused (ideally < 20-30 lines)
Avoid deeply nested code (max 3-4 levels)
Avoid magic numbers and strings; use named constants instead
Code should be self-documenting; use comments only when necessary
Implement proper error handling at appropriate levels with meaningful error messages
Avoid silent failures or ignored exceptions; fail fast and validate inputs early
Use appropriate error types/exceptions with meaningful context
Validate and sanitize all user inputs
Use parameterized queries for database access; never use string concatenation for SQL queries
Implement proper authentication checks before accessing resources
Verify user has permission to perform actions; implement proper authorization
Use established cryptographic libraries; never roll your own crypto implementation
Avoid N+1 query problems; use proper indexing and eager loading for database queries
Use appropriate algorithms with suitable time/space complexity for the use case
Utilize caching for expensive or repeated operations
Ensure proper cleanup of connections, files, and streams to prevent resource leaks
Implement pagination for large result sets
Load data only when needed (lazy loading pattern)
Document all public APIs with purpose, parameters, and return values
Add explanatory comments for non-obvious logic
No commented-out code or unresolved TODO comments without associated tickets should remain in commits
Ensure code follows consistent style and conventions with the rest of the codebase

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{js,ts,jsx,tsx,java,py,cs,go,rb,php,swift,kt,scala,rs,cpp,c,h,json,yaml,yml,env,config}

📄 CodeRabbit inference engine (.github/instructions/code-review-generic.instructions.md)

Never include passwords, API keys, tokens, or PII in code or logs

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{ts,tsx,java,cs,go,php,swift,kt,scala}

📄 CodeRabbit inference engine (.github/instructions/code-review-generic.instructions.md)

Prefer small, focused interfaces (Interface Segregation Principle)

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.{js,mjs,cjs,ts,tsx,jsx,py,java,cs,go,rb,php,rs,cpp,c,h,hpp}

📄 CodeRabbit inference engine (.github/instructions/update-docs-on-code-change.instructions.md)

Use automated documentation generators for code documentation - JSDoc/TSDoc for JavaScript/TypeScript, Sphinx/pdoc for Python, Javadoc for Java, xmldoc for C#, godoc for Go, rustdoc for Rust

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
src/mastra/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use maskSensitiveMessageData() helper from src/mastra/config/pg-storage.ts to mask secrets in logs

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
**/*.{ts,tsx,js,jsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier for code formatting with ES5 trailing commas, 4-space tabs, and single quotes

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with ES2022 target and Next.js path aliases configured in tsconfig.json

Files:

  • src/mastra/workflows/content-review-workflow.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/workflows/repo-ingestion-workflow.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/workflows/financial-report-workflow.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/workflows/telephone-game.ts
  • src/mastra/workflows/changelog.ts
  • src/mastra/evals/agent-experiments.ts
  • instrumentation.ts
src/mastra/agents/*.ts

📄 CodeRabbit inference engine (src/mastra/agents/AGENTS.md)

src/mastra/agents/*.ts: Agent file naming convention: Create agent files using kebab-case with .ts extension in /src/mastra/agents/ directory (e.g., your-agent-name.ts)
Each agent must follow the pattern: export agent as const yourAgent = new Agent({ id: 'your-agent-id', name: 'Your Agent Name', description: '...' })

Files:

  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/agents/editorAgent.ts
src/mastra/agents/**/*.ts

📄 CodeRabbit inference engine (src/mastra/AGENTS.md)

Add agents under src/mastra/agents that wire tools together into higher-level behaviors

Implement agents by composing tools into specialized behaviors using the Mastra agents DSL

Files:

  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/agents/noteTakerAgent.ts
  • src/mastra/agents/editorAgent.ts
🧬 Code graph analysis (3)
src/mastra/agents/dane.ts (1)
src/mastra/config/pg-storage.ts (1)
  • pgMemory (87-150)
src/mastra/agents/noteTakerAgent.ts (1)
src/mastra/config/pg-storage.ts (1)
  • pgMemory (87-150)
src/mastra/evals/agent-experiments.ts (1)
src/mastra/config/logger.ts (1)
  • log (14-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: CodeQL analysis (javascript-typescript)
  • GitHub Check: Agent
  • GitHub Check: Sourcery review
  • GitHub Check: Greptile Review
  • GitHub Check: Codacy Security Scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (13)
src/mastra/workflows/financial-report-workflow.ts (1)

1-1044: Overall workflow structure is well-implemented.

The financial report workflow demonstrates solid use of the Mastra DSL with proper patterns:

  • Sequential .then() chaining for dependent steps
  • Parallel pattern (.parallel()) for concurrent data fetching
  • Comprehensive Zod schemas for type-safe validation
  • OTEL tracing at appropriate boundaries
  • Robust error handling and progress tracking via writer stream
  • Proper use of commit() to finalize the workflow

The workflow correctly orchestrates multi-step financial data aggregation with streaming progress updates to callers via stream.textStream.pipeTo(writer) at lines 741 and 882.

Please verify that the semicolon inconsistency is not flagged by your configured ESLint rules, and confirm that Prettier formatting is applied consistently across the codebase.

src/mastra/workflows/repo-ingestion-workflow.ts (2)

105-106: Improved error extraction with safe fallback.

The error message extraction correctly uses the type guard to safely access scanResultRaw.error when available, with a clear fallback. This provides better error reporting as intended by the PR objectives.


233-233: Verify that empty files should be treated as errors.

The validation now explicitly rejects empty string content. While this catches silent fetch failures, it may also reject legitimate empty files (e.g., empty JSON files, placeholder files, or files that are legitimately empty in the repository).

Verify that this aligns with expected behavior for your use case.

src/mastra/agents/weather-agent.ts (1)

64-64: LGTM: Token limit reduction aligns with performance optimization goals.

The reduction from 1,048,576 to 128,000 tokens is a significant tightening of the output budget, which should improve response times and resource usage for the weather agent.

src/mastra/workflows/telephone-game.ts (1)

13-13: LGTM: Neutral cleanup of empty tools configuration.

Commenting out the empty tools array is consistent with the broader pattern in this PR of removing explicit empty tool configurations from agent definitions.

src/mastra/workflows/changelog.ts (1)

222-222: LGTM: Whitespace cleanup improves consistency.

The whitespace adjustments improve code formatting without affecting functionality.

Also applies to: 333-333, 350-350

src/mastra/workflows/content-review-workflow.ts (1)

129-129: LGTM: Enhanced target audience validation prevents empty/whitespace values.

The updated validation properly handles undefined, null, and whitespace-only strings, ensuring the "Target Audience" line only appears when there's meaningful content. This is more robust than the previous truthy check.

Also applies to: 264-264

instrumentation.ts (1)

3-27: LGTM: Well-documented conditional OTEL registration prevents double instrumentation.

The feature flag approach with clear documentation effectively prevents conflicting OTEL SDK instances. The strict string equality check and aligned service name demonstrate careful consideration of the dual-configuration scenario.

src/mastra/evals/agent-experiments.ts (1)

12-12: LGTM: Structured logging improves observability.

Replacing console.log with the centralized logger provides better log management, filtering, and integration with monitoring tools. The empty scorer arrays appear to be an intentional simplification of the experiments.

Also applies to: 15-15, 31-31, 36-36, 52-52

src/mastra/agents/editorAgent.ts (1)

123-123: LGTM: Consistent with PR-wide cleanup pattern.

Commenting out the empty tools array aligns with similar changes across multiple agent files, removing unnecessary explicit empty configurations.

src/mastra/agents/dane.ts (2)

202-202: No changes required—model string format is correct and supported.

Mastra's Agent class supports string-based model identifiers using the "provider/model" pattern, such as 'google/gemini-3-flash-preview'. The built-in model router string approach is recommended for simplicity over using AI SDK model provider objects. The model identifier gemini-3-flash-preview is a valid Google Gemini 3 Flash model available in the Gemini API.


195-195: No action required—configuration is correct for each model version.

The dane agent using Gemini 3 Flash (google/gemini-3-flash-preview) correctly uses thinkingLevel: 'high', while other agents using Gemini 2.5 Flash Lite (googleAIFlashLite) correctly use thinkingBudget: -1. The thinking_level parameter replaces thinking_budget for Gemini 3 models. You cannot use both thinking_level and the legacy thinking_budget parameter in the same request. Doing so will return a 400 error. Different model versions require their respective thinking parameters; this is not an inconsistency but proper API compliance.

Likely an incorrect or invalid review comment.

src/mastra/agents/noteTakerAgent.ts (1)

3-3: Import change aligns with tools removal.

The removal of pgQueryTool from the import is consistent with the commented-out tools configuration on line 14, which aligns with the PR objective of removing unused tools.

Comment on lines +5 to 7
const instructions1 = `
You are an AI note assistant tasked with providing concise, structured summaries of their content... // omitted for brevity
`;
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Revert to descriptive constant name.

The constant name instructions1 includes a numeric suffix that doesn't add semantic value. Per coding guidelines requiring descriptive names, consider reverting to the original name instructions.

Apply this diff:

-const instructions1 = `
+const instructions = `
 You are an AI note assistant tasked with providing concise, structured summaries of their content... // omitted for brevity
 `;

And update line 12:

-  instructions: instructions1,
+  instructions: instructions,

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/mastra/agents/noteTakerAgent.ts around lines 5 to 7 (and update at line
12), rename the constant instructions1 back to a descriptive name instructions:
change the declaration identifier from instructions1 to instructions and update
any reference on line 12 to use instructions instead of instructions1; ensure
you only rename the identifier (no other content changes) so all usages remain
consistent.

instructions: instructions1,
memory: pgMemory,
tools: [pgQueryTool],
// tools: [],
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Remove commented-out code.

Per coding guidelines: "Avoid commenting out dead code. Use version control instead of maintaining commented code blocks." The commented tools array should be removed entirely rather than left as a comment.

Apply this diff:

   memory: pgMemory,
-//  tools: [],
   model: "google/gemini-2.5-flash-lite-preview-09-2025",
📝 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
// tools: [],
memory: pgMemory,
model: "google/gemini-2.5-flash-lite-preview-09-2025",
🤖 Prompt for AI Agents
In src/mastra/agents/noteTakerAgent.ts around line 14, remove the commented-out
dead code "//  tools: []," entirely (do not replace it with another comment);
update any trailing commas/formatting if needed and run the formatter/linter to
ensure file remains syntactically correct after deletion.

Comment on lines 758 to 762
}


const result: z.infer<typeof analysisResultSchema> = {
stocks: inputData.stocks,
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 unnecessary blank line.

Line 760 introduces an extra blank line before the result variable declaration. This is minor formatting but breaks consistency with other step definitions.

       }
 
-
       const result: z.infer<typeof analysisResultSchema> = {
📝 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
}
const result: z.infer<typeof analysisResultSchema> = {
stocks: inputData.stocks,
}
const result: z.infer<typeof analysisResultSchema> = {
stocks: inputData.stocks,
🤖 Prompt for AI Agents
In src/mastra/workflows/financial-report-workflow.ts around lines 758 to 762,
there is an extra blank line between the closing brace of the previous block and
the `const result` declaration; remove that blank line so the `const result:
z.infer<typeof analysisResultSchema> = {` sits immediately after the preceding
`}` to match the file's step-definition formatting, then run the project's
formatter (prettier/ESLint) to ensure consistency.

Comment on lines +101 to +102
const isScanSuccess = (r: unknown): r is { success: boolean; tree?: GitTreeItem[]; error?: string } =>
r !== null && typeof r === 'object' && 'success' in r;
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Strengthen the type guard with runtime validation.

The type guard narrows unknown to an object with a success: boolean property, but the runtime check only verifies that the success property exists—not that it's actually a boolean. If the API returns an unexpected shape like { success: "false" }, the type guard would succeed but subsequent boolean checks could behave unexpectedly.

Apply this diff to add runtime type verification:

-const isScanSuccess = (r: unknown): r is { success: boolean; tree?: GitTreeItem[]; error?: string } =>
-  r !== null && typeof r === 'object' && 'success' in r;
+const isScanSuccess = (r: unknown): r is { success: boolean; tree?: GitTreeItem[]; error?: string } =>
+  r !== null && typeof r === 'object' && 'success' in r && typeof (r as { success: unknown }).success === 'boolean';
🤖 Prompt for AI Agents
In src/mastra/workflows/repo-ingestion-workflow.ts around lines 101 to 102, the
type guard currently only checks for the existence of a 'success' property but
not its runtime type; update the predicate to validate that r is a non-null
object and that r.success is a boolean (and if present, r.tree is an array and
r.error is a string) so the guard only narrows when shapes and primitive types
match; implement the runtime checks inside the arrow function and return true
only when those validations pass, otherwise return false.

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 pull request enhances agent workflows and configurations with focus on improving observability, refactoring agent tools, and cleaning up code quality. The changes span across instrumentation setup, agent configurations, workflow validation, and experimental evaluations.

Key Changes:

  • Added conditional OTEL registration to prevent double instrumentation conflicts between Vercel and Mastra
  • Refactored Dane agent with new webScraperTool and updated (invalid) model identifier
  • Migrated from console.log to structured logging across experiment files
  • Strengthened type safety and error handling in workflow validation logic

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
instrumentation.ts Added conditional OTEL initialization to prevent conflicts with Mastra's configuration
src/mastra/agents/dane.ts Updated model to 'gemini-3-flash-preview', replaced googleSearch with webScraperTool, changed thinking config
src/mastra/agents/editorAgent.ts Commented out empty tools array
src/mastra/agents/noteTakerAgent.ts Renamed instructions variable to 'instructions1', commented out tools, removed unused import
src/mastra/agents/weather-agent.ts Reduced token limiter from 1048576 to 128000, removed unused scorer import
src/mastra/workflows/repo-ingestion-workflow.ts Improved type guard from 'any' to 'unknown', enhanced error message handling, added explicit empty string validation
src/mastra/workflows/content-review-workflow.ts Added comprehensive null/undefined/empty checks for targetAudience field
src/mastra/workflows/changelog.ts Commented out slack tools, cleaned up whitespace
src/mastra/workflows/telephone-game.ts Commented out empty tools array
src/mastra/workflows/financial-report-workflow.ts Removed trailing whitespace
src/mastra/evals/agent-experiments.ts Migrated from console.log to structured logger, removed all scorer implementations, fixed indentation issue
Comments suppressed due to low confidence (2)

src/mastra/evals/agent-experiments.ts:52

  • Inconsistent logging format. Line 36 uses 'Running Copywriter Experiment...' (with ellipsis as a string literal) while line 15 uses structured logging with an event object. Line 52 also mixes the pattern with 'Copywriter Experiment Results:' using a colon. Consider standardizing to the structured logging approach used in line 15 for consistency.
    src/mastra/evals/agent-experiments.ts:122
  • Inconsistent indentation detected. Lines 121-122 are indented with extra spaces compared to the rest of the function. This should match the indentation of line 120 above.

execaTool,
browserTool,
googleSearch,
webScraperTool,
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The instructions documentation still references 'googleSearch' tool (lines 172-174), but the actual tools configuration now uses 'webScraperTool' instead of 'googleSearch'. This inconsistency between documentation and implementation could confuse the agent's behavior and users reviewing the code.

Copilot uses AI. Check for mistakes.
tools: [pgQueryTool],
// tools: [],
model: "google/gemini-2.5-flash-lite-preview-09-2025",
voice: new GoogleVoice(), // Add OpenAI voice provider with default configuration
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The comment states "Add OpenAI voice provider with default configuration" but the code actually uses GoogleVoice(), not an OpenAI voice provider. This misleading comment should be corrected to accurately reflect the implementation.

Suggested change
voice: new GoogleVoice(), // Add OpenAI voice provider with default configuration
voice: new GoogleVoice(), // Add Google voice provider with default configuration

Copilot uses AI. Check for mistakes.
const result = await agent.generate(prompt, {
toolsets: {
slack: tools,
// slack: tools,
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Commented-out code should be removed rather than left in the codebase. The slack toolset is commented out but no explanation is provided. If this is intentional, add a comment explaining why, or remove it entirely to avoid confusion.

Suggested change
// slack: tools,
slack: tools,

Copilot uses AI. Check for mistakes.

const prompt = `Research the topic "${inputData.topic}" for a ${inputData.contentType}
${inputData.targetAudience ? `targeting ${inputData.targetAudience}` : ''}.
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `targeting ${inputData.targetAudience}` : ''}.
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The validation check for targetAudience is overly complex and verbose. The condition checks for undefined, null, AND empty string after trimming, which could be simplified using optional chaining and a more concise approach. Consider: inputData.targetAudience?.trim() ? \targeting ${inputData.targetAudience}` : ''`

Suggested change
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `targeting ${inputData.targetAudience}` : ''}.
${inputData.targetAudience?.trim() ? `targeting ${inputData.targetAudience}` : ''}.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +12
const instructions1 = `
You are an AI note assistant tasked with providing concise, structured summaries of their content... // omitted for brevity
`;

export const noteTakerAgent = new Agent({
id: "noteTakerAgent",
name: "Note Taker Agent",
instructions: instructions,
instructions: instructions1,
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The variable name was changed from 'instructions' to 'instructions1', which is less descriptive and appears arbitrary. This naming doesn't follow clear conventions and makes the code less maintainable. Consider keeping the original name 'instructions' or using a more meaningful name like 'noteTakerInstructions'.

Copilot uses AI. Check for mistakes.
instructions: instructions1,
memory: pgMemory,
tools: [pgQueryTool],
// tools: [],
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Commented-out code should be removed rather than left in the codebase. If tools need to be temporarily disabled, consider using a configuration flag or documenting why they're disabled. Empty arrays or comments like this create maintenance debt.

Suggested change
// tools: [],

Copilot uses AI. Check for mistakes.
},
memory: pgMemory,
tools: [],
// tools: [],
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Commented-out code should be removed rather than left in the codebase. If tools need to be temporarily disabled, consider using a configuration flag or documenting why they're disabled. Empty arrays or comments like this create maintenance debt.

Suggested change
// tools: [],

Copilot uses AI. Check for mistakes.
model: googleAIFlashLite,
memory: pgMemory,
tools: [],
// tools: [],
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Commented-out code should be removed rather than left in the codebase. If tools need to be temporarily disabled, consider using a configuration flag or documenting why they're disabled. Empty arrays or comments like this create maintenance debt.

Suggested change
// tools: [],

Copilot uses AI. Check for mistakes.
Research Summary: ${inputData.research.summary}
Key Points to Cover: ${inputData.research.keyPoints.join(', ')}
${inputData.targetAudience ? `Target Audience: ${inputData.targetAudience}` : ''}
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `Target Audience: ${inputData.targetAudience}` : ''}
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The validation check for targetAudience is overly complex and verbose. The condition checks for undefined, null, AND empty string after trimming, which could be simplified using optional chaining and a more concise approach. Consider: inputData.targetAudience?.trim() ? \Target Audience: ${inputData.targetAudience}` : ''`

Suggested change
${inputData.targetAudience !== undefined && inputData.targetAudience !== null && inputData.targetAudience.trim().length > 0 ? `Target Audience: ${inputData.targetAudience}` : ''}
${inputData.targetAudience?.trim() ? `Target Audience: ${inputData.targetAudience}` : ''}

Copilot uses AI. Check for mistakes.

const successResult = result as { success: boolean; content?: string; encoding?: string; sha?: string; size?: number; error?: string };
if (!successResult.success || !successResult.content) {
if (!successResult.success || successResult.content === null || successResult.content === undefined || successResult.content === '') {
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The empty string check in this condition is redundant and could lead to unexpected behavior. An empty string is falsy, so if content is an empty string and the file actually exists but is empty, this will throw an error. Consider removing the empty string check or handling empty files differently if they're valid cases.

Suggested change
if (!successResult.success || successResult.content === null || successResult.content === undefined || successResult.content === '') {
if (!successResult.success || successResult.content == null) {

Copilot uses AI. Check for mistakes.
@greptile-apps
Copy link

greptile-apps bot commented Dec 17, 2025

Greptile Summary

  • Updates agent configurations across the Mastra system including model upgrades, tool refactoring, and improved error handling for better robustness
  • Enhances observability infrastructure by gating Vercel OTEL registration behind an environment flag and restructuring experiment logging
  • Improves workflow validation and performance optimizations including reduced token limits and more robust input validation

Important Files Changed

Filename Overview
src/mastra/evals/agent-experiments.ts Critical syntax error - incorrect indentation at lines 121-122 will cause runtime failure
src/mastra/agents/dane.ts Model upgrade and tool migration with inconsistent imports that may cause undefined references
instrumentation.ts Enhanced OTEL configuration to prevent double instrumentation conflicts
src/mastra/workflows/repo-ingestion-workflow.ts Improved type safety and error handling for GitHub API interactions

Confidence score: 2/5

  • This PR contains a critical syntax error in the agent experiments file that will definitely cause runtime failures
  • Score lowered due to syntax error in agent-experiments.ts (indentation issue) and inconsistent import/usage patterns in dane.ts that could cause undefined reference errors
  • Pay close attention to src/mastra/evals/agent-experiments.ts for the syntax error and src/mastra/agents/dane.ts for the import inconsistencies

Sequence Diagram

sequenceDiagram
    participant User
    participant ContentReviewWorkflow
    participant ResearchAgent
    participant CopywriterAgent  
    participant EditorAgent
    participant EvaluationAgent

    User->>ContentReviewWorkflow: "Start content creation (topic, contentType, targetAudience, qualityThreshold)"
    
    ContentReviewWorkflow->>ResearchAgent: "Research topic for content type"
    ResearchAgent-->>ContentReviewWorkflow: "Research summary, key points, sources, facts"
    
    ContentReviewWorkflow->>CopywriterAgent: "Draft content based on research"
    CopywriterAgent-->>ContentReviewWorkflow: "Initial content draft with word count"
    
    ContentReviewWorkflow->>EvaluationAgent: "Review and score content quality"
    EvaluationAgent-->>ContentReviewWorkflow: "Quality score and feedback"
    
    alt Score below quality threshold
        loop Until approved or max iterations reached
            ContentReviewWorkflow->>CopywriterAgent: "Refine content based on feedback"
            CopywriterAgent-->>ContentReviewWorkflow: "Improved content draft"
            
            ContentReviewWorkflow->>EvaluationAgent: "Re-evaluate refined content"
            EvaluationAgent-->>ContentReviewWorkflow: "Updated score and feedback"
        end
    end
    
    ContentReviewWorkflow->>ContentReviewWorkflow: "Finalize approved content"
    ContentReviewWorkflow-->>User: "Final content with metadata, score, and iteration history"
Loading

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.

Additional Comments (2)

  1. src/mastra/agents/dane.ts, line 3 (link)

    style: googleSearch is imported but no longer used in the tools configuration

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  2. src/mastra/agents/dane.ts, line 173-174 (link)

    logic: Instructions reference 'googleSearch' but the agent now uses 'webScraperTool' - this creates confusion about available tools

11 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

tools: [pgQueryTool],
// tools: [],
model: "google/gemini-2.5-flash-lite-preview-09-2025",
voice: new GoogleVoice(), // Add OpenAI voice provider with default configuration
Copy link

Choose a reason for hiding this comment

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

style: Comment mentions OpenAI voice provider but the code uses GoogleVoice

Suggested change
voice: new GoogleVoice(), // Add OpenAI voice provider with default configuration
voice: new GoogleVoice(), // Add Google voice provider with default configuration
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/mastra/agents/noteTakerAgent.ts
Line: 16:16

Comment:
**style:** Comment mentions OpenAI voice provider but the code uses GoogleVoice

```suggestion
  voice: new GoogleVoice(), // Add Google voice provider with default configuration
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +121 to +122
log.info('Learning Extraction Experiment Results:', { results: JSON.stringify(results, null, 2) })
return results
Copy link

Choose a reason for hiding this comment

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

syntax: incorrect indentation will cause syntax error - these lines should be properly indented within the function block

Suggested change
log.info('Learning Extraction Experiment Results:', { results: JSON.stringify(results, null, 2) })
return results
log.info('Learning Extraction Experiment Results:', { results: JSON.stringify(results, null, 2) })
return results
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/mastra/evals/agent-experiments.ts
Line: 121:122

Comment:
**syntax:** incorrect indentation will cause syntax error - these lines should be properly indented within the function block

```suggestion
    log.info('Learning Extraction Experiment Results:', { results: JSON.stringify(results, null, 2) })
    return results
```

How can I resolve this? If you propose a fix, please make it concise.

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.

1 participant