Skip to content

perf(swarm): skip redundant completion report backfill - #1265

Open
shua0326 wants to merge 1 commit into
1jehuang:masterfrom
shua0326:perf/swarm-skip-redundant-report-backfill
Open

shua0326 wants to merge 1 commit into
1jehuang:masterfrom
shua0326:perf/swarm-skip-redundant-report-backfill

Conversation

@shua0326

Copy link
Copy Markdown

Summary

  • skip CommReadContext backfill when an awaited member already carries its retained completion report
  • preserve history backfill for done members whose report field is absent
  • add focused coverage for reported, report-less, and running members

Why

The formatter already prefers AwaitedMemberStatus.completion_report over the separately fetched history fallback. Fetching full conversation history for a member that already has a report therefore adds one socket round trip and transfers a full history without changing output. The overhead scales linearly with completed swarm width.

This is intentionally a narrow performance change. It does not alter the protocol or rendered report selection.

Validation

  • cargo +1.94.1 test --profile selfdev -p jcode-app-core --lib report_backfill_only_covers_done_members_missing_a_retained_report
  • cargo +1.94.1 test --profile selfdev -p jcode-app-core --lib format_awaited_members_includes_completion_reports
  • cargo +1.94.1 fmt -p jcode-app-core -- --check
  • git diff --check

Closes #1264

`await_members` responses already carry retained completion reports on each
done member. The tool nevertheless requested each done member's full
conversation history, then passed both values to a formatter that prefers the
retained report. That made the common reported-member path pay one extra socket
round trip and transfer a full history per member without changing output.

Only use history as a fallback when a done member has no retained completion
report. Keep the fallback for legacy or report-less completions.

Add a focused regression test covering reported, report-less, and still-running
members.
@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

Safe to merge: focused regression coverage confirms retained reports skip backfill without removing the fallback for report-less completed members.

What we checked:

  • Validated that fetch_awaited_member_reports creates CommReadContext requests only for members_needing_report_backfill. T-Rex
  • Confirmed that the selector accepts completed members without a retained report and excludes both completed members with a report and running members. T-Rex
  • Reproduced the earlier selection behavior and ran the focused regression tests and formatter check successfully. T-Rex
  • Identified decisive code locations: CommReadContext construction at communicate.rs:1704-1709 and the selector at communicate.rs:1732, and validated these findings with tests that cover completed-with-report, completed-without-report, and running-without-report. T-Rex
  • Artifacts containing paired before/after script outputs were attached to support the decisive validation. T-Rex

Summary

This change avoids redundant conversation-history requests when a completed swarm member already has a retained completion report. It preserves history fallback for completed members without a retained report and excludes running members from report backfill.

Reviews (1) · Last reviewed commit: "perf(swarm): skip redundant completion r..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

swarm await_members redundantly fetches full history for reported members

1 participant