4651ac64a1
Follow-up to the salvaged SSH-tilde-cwd fix. The predicate "backend == ssh and (cwd == ~ or cwd.startswith(~/))" was inlined at each expanduser guard site, which is how the test simulator drifted from production (it grew an SSH guard on a top-level-alias branch that has no production counterpart). - Add tools/terminal_tool._is_ssh_remote_tilde_cwd(backend, cwd) as the single source of truth (case/whitespace-tolerant). - Use it in _get_env_config and the gateway config bridge. - Test simulator imports the real helper instead of re-implementing the predicate; revert the phantom SSH guard on the top-level-alias branch (production maps top-level cwd: to a plain env var, not TERMINAL_CWD via an SSH-guarded path — that branch tested nothing real).