diff --git a/scripts/x/elevate b/scripts/x/elevate index 31b809b..3741243 100755 --- a/scripts/x/elevate +++ b/scripts/x/elevate @@ -44,7 +44,7 @@ def main(): print("usage: elevate -- ", file=sys.stderr) sys.exit(1) - req = json.dumps({"cmd": sys.argv[2], "cwd": os.getcwd(), "env": dict(os.environ)}).encode() + b"\n" + req = json.dumps({"cmd": sys.argv[2], "cwd": os.getcwd()}).encode() + b"\n" sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: diff --git a/scripts/x/elevate-adapter-superpowerd b/scripts/x/elevate-adapter-superpowerd index 3a7a735..b9f0332 100755 --- a/scripts/x/elevate-adapter-superpowerd +++ b/scripts/x/elevate-adapter-superpowerd @@ -345,28 +345,6 @@ def handle(conn): pass -def _wrap_with_env(cmd, env): - """Wrap a command with env vars that differ from the adapter's own env. - - Only exports the delta so the command string stays readable in - superpowerd notifications. Vars that match the session env are - already inherited. - """ - import shlex - adapter_env = os.environ - diff = {} - for k, v in env.items(): - if adapter_env.get(k) != v: - diff[k] = v - if not diff: - return cmd - parts = ["env"] - for k, v in sorted(diff.items()): - parts.append(f"{k}={v}") - parts.extend(["bash", "-c", cmd]) - return " ".join(shlex.quote(p) for p in parts) - - def _handle_inner(conn): data = b"" while chunk := conn.recv(65536): @@ -382,12 +360,6 @@ def _handle_inner(conn): cmd = req.get("cmd", "") cwd = req.get("cwd", os.getcwd()) - env = req.get("env") - - # If the client sent its environment, wrap the command to reproduce it. - # This ensures the elevated command sees the agent's env, not the adapter's. - if env and isinstance(env, dict): - cmd = _wrap_with_env(cmd, env) token = os.environ.get("SUPERPOWERD_SESSION_TOKEN", "")