Skip to content

Guard empty swarm task extraction#133

Merged
yedidyakfir merged 3 commits into
developfrom
codex/132-guard-empty-swarm-extraction
Jul 17, 2026
Merged

Guard empty swarm task extraction#133
yedidyakfir merged 3 commits into
developfrom
codex/132-guard-empty-swarm-extraction

Conversation

@yedidyakfir

@yedidyakfir yedidyakfir commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prevent swarm filling from reaching Rapyer task extraction when there are no task IDs to load.

Changes

  • add an explicit early-return guard immediately before the variadic Rapyer lookup
  • add a focused unit test that fails if an empty swarm invokes rapyer.afind or dispatches tasks
  • document the fix in the unreleased 0.3.6 changelog

Testing

  • uv run --project libs/mageflow pytest -q libs/mageflow/tests/unit (258 passed)
  • uv run --project libs/mageflow ruff check libs/mageflow/mageflow/swarm/workflows.py libs/mageflow/tests/unit/workflows/test_fill_running_tasks.py
  • uv run --project libs/mageflow black --check libs/mageflow/mageflow/swarm/workflows.py libs/mageflow/tests/unit/workflows/test_fill_running_tasks.py
  • git diff --check develop...HEAD

Closes #132

Summary by CodeRabbit

  • Bug Fixes
    • Improved swarm task processing when no task IDs are available.
    • Prevented unnecessary database lookups and workflow execution attempts in this case.
    • Updated the changelog to document the fix.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1141be98-d0c1-49b4-a555-51f9f12583bd

📥 Commits

Reviewing files that changed from the base of the PR and between d6b94c3 and 3a8aca0.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • libs/mageflow/mageflow/swarm/workflows.py
  • libs/mageflow/tests/unit/workflows/test_fill_running_tasks.py

📝 Walkthrough

Walkthrough

fill_running_tasks now returns early when no task IDs are available, preventing an empty Rapyer lookup. A focused async test verifies extraction and dispatch are skipped, and CHANGELOG.md documents the fix.

Changes

Swarm task guard

Layer / File(s) Summary
Guard empty task extraction
libs/mageflow/mageflow/swarm/workflows.py, libs/mageflow/tests/unit/workflows/test_fill_running_tasks.py, CHANGELOG.md
fill_running_tasks returns [] before querying Rapyer when no IDs exist. The test confirms extraction and signature dispatch are not called, and the changelog records the behavior.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: guarding empty swarm task extraction.
Linked Issues check ✅ Passed The guard, focused test, and changelog update satisfy issue #132's requirements.
Out of Scope Changes check ✅ Passed No unrelated code changes are apparent beyond the requested guard, test, and changelog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/132-guard-empty-swarm-extraction

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

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

@yedidyakfir
yedidyakfir merged commit 5fa65c2 into develop Jul 17, 2026
35 checks passed
@yedidyakfir
yedidyakfir deleted the codex/132-guard-empty-swarm-extraction branch July 17, 2026 10:03
@yedidyakfir yedidyakfir linked an issue Jul 17, 2026 that may be closed by this pull request
5 tasks
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.

Guard swarm task extraction against empty ID lists

1 participant