You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: memory-bank/memory-bank-instructions.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ This document instructs GitHub Copilot on how to:
37
37
- Status check → + progress.md
38
38
```
39
39
40
+
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.
Summary of changes performed to align tools with the streaming + progress convention:
4
+
5
+
- Replaced `data-tool-agent` messages with `data-tool-progress` (standard in-progress/done events) in:
6
+
-`src/mastra/tools/evaluateResultTool.ts`
7
+
-`src/mastra/tools/extractLearningsTool.ts`
8
+
-`src/mastra/tools/editor-agent-tool.ts`
9
+
-`src/mastra/tools/copywriter-agent-tool.ts`
10
+
11
+
- Normalized nested-agent streaming pattern in tools to:
12
+
- Prefer `context.mastra.getAgent()` runtime instance if available, otherwise fall back to local agent import
13
+
- Use `agent.stream(prompt)` returning `MastraModelOutput` when available
14
+
- Pipe `textStream` / `fullStream` to `context.writer`
15
+
- Parse `stream.object` or JSON text safely for structured output
16
+
17
+
- Updated `src/mastra/tools/financial-chart-tools.ts` to use the same streaming pattern and to validate agent capability (check for `generate` or `stream`).
18
+
19
+
- Updated client-side parsers to normalize legacy `data-tool-agent` parts into `data-tool-progress` events:
20
+
-`app/networks/providers/network-context.tsx`
21
+
-`app/workflows/providers/workflow-context.tsx`
22
+
23
+
- Updated `src/mastra/tools/AGENTS.md` with a note referencing this task and the progress convention.
24
+
25
+
Notes:
26
+
- Tests will be added next to verify that progress events and streaming behavior are emitted consistently. (Pending)
27
+
- If you'd like, I can add/restore unit tests and run the test suite now.
Copy file name to clipboardExpand all lines: src/mastra/AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ This folder contains the middleware and high-level components that define Mastra
45
45
46
46
- Use explicit Zod schemas for every tool input/output.
47
47
- Keep tools small and side-effect-free when possible; agents orchestrate tools and handle context.
48
-
- Use `RuntimeContext` to enforce access control in tools and workflows.
48
+
- Use `RequestContext` (per-request) or agent-specific runtime context types (e.g. `EditorRuntimeContext`) to enforce access control in tools and workflows.
0 commit comments