PAD-12: per-terminal transport (direct Tailscale SSH or Warpgate, pre-session fallback, pinned host keys, agent key from Vault), one-call win10 launch and one-call collect, remote call timings, agentd ping
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Shell/script executor: runs `{script}` with the prompt on stdin. The last message is `last.md` in the run
|
||||
directory if the script wrote it (its path is passed as {out}), else the tail of stdout. No threads."""
|
||||
from .base import ExecResult, RunnerExecutor
|
||||
from .base import ExecResult, RunnerExecutor, parse_exit
|
||||
|
||||
|
||||
class ShellExecutor(RunnerExecutor):
|
||||
@@ -10,10 +10,11 @@ class ShellExecutor(RunnerExecutor):
|
||||
def resume(self):
|
||||
return False
|
||||
|
||||
COLLECT = [("read", "exit.txt"), ("read", "last.md"), ("read", "stdout.txt"), ("tail", "stderr.txt", 5)]
|
||||
|
||||
def collect(self, handle):
|
||||
t, d = self.transport, handle["run_dir"]
|
||||
last = t.read_text(t.join(d, "last.md"))
|
||||
exit_text, last, stdout, tail = self.fetch(handle, self.COLLECT) # one remote call
|
||||
if last is None:
|
||||
last = (t.read_text(t.join(d, "stdout.txt")) or "")[-6000:]
|
||||
return ExecResult(last.strip(), self.exit_code(handle), None,
|
||||
self.logs(handle, "stdout.txt", "stderr.txt"), self.stderr_tail(handle))
|
||||
last = (stdout or "")[-6000:]
|
||||
return ExecResult(last.strip(), parse_exit(exit_text), None,
|
||||
self.logs(handle, "stdout.txt", "stderr.txt"), tail)
|
||||
|
||||
Reference in New Issue
Block a user