Merge pull request #1737 from Sathvik-1007/fix/1621-update-drawer-room-casing

fix(mcp): preserve room/wing casing on case-only update
This commit is contained in:
Igor Lins e Silva 2026-06-10 07:24:07 -03:00 committed by GitHub
commit ad67c1a121
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 2 deletions

View File

@ -1923,14 +1923,22 @@ def tool_update_drawer(drawer_id: str, content: str = None, wing: str = None, ro
new_meta = dict(old_meta)
if wing is not None:
try:
new_meta["wing"] = sanitize_name(wing, "wing")
wing = sanitize_name(wing, "wing")
except ValueError as e:
return {"success": False, "error": str(e)}
# Preserve existing casing when the caller passes a case-only
# variant (LLM clients often "autocorrect" acronyms like ps5→PS5).
if wing.lower() != str(old_meta.get("wing") or "").lower():
new_meta["wing"] = wing
if room is not None:
try:
new_meta["room"] = sanitize_name(room, "room")
room = sanitize_name(room, "room")
except ValueError as e:
return {"success": False, "error": str(e)}
# Preserve existing casing when the caller passes a case-only
# variant (LLM clients often "autocorrect" acronyms like ps5→PS5).
if room.lower() != str(old_meta.get("room") or "").lower():
new_meta["room"] = room
_wal_log(
"update_drawer",