elevate: move adapter auto-start from sandboxed client to Go server

Remove _start_adapter() from x/elevate (ran inside sandbox, could not
function). The Go executeElevated() now calls ensureElevateAdapter()
which runs outside the sandbox and can properly start the adapter.

core: update submodule.
This commit is contained in:
Ollie Agent 2026-07-19 11:34:05 +02:00
parent e47bb9e2ff
commit 2e55e30795
2 changed files with 4 additions and 30 deletions

2
core

@ -1 +1 @@
Subproject commit 6f35059d83653328a0cead1df414f2f1192faa45
Subproject commit 519869a00360ffb8b6ff5e2e21902d84d937e271

View File

@ -37,23 +37,6 @@ def recv_exact(sock, n):
return buf
def _start_adapter():
"""Try to start the elevate adapter in the background."""
import subprocess
import time
cfg = os.environ.get("OLLIE_CFG_PATH") or os.path.expanduser("~/.config/ollie")
start_script = os.path.join(cfg, "scripts", "x", "elevate-adapter-start")
if not os.path.exists(start_script):
return False
try:
subprocess.run([start_script], timeout=5, capture_output=True)
except (subprocess.TimeoutExpired, OSError):
return False
# Wait briefly for socket to appear
time.sleep(0.3)
return True
def main():
sock_path = os.environ.get("OLLIE_ELEVATE_SOCKET") or default_socket_path()
@ -66,18 +49,9 @@ def main():
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
try:
sock.connect(sock_path)
except OSError:
# Adapter not running — try to start it and retry
if _start_adapter():
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
try:
sock.connect(sock_path)
except OSError as e:
print(f"elevate: connect {sock_path}: {e} (after adapter start)", file=sys.stderr)
sys.exit(1)
else:
print(f"elevate: connect {sock_path}: adapter not running and failed to start", file=sys.stderr)
sys.exit(1)
except OSError as e:
print(f"elevate: connect {sock_path}: [Errno {e.errno}] {e.strerror}", file=sys.stderr)
sys.exit(1)
with sock:
sock.sendall(req)