Skip to content

docs: document the tenant_id parameter in resume parsing - #18169

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
iridescentWen:fix/resume-docstring-tenant-id
Aug 12, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
iridescentWen:fix/resume-docstring-tenant-id

Conversation

@iridescentWen

Copy link
Copy Markdown
Contributor

Second ragflow PR (#17639 merged 2026-07-31). Docstrings only, no behavior change.

What's wrong

Three functions in rag/app/resume.py document every parameter except tenant_id — and
tenant_id is the one that decides which tenant's chat model serves the request, so it is the least
guessable of the set:

Function Args section lists Omits What tenant_id actually does there
_call_llm (:1037) prompt, lang tenant_id :1057 LLMBundle(tenant_id, LLMType.CHAT, lang=lang) — it selects the model
parse_with_llm (:1285) indexed_text, lines, lang tenant_id :1305-1308 forwards it to all four parallel extraction subtasks
parse_resume (:2062) filename, binary, lang tenant_id :2078 forwards it to parse_with_llm

Each docstring is otherwise complete, so the omission reads as an oversight from when tenant_id
was threaded through, not as a deliberate style choice.

I traced each one to the line that uses the value rather than paraphrasing the parameter name —
that is where "selects the tenant's chat model" comes from (_call_llm → LLMBundle(..., LLMType.CHAT)),
not from the name looking like a tenant id.

Deliberately not touched

chunk() (:2479) also takes tenant_id and its Args section does not list it separately — but
that one is intentional and I left it alone.
Its **kwargs entry reads:

**kwargs: Other parameters (parser_config, kb_id, tenant_id, etc.)

so the author folded tenant_id into the kwargs description. My scanner flagged it; reading the
docstring showed the flag was wrong. Changing it would be a style argument, not a defect fix.

Validation

$ python3 -c "import ast; ast.parse(open('rag/app/resume.py').read())"   # parses clean
$ ruff check rag/app/resume.py --line-length 200                          # 0 findings on this file

Ruff output is byte-identical before and after the change (verified by stashing the diff and
re-running), so nothing here introduces a lint finding. The one >200-char line in this file
(:1980) is pre-existing and untouched.

git diff --stat: rag/app/resume.py | 3 +++ — three added lines, no deletions.


🤖 Written with Claude Code. Each site was opened and read, and
each description was checked against the line that consumes the value.

Three functions in rag/app/resume.py document every parameter except
tenant_id, which is the one that selects the tenant's chat model:

- _call_llm            builds LLMBundle(tenant_id, LLMType.CHAT, ...)
- parse_with_llm       forwards it to all four extraction subtasks
- parse_resume         forwards it to parse_with_llm

Docstrings only; no behavior change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 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 Plus

Run ID: 45b66d6c-2cd7-4f70-93b7-366666b7a0e7

📥 Commits

Reviewing files that changed from the base of the PR and between eada2f6 and 4ce9084.

📒 Files selected for processing (1)
  • rag/app/resume.py

📝 Walkthrough

Walkthrough

The change adds tenant_id usage details to three docstrings in rag/app/resume.py. Function signatures and runtime behavior remain unchanged.

Changes

Resume tenant documentation

Layer / File(s) Summary
Document tenant_id propagation
rag/app/resume.py
The docstrings describe how _call_llm, parse_with_llm, and parse_resume use or forward tenant_id during LLM extraction.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A rabbit reads the notes with care,
tenant_id now shines there.
No code hops, no flows rearrange,
Just clearer words explain the change.
Ears perk up: docs are fair!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the documentation change, its purpose, scope, and validation, although it does not use the template's Summary heading.
Title check ✅ Passed The title clearly and concisely describes the documentation change to the tenant_id parameter in resume parsing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@JinHai-CN JinHai-CN added the ci Continue Integration label Aug 12, 2026
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (eada2f6) to head (4ce9084).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18169   +/-   ##
=======================================
  Coverage   90.65%   90.65%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          650      650           
  Misses         39       39           
  Partials       28       28           

☔ View full report in Codecov by Harness.
📢 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.

@JinHai-CN
JinHai-CN merged commit a0cc2be into infiniflow:main Aug 12, 2026
6 checks 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