Commit 1551ad3
feat: restore aggregate summaries endpoint + widget re-mount rehydration (#5054)
## Summary
- Restore the `GET /tasks/{id}/summaries/aggregate` Engine endpoint
(lost during PR #5002→#5013 squash). It synthesizes micro-summaries into
a single LLM-generated aggregate sentence via Gemini Flash Lite.
- Widget now shows proper aggregate summaries during live polling
(instead of falling back to raw micro-summaries)
- On re-mount (revisiting a conversation), widget calls
`backfillSummaries()` which fetches the last aggregate + micro-summaries
and renders one activity entry
## Changes
- **Engine**: `generate_aggregate_summary()` + `AGGREGATE_SYSTEM_PROMPT`
in `summarizer.py`, `AggregatedSummaryResponse` model, `GET
/{task_id}/summaries/aggregate` endpoint
- **MCP routes**: `api_progress` fetches aggregate for terminal tasks
without cursor (re-mount backfill)
- **Widget**: `backfillSummaries()` on re-mount, detects completed
status in `ontoolresult`
## Test plan
- [x] Engine tests pass (46)
- [x] MCP tests pass (351)
- [ ] Run task in Claude.ai, verify aggregate summaries appear in
Activity tab
- [ ] Switch away, switch back, verify last summary rehydrates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sourced from commit 1fea2f62212855b004be733de63b739e0a0554b11 parent 4b5aee6 commit 1551ad3
File tree
2 files changed
+31
-4
lines changed- futuresearch-mcp/src/futuresearch_mcp
2 files changed
+31
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
1004 | 1016 | | |
1005 | 1017 | | |
1006 | 1018 | | |
1007 | 1019 | | |
1008 | 1020 | | |
1009 | | - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1010 | 1029 | | |
1011 | 1030 | | |
1012 | 1031 | | |
| |||
1018 | 1037 | | |
1019 | 1038 | | |
1020 | 1039 | | |
1021 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1022 | 1047 | | |
1023 | 1048 | | |
1024 | 1049 | | |
| |||
0 commit comments