Skip to content

Fix: guard missing task language - #15136

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
buua436:b052
May 22, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
buua436:b052

Conversation

@buua436

@buua436 buua436 commented May 22, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

guard missing task language

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@coderabbitai

coderabbitai Bot commented May 22, 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4dd62bbe-73e7-4b06-8fc3-5485c058fa94

📥 Commits

Reviewing files that changed from the base of the PR and between 57ddd79 and 56dab80.

📒 Files selected for processing (2)
  • rag/app/naive.py
  • rag/svr/task_executor.py

📝 Walkthrough

Walkthrough

This PR adds consistent language parameter defaulting across the chunking and task execution pipeline. When a task does not specify a language, the system now consistently defaults to "Chinese" instead of propagating empty or null values into downstream OCR, model selection, and tokenization logic.

Changes

Language Normalization

Layer / File(s) Summary
Language default handling across chunk and task execution
rag/app/naive.py, rag/svr/task_executor.py
The chunk() function adds a guard to default lang to "Chinese" when falsey. The build_chunks() function derives task_language with a "Chinese" default and passes it to the chunker. The do_handle_task() function reads task_language with fallback to "Chinese" and logs a warning when language is not provided.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 When languages are missed, our code's no fool,
"Chinese" steps right in as the default rule,
No falsey whispers down the OCR stream,
Just sensible defaults in the chunking scheme! 🌾

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is minimal and lacks detail about the problem context and implementation approach, though it does identify the change as a bug fix. Provide more context about what happens when task language is missing and how this fix prevents the issue from occurring.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: guarding against missing task language values.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@buua436 buua436 added the ci Continue Integration label May 22, 2026
@buua436
buua436 marked this pull request as ready for review May 22, 2026 02:53
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 22, 2026
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (57ddd79) to head (56dab80).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15136      +/-   ##
==========================================
- Coverage   94.53%   93.12%   -1.41%     
==========================================
  Files          10       10              
  Lines         713      713              
  Branches      116      116              
==========================================
- Hits          674      664      -10     
- Misses         25       29       +4     
- Partials       14       20       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wangq8
wangq8 merged commit 04bdb41 into infiniflow:main May 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants