Skip to content

Fix: topic_segment=False no longer skips memory pipeline + defensive fixes#63

Open
keketcl wants to merge 3 commits into
zjunlp:mainfrom
keketcl:fix-topic-segment-false
Open

Fix: topic_segment=False no longer skips memory pipeline + defensive fixes#63
keketcl wants to merge 3 commits into
zjunlp:mainfrom
keketcl:fix-topic-segment-false

Conversation

@keketcl

@keketcl keketcl commented May 29, 2026

Copy link
Copy Markdown

Summary

Fix topic_segment=False not creating any memories, plus additional improvements.

Note: This PR builds on top of PR #59 (Fix: topic_segment=False), adding docstring updates, comment cleanup, and a defensive bug fix that was exposed by PR #59's original change.

Changes

From PR #59 (preserved)

Bug 1 (critical): topic_segment=False skipped entire memory pipeline — fix replaces early return with single-segment fallback.

Bug 2 (guard): force_segment=True + topic_segment=False crashed due to uninitialized segmenter — fix adds guard condition.

Added in this PR

Bug 3 (defensive init): When metadata_generate=False or text_summary=False, the extracted_results variable was never assigned, causing NameError. This was previously hidden by Bug 1's early return and exposed after PR #59's fix removed that early return.

Fix: Initialize extracted_results = [] before the conditional block.

Doc improvements

  • Update add_memory docstring to reflect new behavior (single-segment fallback, no early return)
  • Update Notes section: remove outdated "returns early" description
  • Update Returns section: remove outdated segmentation result dict format
  • Simplify inline comments to concise project-style English

Testing

Tested with topic_segment=False + metadata_generate=False + text_summary=False:

  • Full pipeline executed without crash
  • Returns empty result gracefully
  • Module import and initialization verified in conda environment

Copilot AI review requested due to automatic review settings May 29, 2026 13:15
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.

2 participants