_build_kb_mcp_server() returns a 3-tuple (server, tool_names,
tools_by_name) on its normal path, and all three call sites unpack
three values. But the early return for the "no KB attached" case still
returned a 2-tuple (None, []), so every message sent without a knowledge
base attached raised:
ValueError: not enough values to unpack (expected 3, got 2)
Return (None, [], {}) instead, and update the docstring to match.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The SDK pipe hardcoded setting_sources=[], so chats never loaded
~/.claude/CLAUDE.md or any settings.json. Expose it as a valve
(default empty = isolated baseline) so single-user/homelab instances
can opt into persistent context, while shared deployments keep the
safe default.
Parse via _parse_setting_sources(): comma-split, lowercase, drop
unknown tokens so a typo can't silently widen inheritance. README
documents the opt-in plus the hooks/permissions security tradeoff
(CLAUDE.md and settings.json load together — a Claude Code coupling)
and why the valve does not apply to the sandboxed pipe.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>