-
Notifications
You must be signed in to change notification settings - Fork 2
chore: remove outdated test files and update task documentation #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -321,7 +321,7 @@ export function ChatProvider({ | |
| }, [messages]) | ||
|
|
||
| const sendMessage = useCallback( | ||
| (text: string, _files?: File[]) => { | ||
| (text: string, files?: File[]) => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent parameter naming: removed underscore from unused parameter. The parameter name was changed from
The underscore prefix is a convention for intentionally unused parameters (especially important with no-unused-vars ESLint rules). Either keep the underscore prefix for consistency: - (text: string, files?: File[]) => {
+ (text: string, _files?: File[]) => {Or implement file handling if the parameter is meant to be used: (text: string, files?: File[]) => {
if (!text.trim() || isLoading) {return}
setChatError(null)
- aiSendMessage({ text: text.trim() })
+ aiSendMessage({
+ text: text.trim(),
+ // Handle files if needed
+ })
},Note: The interface at line 95 should also be updated to match whichever approach you choose. 🤖 Prompt for AI Agents |
||
| if (!text.trim() || isLoading) {return} | ||
| setChatError(null) | ||
| aiSendMessage({ text: text.trim() }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,18 +295,28 @@ export function NetworkProvider({ | |
| for (const message of messages) { | ||
| if (message.role === "assistant" && message.parts !== null) { | ||
| for (const [partIndex, part] of message.parts.entries()) { | ||
| // Handle agent and workflow progress events | ||
| // Handle legacy agent/workflow events by normalizing them into progress events | ||
| if (part.type === "data-tool-agent" || part.type === "data-tool-workflow") { | ||
| const agentPart = part as { data: AgentDataPart } | ||
| const eventData = agentPart.data | ||
| const agentPart = part as { data?: AgentDataPart } | ||
| const eventData = agentPart.data as Record<string, unknown> | undefined | ||
| const dataObj = eventData?.data as Record<string, unknown> | undefined | ||
|
|
||
| if (eventData?.data?.text?.trim()) { | ||
| const msg = typeof dataObj?.text === 'string' ? dataObj.text | ||
| : typeof dataObj?.message === 'string' ? dataObj.message | ||
| : typeof eventData?.message === 'string' ? eventData.message | ||
| : typeof eventData?.text === 'string' ? eventData.text | ||
| : '' | ||
|
Comment on lines
+304
to
+308
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| const stage = typeof eventData?.stage === 'string' ? eventData.stage : (typeof dataObj?.stage === 'string' ? dataObj.stage : part.type.replace("data-tool-", "")) | ||
| const agentId = typeof eventData?.id === 'string' ? eventData.id : undefined | ||
|
|
||
| if (msg && msg.trim().length > 0) { | ||
| allProgressEvents.push({ | ||
| id: `${message.id}-${part.type}-${partIndex}`, | ||
| stage: part.type.replace("data-tool-", ""), | ||
| stage: String(stage), | ||
| status: "in-progress", | ||
| message: eventData.data.text, | ||
| agentId: eventData.id, | ||
| message: msg, | ||
| agentId, | ||
| timestamp: new Date(), | ||
| data: eventData, | ||
| }) | ||
|
|
@@ -318,7 +328,7 @@ export function NetworkProvider({ | |
| const progressPart = part as { type: string; data?: { status?: string; message?: string; stage?: string; agentId?: string } } | ||
| const eventData = progressPart.data | ||
|
|
||
| if (eventData?.status && (eventData.status === "in-progress" || eventData.status === "done" || eventData.status === "error")) { | ||
| if (typeof eventData?.status === 'string' && (eventData.status === "in-progress" || eventData.status === "done")) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cd /repo && head -50 app/networks/providers/network-context.tsxRepository: ssdeanx/AgentStack Length of output: 117 🏁 Script executed: cd /repo && sed -n '30,45p' app/networks/providers/network-context.tsxRepository: ssdeanx/AgentStack Length of output: 117 🏁 Script executed: cd /repo && sed -n '325,340p' app/networks/providers/network-context.tsxRepository: ssdeanx/AgentStack Length of output: 117 🏁 Script executed: cd /repo && rg -n 'data-tool-progress' --type=tsx -A 8Repository: ssdeanx/AgentStack Length of output: 117 🏁 Script executed: cd /repo && rg -n 'ProgressEvent' --type=tsx -B 2 -A 5Repository: ssdeanx/AgentStack Length of output: 117 🏁 Script executed: cd /repo && rg -n 'data-tool-error' --type=tsx -A 5Repository: ssdeanx/AgentStack Length of output: 117 🏁 Script executed: wc -l app/networks/providers/network-context.tsxRepository: ssdeanx/AgentStack Length of output: 108 🏁 Script executed: sed -n '30,45p' app/networks/providers/network-context.tsxRepository: ssdeanx/AgentStack Length of output: 324 🏁 Script executed: sed -n '325,340p' app/networks/providers/network-context.tsxRepository: ssdeanx/AgentStack Length of output: 937 🏁 Script executed: rg -n 'data-tool-progress' --type=tsx -A 8Repository: ssdeanx/AgentStack Length of output: 89 🏁 Script executed: rg -n 'ProgressEvent' --type=tsx -B 2 -A 5Repository: ssdeanx/AgentStack Length of output: 89 🏁 Script executed: rg -n 'status.*error' app/networks/providers/network-context.tsx -B 2 -A 2Repository: ssdeanx/AgentStack Length of output: 692 🏁 Script executed: rg -n 'data-tool-error' app/networks/providers/network-context.tsx -B 2 -A 5Repository: ssdeanx/AgentStack Length of output: 44 🏁 Script executed: rg -n 'status.*error\|error.*status' app/networks/providers/network-context.tsx -B 3 -A 3Repository: ssdeanx/AgentStack Length of output: 44 🏁 Script executed: grep -n 'part\.type' app/networks/providers/network-context.tsx | head -20Repository: ssdeanx/AgentStack Length of output: 728 🏁 Script executed: sed -n '275,360p' app/networks/providers/network-context.tsxRepository: ssdeanx/AgentStack Length of output: 3772 🏁 Script executed: find . -name "workflow-context.tsx" -o -name "workflow-context.ts"Repository: ssdeanx/AgentStack Length of output: 108 🏁 Script executed: sed -n '380,430p' app/workflows/providers/workflow-context.tsxRepository: ssdeanx/AgentStack Length of output: 2606 🏁 Script executed: grep -n 'status.*error\|error.*status' app/workflows/providers/workflow-context.tsx -B 2 -A 2Repository: ssdeanx/AgentStack Length of output: 945 Include "error" status in the data-tool-progress condition to match the ProgressEvent interface and workflow-context.tsx pattern. The status check at line 331 excludes "error", causing progress events with Change line 331 from: if (typeof eventData?.status === 'string' && (eventData.status === "in-progress" || eventData.status === "done"))To: if (typeof eventData?.status === 'string' && (eventData.status === "in-progress" || eventData.status === "done" || eventData.status === "error"))🤖 Prompt for AI Agents |
||
| allProgressEvents.push({ | ||
| id: `${message.id}-${part.type}-${partIndex}`, | ||
| stage: eventData.stage ?? "progress", | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -62,8 +62,8 @@ export default [ | |||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| rules: { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'no-unused-vars': ['warn', { }], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| '@typescript-eslint/no-unused-vars': ['warn', {}], | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+65
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: removed ignore patterns for underscore-prefixed variables/args - this will cause warnings for intentionally unused parameters like
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: eslint.config.js
Line: 65:66
Comment:
**logic:** removed ignore patterns for underscore-prefixed variables/args - this will cause warnings for intentionally unused parameters like `_context` or `_req`
```suggestion
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
```
How can I resolve this? If you propose a fix, please make it concise.
Comment on lines
+65
to
+66
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing the
Suggested change
Comment on lines
+65
to
+66
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| 'no-unused-vars': ['warn', { }], | |
| '@typescript-eslint/no-unused-vars': ['warn', {}], | |
| 'no-unused-vars': [ | |
| 'warn', | |
| { | |
| argsIgnorePattern: '^_', | |
| varsIgnorePattern: '^_', | |
| }, | |
| ], | |
| '@typescript-eslint/no-unused-vars': [ | |
| 'warn', | |
| { | |
| argsIgnorePattern: '^_', | |
| varsIgnorePattern: '^_', | |
| }, | |
| ], |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -152,6 +152,32 @@ If any fail, do NOT proceed. Fix issues first. | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ## Tool Streaming & Progress Events | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| All tools must follow the TASK001 streaming convention: | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - Prefer the runtime agent instance via `context.mastra.getAgent('<agentId>')` when available, otherwise fall back to the local agent import. | ||||||||||||||||||||||||
| - If the agent exposes a stream API, call `agent.stream(prompt)` returning a `MastraModelOutput` and: | ||||||||||||||||||||||||
| - Pipe `textStream` / `fullStream` to `context.writer` so the UI receives nested chunks | ||||||||||||||||||||||||
| - Await `stream.text` for the final text | ||||||||||||||||||||||||
| - Use `stream.object` when present for structured responses and fall back to JSON parsing of `stream.text` | ||||||||||||||||||||||||
| - If no streaming API, call `agent.generate(prompt)` and parse `response.object` or JSON text as a fallback. | ||||||||||||||||||||||||
| - Emit progress events with the exact format below at start/in-progress/done: | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ```typescript | ||||||||||||||||||||||||
| await context?.writer?.custom({ | ||||||||||||||||||||||||
| type: 'data-tool-progress', | ||||||||||||||||||||||||
| data: { | ||||||||||||||||||||||||
| status: 'in-progress', | ||||||||||||||||||||||||
| message: `📈 Fetching tool-id data for ${inputData.symbol}/${inputData.market}`, | ||||||||||||||||||||||||
| stage: 'tool-id' | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| id: 'tool-id' | ||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||
|
Comment on lines
+167
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Improve consistency of placeholder values in example. The progress event example mixes generic placeholders ("tool-id") with specific financial API fields ( Either use fully generic placeholders: await context?.writer?.custom({
type: 'data-tool-progress',
data: {
status: 'in-progress',
- message: `📈 Fetching tool-id data for ${inputData.symbol}/${inputData.market}`,
+ message: `Processing ${toolName} with input: ${inputData.param}`,
stage: 'tool-id'
},
id: 'tool-id'
});Or use a complete real-world example: await context?.writer?.custom({
type: 'data-tool-progress',
data: {
status: 'in-progress',
message: `📈 Fetching Alpha Vantage crypto data for ${inputData.symbol}/${inputData.market}`,
- stage: 'tool-id'
+ stage: 'alpha-vantage-crypto'
},
- id: 'tool-id'
+ id: 'alpha-vantage-crypto'
});The second approach matches the real example shown in AGENTS.md (lines 124-132) and provides clearer guidance. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - Update the TASK001 scratchpad (`/memory-bank/tasks/TASK001-tool-streaming.md`) when implementing or changing tool streaming behavior. | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ## 🎨 UI Component Rules | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ### Component Locations | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,6 +37,7 @@ This document instructs GitHub Copilot on how to: | |||||||||||||||
| - Status check → + progress.md | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| Note: For tool implementation tasks, consult `memory-bank/tasks/TASK001-tool-streaming.md` which documents the standard streaming and progress-event conventions (use `context.writer` with `data-tool-progress` start/in-progress/done events, and prefer `agent.stream()` with `MastraModelOutput` when available). Update the task scratchpad with any deviations or agent-specific details. | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excessive line length in markdown documentation. Line 40 exceeds 300 characters, violating the project's markdown guideline to limit lines to 80 characters for readability. Apply this diff to reformat the note with proper line breaks: -Note: For tool implementation tasks, consult `memory-bank/tasks/TASK001-tool-streaming.md` which documents the standard streaming and progress-event conventions (use `context.writer` with `data-tool-progress` start/in-progress/done events, and prefer `agent.stream()` with `MastraModelOutput` when available). Update the task scratchpad with any deviations or agent-specific details.
+Note: For tool implementation tasks, consult
+`memory-bank/tasks/TASK001-tool-streaming.md` which documents the standard
+streaming and progress-event conventions (use `context.writer` with
+`data-tool-progress` start/in-progress/done events, and prefer
+`agent.stream()` with `MastraModelOutput` when available). Update the task
+scratchpad with any deviations or agent-specific details.As per coding guidelines, limit line length to 80 characters in markdown for readability. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| ### On Context Reset (New Session) | ||||||||||||||||
|
|
||||||||||||||||
| ```markdown | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| # [Task 001] - Implement Tool Streaming with Writer in ALL Tools\n\n**Status:** In Progress \n**Added:** 2025-11-22 \n**Updated:** 2025-11-22\n\n## Original Request\n\nUser: Fetch Mastra tool streaming docs, implement in #file:tools. Clarified: ALL tools use writer directly, no utility.\n\n## Thought Process\n\nMastra docs: execute({context, writer?}): await writer?.write({type:'custom-event'| 'progress', ...}); return result. 12 tools need surgical updates: add writer param, emit start/progress/end.\n\n## Implementation Plan\n\n- Create tasks structure\n- Update all 12 .tool.ts executes\n- Add streaming tests\n- Update AGENTS.md\n\n## Progress Tracking\n\n**Overall Status:** In Progress - 10%\n\n### Subtasks\n\n| ID | Description | Status | Updated | Notes \n|-----|--------------------------------------|-------------|-------------|-------\n| 1.1 | Create tasks/ folder & files | Complete | 2025-11-22 | Done\n| 1.2 | Read all tool files | In Progress | 2025-11-22 | 3 read, 9 pending\n| 1.3 | Edit weather-tool.ts | Not Started | | \n| 1.4 | Edit serpapi-search.tool.ts | Not Started | | \n| ... | Edit remaining tools | Not Started | | \n| 1.x | Tests & AGENTS.md | Not Started | | \n\n## Progress Log\n\n### 2025-11-22\n- Created tasks structure\n- Read 3 sample tools\n- Planning batch edits\n | ||
| # [Task 001] - Implement Tool Streaming with Writer in ALL Tools\n\n**Status:** In Progress \n**Added:** 2025-11-22 \n**Updated:** 2025-11-22\n\n## Original Request\n\nUser: Fetch Mastra tool streaming docs, implement in #file:tools. Clarified: ALL tools use writer directly, no utility.\n\n## Thought Process\n\nMastra docs: execute({context, writer?}): await writer?.write({type:'custom-event'| 'progress', ...}); return result. 12 tools need surgical updates: add writer param, emit start/progress/end.\n\n## Implementation Plan\n\n- Create tasks structure\n- Update all 12 .tool.ts executes\n- Add streaming tests\n- Update AGENTS.md\n\n## Progress Tracking\n\n**Overall Status:** In Progress - 10%\n\n### Subtasks\n\n| ID | Description | Status | Updated | Notes \n|-----|--------------------------------------|-------------|-------------|-------\n| 1.1 | Create tasks/ folder & files | Complete | 2025-11-22 | Done\n| 1.2 | Read all tool files | In Progress | 2025-11-22 | 3 read, 9 pending\n| 1.3 | Edit weather-tool.ts | Not Started | | \n| 1.4 | Edit serpapi-search.tool.ts | Not Started | | \n| ... | Edit remaining tools | Not Started | | \n| 1.x | Tests & AGENTS.md | Not Started | | \n\n## Progress Log\n\n### 2025-11-22\n- Created tasks structure\n- Read 3 sample tools\n- Planning batch edits\n | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect file format: markdown stored as escaped single-line string. This markdown file is stored as a single line with The content should be reformatted as a proper multi-line markdown file. For example, the beginning should be: -# [Task 001] - Implement Tool Streaming with Writer in ALL Tools\n\n**Status:** In Progress \n**Added:** 2025-11-22 \n**Updated:** 2025-11-22\n\n## Original Request\n\nUser: Fetch Mastra tool streaming docs, implement in #file:tools. Clarified: ALL tools use writer directly, no utility.\n\n## Thought Process\n\nMastra docs: execute({context, writer?}): await writer?.write({type:'custom-event'| 'progress', ...}); return result. 12 tools need surgical updates: add writer param, emit start/progress/end.\n\n## Implementation Plan\n\n- Create tasks structure\n- Update all 12 .tool.ts executes\n- Add streaming tests\n- Update AGENTS.md\n\n## Progress Tracking\n\n**Overall Status:** In Progress - 10%\n\n### Subtasks\n\n| ID | Description | Status | Updated | Notes \n|-----|--------------------------------------|-------------|-------------|-------\n| 1.1 | Create tasks/ folder & files | Complete | 2025-11-22 | Done\n| 1.2 | Read all tool files | In Progress | 2025-11-22 | 3 read, 9 pending\n| 1.3 | Edit weather-tool.ts | Not Started | | \n| 1.4 | Edit serpapi-search.tool.ts | Not Started | | \n| ... | Edit remaining tools | Not Started | | \n| 1.x | Tests & AGENTS.md | Not Started | | \n\n## Progress Log\n\n### 2025-11-22\n- Created tasks structure\n- Read 3 sample tools\n- Planning batch edits\n
+# [Task 001] - Implement Tool Streaming with Writer in ALL Tools
+
+**Status:** In Progress
+**Added:** 2025-11-22
+**Updated:** 2025-11-22
+
+## Original Request
+
+User: Fetch Mastra tool streaming docs, implement in #file:tools. Clarified: ALL tools use writer directly, no utility.
+
+## Thought Process
+
+Mastra docs: execute({context, writer?}): await writer?.write({type:'custom-event'| 'progress', ...}); return result. 12 tools need surgical updates: add writer param, emit start/progress/end.
+
+## Implementation Plan
+
+- Create tasks structure
+- Update all 12 .tool.ts executes
+- Add streaming tests
+- Update AGENTS.md
+
+## Progress Tracking
+
+**Overall Status:** In Progress - 10%
+
+### Subtasks
+
+| ID | Description | Status | Updated | Notes |
+|-----|--------------------------------------|-------------|-------------|-------|
+| 1.1 | Create tasks/ folder & files | Complete | 2025-11-22 | Done |
+| 1.2 | Read all tool files | In Progress | 2025-11-22 | 3 read, 9 pending |
+| 1.3 | Edit weather-tool.ts | Not Started | | |
+| 1.4 | Edit serpapi-search.tool.ts | Not Started | | |
+| ... | Edit remaining tools | Not Started | | |
+| 1.x | Tests & AGENTS.md | Not Started | | |
+
+## Progress Log
+
+### 2025-11-22
+- Created tasks structure
+- Read 3 sample tools
+- Planning batch editsAs per coding guidelines, limit line length to 80 characters in markdown for readability and use proper whitespace between sections. 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # TASK001 - Update Log (2025-12-14) | ||
|
|
||
| Summary of changes performed to align tools with the streaming + progress convention: | ||
|
|
||
| - Replaced `data-tool-agent` messages with `data-tool-progress` (standard in-progress/done events) in: | ||
| - `src/mastra/tools/evaluateResultTool.ts` | ||
| - `src/mastra/tools/extractLearningsTool.ts` | ||
| - `src/mastra/tools/editor-agent-tool.ts` | ||
| - `src/mastra/tools/copywriter-agent-tool.ts` | ||
|
|
||
| - Normalized nested-agent streaming pattern in tools to: | ||
| - Prefer `context.mastra.getAgent()` runtime instance if available, otherwise fall back to local agent import | ||
| - Use `agent.stream(prompt)` returning `MastraModelOutput` when available | ||
| - Pipe `textStream` / `fullStream` to `context.writer` | ||
| - Parse `stream.object` or JSON text safely for structured output | ||
|
|
||
| - Updated `src/mastra/tools/financial-chart-tools.ts` to use the same streaming pattern and to validate agent capability (check for `generate` or `stream`). | ||
|
|
||
| - Updated client-side parsers to normalize legacy `data-tool-agent` parts into `data-tool-progress` events: | ||
| - `app/networks/providers/network-context.tsx` | ||
| - `app/workflows/providers/workflow-context.tsx` | ||
|
|
||
| - Updated `src/mastra/tools/AGENTS.md` with a note referencing this task and the progress convention. | ||
|
|
||
| Notes: | ||
| - Tests will be added next to verify that progress events and streaming behavior are emitted consistently. (Pending) | ||
| - If you'd like, I can add/restore unit tests and run the test suite now. | ||
|
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update log incomplete: missing mention of deleted test files. The PR objectives state that five test files were deleted (serpapi-news-trends.tool.test.ts, serpapi-search.tool.test.ts, serpapi-shopping.tool.test.ts, weather-tool.test.ts, web-scraper-tool.test.ts), but this update log only mentions adding new tests. The deletion of existing test suites should be documented here with justification. Add a section documenting the test file deletions: - Updated `src/mastra/tools/AGENTS.md` with a note referencing this task and the progress convention.
+- Removed outdated test files (migrating to streaming-based test approach):
+ - `src/mastra/tools/tests/serpapi-news-trends.tool.test.ts`
+ - `src/mastra/tools/tests/serpapi-search.tool.test.ts`
+ - `src/mastra/tools/tests/serpapi-shopping.tool.test.ts`
+ - `src/mastra/tools/tests/weather-tool.test.ts`
+ - `src/mastra/tools/tests/web-scraper-tool.test.ts`
+
Notes:
- Tests will be added next to verify that progress events and streaming behavior are emitted consistently. (Pending)Based on learnings, ensure that removing tests is justified and that test coverage is maintained or restored to avoid regressions. 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -102,7 +102,7 @@ await context?.writer?.custom({ | |||||||||||||
| type: "data-tool-progress", | ||||||||||||||
| data: { | ||||||||||||||
| status: "in-progress", // "in-progress" | "done" | ||||||||||||||
| message: "Descriptive progress message...", | ||||||||||||||
| message: "Descriptive progress message ${inputData.context}....`,", | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: malformed template string in documentation example - has mismatched quotes and backticks
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/mastra/tools/AGENTS.md
Line: 105:105
Comment:
**syntax:** malformed template string in documentation example - has mismatched quotes and backticks
```suggestion
message: "Descriptive progress message...",
```
How can I resolve this? If you propose a fix, please make it concise.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There appears to be a typo in the example
Suggested change
|
||||||||||||||
| message: "Descriptive progress message ${inputData.context}....`,", | |
| message: `Descriptive progress message ${inputData.context}....`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect template literal syntax in example.
The progress message example mixes double quotes with template interpolation syntax, which is invalid JavaScript. Template literals must use backticks, not double quotes.
Apply this diff to correct the syntax:
- message: "Descriptive progress message ${inputData.context}....`,",
+ message: `Descriptive progress message for ${inputData.symbol}...`,Compare with the correct example on line 128:
message: `📈 Fetching Alpha Vantage crypto data for ${inputData.symbol}/${inputData.market}`,Additionally, consider using a more specific field name (like symbol, market, etc.) instead of the generic inputData.context to better illustrate the pattern.
🤖 Prompt for AI Agents
In src/mastra/tools/AGENTS.md around line 105, the example uses double quotes
with ${...} interpolation which is invalid; change the string to a template
literal using backticks and replace the generic inputData.context with a more
specific field (e.g., inputData.symbol or inputData.market) to mirror the
correct example on line 128 so the message becomes a backtick-delimited template
literal that interpolates a concrete field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Vague changelog entry.
The changelog description "Custom Agent nest events" is unclear and doesn't adequately describe the changes documented in this PR. Based on the update notes in TASK001-update-2025-12-14.md, the changes involve standardizing progress events (data-tool-progress), normalizing legacy formats, and establishing streaming conventions.
Consider a more descriptive changelog entry:
-| 2.4.0 | 2025-12-14 | Custom Agent nest events|
+| 2.4.0 | 2025-12-14 | Standardized tool progress events (data-tool-progress) and streaming patterns; normalized legacy data-tool-agent events |This provides clearer information about what changed and why users would care about this version.
📝 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.
| | 2.4.0 | 2025-12-14 | Custom Agent nest events| | |
| | 2.3.0 | 2025-11-28 | Added Financial Chart Tools: chartSupervisorTool, chartGeneratorTool, chartDataProcessorTool, chartTypeAdvisorTool | | |
| | 2.4.0 | 2025-12-14 | Standardized tool progress events (data-tool-progress) and streaming patterns; normalized legacy data-tool-agent events | | |
| | 2.3.0 | 2025-11-28 | Added Financial Chart Tools: chartSupervisorTool, chartGeneratorTool, chartDataProcessorTool, chartTypeAdvisorTool | |
🤖 Prompt for AI Agents
In src/mastra/tools/AGENTS.md around lines 163-164, the changelog entry "Custom
Agent nest events" is too vague; replace it with a concise, descriptive entry
that summarizes the actual changes from TASK001-update-2025-12-14.md (e.g.,
"Standardized data-tool-progress events, normalized legacy event formats to the
new schema, and established streaming conventions for agent tool output"),
mention the impact on consumers (event names and format changes, backward
compatibility handling), and include a one-line note pointing readers to
TASK001-update-2025-12-14.md for full details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unused parameter
files(renamed from_files) will now trigger ESLint warnings due to the ESLint configuration change that removed the underscore ignore pattern. If this parameter is intentionally unused but required by the function signature, it should be prefixed with underscore to document this intent.