swarm await_members redundantly fetches full history for reported members
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Summary
swarm await_members performs an unnecessary CommReadContext request for every done member even when the await response already contains that member's retained completion report.
The formatter prefers AwaitedMemberStatus.completion_report over the separately fetched history fallback. Therefore, for the common case where a worker submitted or produced a retained completion report, the extra request transfers the member's full conversation history but cannot affect the rendered result.
Current behavior
For each done member, fetch_awaited_member_reports:
- sends one
CommReadContextrequest; - transfers that member's conversation history;
- extracts the latest assistant response;
- passes it beside the retained
completion_report; - has the formatter ignore the history value because the retained report is present.
This scales as one extra socket round trip and one full-history transfer per completed worker.
Expected behavior
Use conversation history only as a compatibility/fallback path when a done member has no retained completion report on the await response. Preserve existing behavior for legacy or report-less completions.
Proposed change
Filter the backfill candidates to members where:
done == true; andcompletion_report.is_none().
No protocol or rendered-output change is intended.
Validation
Add a focused regression test covering:
- a done member with a retained report: no backfill;
- a done member without one: backfill;
- a running member: no backfill.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating fetch_awaited_member_reports and the formatter that prefers AwaitedMemberStatus.completion_report. Add a focused regression test for done members with and without retained reports, plus a running member; done means only report-less members are backfilled and rendered output remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100