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:
@@ -272,7 +272,9 @@ def register_compose(mcp: FastMCP, config: AppConfig, client: DsmClient) -> None
|
|||||||
new_entry = f"{var_name}={var_value}"
|
new_entry = f"{var_name}={var_value}"
|
||||||
updated = False
|
updated = False
|
||||||
for i, entry in enumerate(env_list):
|
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
|
env_list[i] = new_entry
|
||||||
updated = True
|
updated = True
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user