Repository navigation
fix: accept legacy positional task executor index - #16147
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
-
Check name Status Explanation 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. Title check ✅ Passed The title clearly describes the main change: restoring support for a legacy positional task executor index. Description check ✅ Passed The description clearly explains the problem, compatibility behavior, conflict handling, change type, and verification. It does not use the template's exact "### Summary" heading, but it provides the …
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.
A rabbit parses flags in the moonlit glow
Positional indexes choose where to go
Conflicts raise warnings, clear and bright
Matching values keep the path right
Tests hop softly through each case
The executor starts in its proper place
Comment @coderabbitai help to get the list of available commands.
|
Error logs before fix: Before this fix, the deployment launcher passes worker index as a positional argument without the This PR keeps the original |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rag/svr/task_executor.py`:
- Around line 1913-1920: The backward compatibility path for legacy_index in the
argument parsing section lacks logging, making it difficult for operators to
debug which input method was used. After the TE_IDX assignment on line 1920, add
an explicit log statement that checks if args.legacy_index is not None and logs
that the legacy positional index path is being used. Additionally, if both
args.legacy_index and args.index are provided (non-None), emit a warning log to
indicate that legacy_index is taking precedence over the new --index argument.
This ensures visibility into which compatibility path is being selected during
startup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 707032e1-c407-43b1-a977-fc6d65c95217
📒 Files selected for processing (1)
rag/svr/task_executor.py
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Thanks for the fix. Reviewed the change and have a few findings: 1. The "legacy positional index" has no in-repo caller (scope/intent)
None passes a positional index, so the failing path only exists in an out-of-repo launcher. The shim is harmless and solves your real deployment crash, but it is a compatibility-only branch with no repo contract. Please note this in the PR description so future maintainers don't assume an in-repo caller exists. 2. Silent precedence conflict when both 3. No test coverage for the new CLI behavior Overall the fix is correct and low-risk for in-repo launchers; addressing #2 (conflict warning) and #3 (test) before merge would make it a clean net gain. Please let me know your thoughts. |
|
Thanks for the detailed review. I addressed #2 and #3 in c40dbde:
For #1, I updated the PR description to clarify the compatibility scope. Before the task executor refactor in #15154, the in-repo launchers passed the worker index positionally and The focused test suite passes with 4 tests. Could you please take another look? |
|
LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 0.27.x #16147 +/- ##
=======================================
Coverage 38.11% 38.11%
=======================================
Files 54 54
Lines 15533 15533
Branches 125 125
=======================================
Hits 5920 5920
Misses 9585 9585
Partials 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Thanks for the LGTM. Since the review, #20289 removed rag/svr/task_executor.py and task execution moved to the Go ingestor. This PR now has a delete/modify conflict. Should this fix be adapted to the Go path, or is it superseded? |
|
please try to change the base: infiniflow:main (now) -> 0.27.x (python only). infiniflow:main(now) is golang only. Python version will contine to have ingestor. |
|
@helloxjade please rebase and then I will review. Thank you. |
c40dbde to
9b42b97
Compare
What problem does this PR solve?
Before the task executor refactor in #15154, the worker index was read from
sys.argv[1], and the in-repo launchers passed it positionally. The refactor migrated the current in-repo launchers to-i/--index, but external deployment configurations copied from older RAGFlow versions may still use the former positional interface.In the affected deployment environment, this caused
argparseto exit withunrecognized argumentsand the worker to restart in a loop.This PR preserves compatibility with those external deployment configurations while keeping the current
-i/--indexbehavior. When both forms are provided with conflicting values, the positional value continues to take precedence and a warning is emitted.Type of change
Testing
.venv/bin/pytest -q test/unit_test/rag/svr/test_task_executor_cli.py— 4 passed.venv/bin/ruff check rag/svr/task_executor_cli.py test/unit_test/rag/svr/test_task_executor_cli.py.venv/bin/python -m py_compile rag/svr/task_executor.py rag/svr/task_executor_cli.py