fix: compose — correct operator precedence in update_env_var apply branch

The apply-side match condition was parsed as
  `(isinstance AND startswith) OR (entry == var_name)`
which evaluated the equality branch for non-string entries, diverging
from the preview-side detection logic just above. Adding parentheses
around the two string-match clauses aligns apply with preview (M1).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-21 09:38:56 +02:00
parent 21fd8e168c
commit 72d5e13d59
@@ -272,7 +272,9 @@ def register_compose(mcp: FastMCP, config: AppConfig, client: DsmClient) -> None
new_entry = f"{var_name}={var_value}"
updated = False
for i, entry in enumerate(env_list):
if isinstance(entry, str) and entry.startswith(f"{var_name}=") or entry == var_name:
if isinstance(entry, str) and (
entry.startswith(f"{var_name}=") or entry == var_name
):
env_list[i] = new_entry
updated = True
break