1jehuang / 1jehuang/jcode

swarm await_members redundantly fetches full history for reported members

Open
#1,264 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

autonomous: no bug triage: needs-decision
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:

  1. sends one CommReadContext request;
  2. transfers that member's conversation history;
  3. extracts the latest assistant response;
  4. passes it beside the retained completion_report;
  5. 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; and
  • completion_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.