Fix hash comparison in get_tool_publish_state
Use raw config for hash comparison instead of to_dict(), which was adding fields like 'arguments: []' that weren't in the original config. This caused tools to show as "modified" when they weren't. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
19c1cf086f
commit
23c42faf75
|
|
@ -118,13 +118,8 @@ def get_tool_publish_state(tool_name: str) -> Tuple[str, Optional[str]]:
|
|||
if not registry_hash:
|
||||
return ("local", None)
|
||||
|
||||
# Compute hash the same way as publish: load Tool object and use to_dict()
|
||||
# This ensures we compare the same normalized representation
|
||||
tool = load_tool(tool_name)
|
||||
if tool:
|
||||
current_hash = compute_config_hash(tool.to_dict())
|
||||
else:
|
||||
# Fallback to raw config if Tool can't be loaded
|
||||
# Compute hash from raw config, same as server does during publish
|
||||
# Don't use to_dict() as it may add/remove fields (e.g., empty arguments: [])
|
||||
current_hash = compute_config_hash(config)
|
||||
|
||||
if current_hash != registry_hash:
|
||||
|
|
|
|||
Loading…
Reference in New Issue