Commit 59058ff
authored
fix: keep focused research reports to six passes (#156)
## Summary
- fixes a production QA finding where a concise Research request
silently expanded to ten branches and ran for over twelve minutes
- gives focused deep research a deterministic 3-6-pass contract with a
four-pass default
- reserves larger multi-entity scans for the existing fan-out workflow
- reorders focused passes so concise reports prioritize authoritative
sources, implementation details, and risks
## Production finding
A natural-language Research-mode request for a concise report invoked
`research_deep` with `maxQueries: 10`. The single tool remained in
Working state for more than twelve minutes before being stopped. There
was no retry or disconnect; the excessive branch selection was the
bottleneck.
## Decisions Made
| Decision | Choice | Alternatives considered | Reasoning |
|---|---|---|---|
| Focused depth | 3-6 passes, default 4 | Advisory prompt only; retain
maximum 12 | Enforces predictable latency regardless of model behavior |
| Broad scans | Keep up to 12 in `research_fanout` | Remove broad
coverage | Preserves deliberate exhaustive/multi-entity research |
| Query order | Primary sources, implementation, risks first | Keep
news/competitors first | Produces a useful concise report with only
three passes |
## Verification
- [x] `pnpm lint`
- [x] `pnpm typecheck`
- [x] `pnpm turbo build --force`
- [x] `pnpm deadcode`
- [x] `pnpm architecture:check`
- [x] `pnpm turbo skills:build`
- [ ] production Research run after deployment1 parent 558e988 commit 59058ff
5 files changed
Lines changed: 18 additions & 16 deletions
File tree
- packages/agent-core/src/mastra
- tool-defs
- workflows
- skills/deep-research
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| |||
Lines changed: 6 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
19 | 13 | | |
20 | 14 | | |
21 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments