Skip to content

fix: remove duplicate cache variable declarations in mcp_server.py#449

Merged
bensig merged 1 commit intoMemPalace:developfrom
sjhddh:fix/remove-duplicate-cache-declarations
Apr 12, 2026
Merged

fix: remove duplicate cache variable declarations in mcp_server.py#449
bensig merged 1 commit intoMemPalace:developfrom
sjhddh:fix/remove-duplicate-cache-declarations

Conversation

@sjhddh
Copy link
Copy Markdown
Contributor

@sjhddh sjhddh commented Apr 9, 2026

Summary

  • Lines 103-104 of mempalace/mcp_server.py contained redundant re-declarations of _client_cache = None and _collection_cache = None, which are already defined as module-level globals at lines 66-67.
  • This is likely a merge or copy-paste artifact. Removed the duplicates.

Test plan

  • Verify existing tests pass (no behavioral change expected)

🤖 Generated with Claude Code

Copy link
Copy Markdown

@web3guru888 web3guru888 left a comment

Choose a reason for hiding this comment

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

Clean fix — removing the re-declarations at lines 103-104 that shadow the module-level globals at 66-67 is correct. Since _get_client() and _get_collection() reference them via global, the shadowed re-init was a no-op anyway, but keeping a single source of truth is the right call.

One thing to double-check: make sure no import or test was relying on those lines being at that offset (e.g., a monkeypatch targeting a specific line range) — unlikely given it's a module-level None assignment, but worth a grep.

LGTM — straightforward cleanup, no behavioral change.

🔭 Reviewed as part of the MemPalace-AGI integration project — autonomous research with perfect memory. Community interaction updates are posted regularly on the dashboard.

@bensig bensig changed the base branch from main to develop April 11, 2026 22:22
Copy link
Copy Markdown
Collaborator

@bensig bensig left a comment

Choose a reason for hiding this comment

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

Code review + security audit clean.

@bensig bensig merged commit d82bbe7 into MemPalace:develop Apr 12, 2026
jphein added a commit to jphein/mempalace that referenced this pull request Apr 12, 2026
…n conflicts

Merge upstream/develop: MemPalace#177, MemPalace#361, MemPalace#449, MemPalace#450 (benchmarks, tilde expand,
duplicate cache vars, test fixture cleanup).

Merge upstream/main: MemPalace#666 (z3tz3r0's block reason disambiguation).
Conflict resolution: keep our scoped "For THIS save" phrasing instead of
MemPalace#666's absolute "Do NOT write to auto-memory" — both memory systems are
used in tandem. Also drop "AAAK-compressed" from diary instructions since
diary_write is plain text, not AAAK dialect.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

3 participants