Skip to content

docs: fix two docstrings documenting non-existent parameters - #2392

Closed
simpleqt wants to merge 1 commit into
MemTensor:mainfrom
simpleqt:sq919/docstring-phantoms
Closed

simpleqt wants to merge 1 commit into
MemTensor:mainfrom
simpleqt:sq919/docstring-phantoms

Conversation

@simpleqt

Copy link
Copy Markdown

AST-verified mismatches:

  1. RedisPersistentUserManager.init(host, port, password, db, decode_responses) — the docstring's Args section starts with user_id (str, optional): User ID. Defaults to 'root'. — no such parameter (it is a leftover from an earlier API). Dropped.
  2. concat_original_source(graph_results, rerank_source) — the docstring documented merge_field (List[str]), which is a local variable inside the function, and omitted the real rerank_source parameter. Documented rerank_source (comma-separated metadata field names; defaults to the sources field when None).

Docs-only change.

Related Issue: N/A (docs-only fix)

- RedisPersistentUserManager.__init__ takes host/port/password/db/
  decode_responses; the docstring's 'user_id' entry is a leftover
- concat_original_source takes graph_results/rerank_source; the docstring
  documented 'merge_field' (a local variable) and omitted rerank_source
Copilot AI lite review requested due to automatic review settings September 19, 2026 08:02
@Memtensor-AI Memtensor-AI added area:core MOS 编排层 / 框架底座 / 跨模块问题 status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Sep 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

🤖 Open Code Review

Target: PR #2392
Task: 807bc33a8bca71b2
Base: main
Head: sq919/docstring-phantoms

✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (3/3 executed). memos_python_core/changed-python-source: 3/3. Duration: 8s

Branch: sq919/docstring-phantoms

@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Sep 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale due to inactivity.

@github-actions github-actions Bot added the status:stale Auto-marked stale after 30d inactivity; closes 7d later unless exempt. label Oct 21, 2026
RerankerGuo added a commit to RerankerGuo/MemOS that referenced this pull request Oct 27, 2026
…#2392)

Two public docstrings documented parameters that the AST no longer
exposes:

1. `RedisPersistentUserManager.__init__` listed `user_id (str, optional):`
   as the first Args entry, but the signature is `(host, port, password,
   db, decode_responses)` — `user_id` is a leftover from an earlier API.
   Removed the phantom line.

2. `concat_original_source` listed `merge_field (List[str]): List of fields
   to merge`, which is actually a local variable inside the function, and
   omitted the real `rerank_source` parameter (the comma-separated metadata
   field names that the function actually accepts). Rewrote the docstring
   with both `graph_results` and `rerank_source` documented, with their
   actual semantics.

To prevent the same kind of drift from sneaking back in, this commit also
adds tests/test_docstring_signature_parity.py: it parses each function's
source file, extracts the parameter list from the AST, extracts the
`Args:` block parameter names from the docstring, and asserts the two
sets match. The check works around the `@require_python_package`
decorator that rewrites `__code__`, so it sees the real `__init__`
signature rather than the wrapper's.

Docs-only functional change; the parity test is the regression guard.

Fixes MemTensor#2392.
@simpleqt simpleqt closed this Oct 31, 2026
RerankerGuo added a commit to RerankerGuo/MemOS that referenced this pull request Nov 4, 2026
…#2392)

Two public docstrings documented parameters that the AST no longer
exposes:

1. `RedisPersistentUserManager.__init__` listed `user_id (str, optional):`
   as the first Args entry, but the signature is `(host, port, password,
   db, decode_responses)` — `user_id` is a leftover from an earlier API.
   Removed the phantom line.

2. `concat_original_source` listed `merge_field (List[str]): List of fields
   to merge`, which is actually a local variable inside the function, and
   omitted the real `rerank_source` parameter (the comma-separated metadata
   field names that the function actually accepts). Rewrote the docstring
   with both `graph_results` and `rerank_source` documented, with their
   actual semantics.

To prevent the same kind of drift from sneaking back in, this commit also
adds tests/test_docstring_signature_parity.py: it parses each function's
source file, extracts the parameter list from the AST, extracts the
`Args:` block parameter names from the docstring, and asserts the two
sets match. The check works around the `@require_python_package`
decorator that rewrites `__code__`, so it sees the real `__init__`
signature rather than the wrapper's.

Docs-only functional change; the parity test is the regression guard.

Fixes MemTensor#2392.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core MOS 编排层 / 框架底座 / 跨模块问题 status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 status:stale Auto-marked stale after 30d inactivity; closes 7d later unless exempt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants