Skip to content

refactor(workflow): preserve completed parallel results - #20391

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
6ba3i:refactor/agent-parallel-resume
Sep 30, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
6ba3i:refactor/agent-parallel-resume

Conversation

@6ba3i

@6ba3i 6ba3i commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Repeated pauses dropped work that had already completed in parallel runs. This change keeps completed results across each resume.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7cf6b3fb-34af-461a-97cc-bfc8283d822b

📥 Commits

Reviewing files that changed from the base of the PR and between b2d71ed and 61f5461.

📒 Files selected for processing (2)
  • internal/agent/workflowx/parallel.go
  • internal/agent/workflowx/parallel_integration_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

On resume, runParallelInvoke now records restored results in completedResults. A new integration test checks that a completed item remains available across another interrupt and is not invoked again.

Changes

Parallel invocation resume

Layer / File(s) Summary
Restore results and retain them across interrupts
internal/agent/workflowx/parallel.go, internal/agent/workflowx/parallel_integration_test.go
runParallelInvoke records each restored, coerced result in completedResults. The integration test checks that interrupt state retains the completed result and pending item, and verifies final outputs and invocation counts.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: jinhai-cn

Merge Risk: ⚪ Minimal · up to 61f54

Completed parallel results remain available across repeated interruptions, and no merge-blocking issue was established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 61f54

The change preserves completed work on repeated resumes without showing a new public access path or a verified security issue. Risk remains because checkpoint ownership across runs has not been established by the available evidence.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior affects results restored within an existing parallel workflow invocation. The available source does not establish the maximum deployment, tenant, or checkpoint-store exposure.

Trust Boundaries and Controls

  • observed — Malformed completed/pending index partitions are rejected before resume. Whether the outer checkpoint mechanism binds a valid payload to its intended run and node remains unverified here.

Resilience and Maintainability Implications

  • observed — The implementation drains fan-out results before checkpointing an interruption; a non-interrupt error instead returns without persisting the collected state.

Hardening Proposals

  • proposed — Verify that production resume binds outer and per-item checkpoint payloads to the intended run and node, particularly where checkpoint identifiers can be reused or customized. This is a proof gap, not a demonstrated PR-introduced vulnerability.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preserving completed parallel results across workflow resumes.
Description check ✅ Passed The description states the problem and the intended fix. It provides the required summary information, although it does not use the template's "### Summary" heading.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the saved results,
One finished hop stays in its place.
The waiting hop resumes its path,
Then joins the outputs at the end.
Soft paws count each run with care.

Comment @coderabbitai help to get the list of available commands.

@6ba3i
6ba3i requested a review from wangq8 September 29, 2026 11:16
@6ba3i 6ba3i added the ci Continue Integration label Sep 29, 2026
@wangq8
wangq8 merged commit 8ffecc8 into infiniflow:main Sep 30, 2026
6 checks passed
@6ba3i
6ba3i deleted the refactor/agent-parallel-resume branch October 14, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants