refactor(usage): final round-6 nits on PR #871
- semantic.py: normalize both None and [] doc_types to null in the metadata so a future `metadata->'doc_types' IS NULL` query counts the all-types case consistently. - test: use a fixed past date in test_occurred_at_roundtrip instead of a future literal (deterministic, no "why this date" confusion). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c89f724585
commit
98de8f331f
@@ -548,10 +548,13 @@ def configure_semantic_tools(mcp: FastMCP):
|
||||
"user_id": username,
|
||||
"fusion": fusion,
|
||||
# Bounded copy — see _USAGE_METADATA_MAX_DOC_TYPES.
|
||||
# Both None and [] normalize to null so a future
|
||||
# metadata->'doc_types' IS NULL query counts the
|
||||
# all-types case consistently.
|
||||
"doc_types": (
|
||||
doc_types[:_USAGE_METADATA_MAX_DOC_TYPES]
|
||||
if doc_types
|
||||
else doc_types
|
||||
else None
|
||||
),
|
||||
},
|
||||
# The outer guard already confirmed the flag, so pass
|
||||
|
||||
Reference in New Issue
Block a user