warpgate-ssh: remote Linux/macOS terminals through the relay; oregon launched remotely

The dispatcher moves to an LXC without agent CLIs (design 9), so every terminal is
reached through Warpgate. The relay call (agent-access.py run --target <t>) lives in
one helper; the target comes from the terminal config.

os linux/darwin (PosixWarpgateTransport): each primitive is one bash -c call. Files
go up as base64 (chunked above 60k), start_run stages prompt.md + run.sh and launches
in a single round trip; the runner is detached with setsid nohup (pid == pgid == sid,
$! kept in launch.pid); kill signals the process group and session (TERM, then KILL),
skipped once exit.txt exists. macOS detaches with perl POSIX::setsid.

os windows keeps the win10-ps.sh / win10-put.sh helper scripts (target win10) and
schtasks, now through the shared call() helper.

oregon is now warpgate-ssh (target oregon, run_root ~/.gwent-board/agentd-runs);
the local transport stays for co-located setups and tests.
This commit is contained in:
jj.wang
2026-10-21 08:08:01 +00:00
parent f2f7e4308a
commit dc8271a06a
9 changed files with 490 additions and 45 deletions
+8 -5
View File
@@ -87,13 +87,16 @@ class RunnerExecutor(Executor):
def start(self, run):
t = self.transport
run_dir = t.join(self.run_root(), run.run_id)
t.mkdir(run_dir, clean=True)
t.write_text(t.join(run_dir, "prompt.md"), run.prompt)
script_name, script = t.runner(run_dir, run.repo, self.command(run, run_dir), self.stdout_name)
script_path = t.join(run_dir, script_name)
t.write_text(script_path, script)
task = "agentd-" + run.run_id
t.launch(task, script_path, run_dir)
files = {"prompt.md": run.prompt, script_name: script}
if hasattr(t, "start_run"): # remote POSIX: stage + launch in one relay round trip
t.start_run(task, run_dir, files, script_name)
else:
t.mkdir(run_dir, clean=True)
for name, text in files.items():
t.write_text(t.join(run_dir, name), text)
t.launch(task, t.join(run_dir, script_name), run_dir)
return {"run_dir": run_dir, "task": task, "thread_id": run.thread_id}
def poll(self, handle):