refactor(cli): remove runner Python dependency

This commit is contained in:
yiling
2026-11-17 18:37:47 +08:00
parent 3e992c0e9d
commit 07e69717e5
12 changed files with 254 additions and 376 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ export SHUMAI_ALLOW_DELETE="true"
## Agent runner
Create a runner in **Settings → Agent Runners** and copy its one-time key. On a macOS or Linux machine with `/bin/bash` and Python 3, start it in an existing dedicated workspace:
Create a runner in **Settings → Agent Runners** and copy its one-time key. On a macOS or Linux machine with `/bin/bash`, start it in an existing dedicated workspace:
```sh
export SHUMAI_API_SERVER="https://shumai.example.com"
+2
View File
@@ -15,11 +15,13 @@
"hono": "4.13.5",
"ulid": "3.0.2",
"ws": "8.22.2",
"yauzl": "3.4.0",
"zod": "4.5.4"
},
"devDependencies": {
"@types/adm-zip": "0.5.8",
"@types/ws": "8.18.2",
"@types/yauzl": "3.4.0",
"adm-zip": "0.6.1"
}
}
+17
View File
@@ -0,0 +1,17 @@
import { constants } from 'node:fs'
import { access, realpath } from 'node:fs/promises'
import path from 'node:path'
export async function findExecutable(name: string): Promise<string> {
for (const directory of (process.env.PATH ?? '').split(path.delimiter)) {
if (!directory) continue
const candidate = path.resolve(directory, name)
try {
await access(candidate, constants.X_OK)
return await realpath(candidate)
} catch {
// Try the next PATH entry.
}
}
throw new Error(`${name} is required on the runner machine and must be available on PATH.`)
}
+4 -24
View File
@@ -1,16 +1,6 @@
import { createHash } from 'node:crypto'
import { createServer, type Server } from 'node:http'
import {
mkdtemp,
mkdir,
readFile,
readdir,
rename,
rm,
stat,
symlink,
writeFile,
} from 'node:fs/promises'
import { mkdtemp, mkdir, readFile, readdir, rm, stat, symlink, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import path from 'node:path'
import AdmZip from 'adm-zip'
@@ -214,18 +204,6 @@ describe('runner workspace file transfers', () => {
await expect(readFile(path.join(cwd, '.pi/skills/bad/link'))).rejects.toThrow()
})
it('keeps writes on the opened directory when a command replaces it with a symlink', async () => {
await mkdir(path.join(cwd, '.pi/work'), { recursive: true })
await mkdir(path.join(cwd, 'outside'))
const writer = await files.createWriter('.pi/work/safe.txt')
await rename(path.join(cwd, '.pi/work'), path.join(cwd, '.pi/held'))
await symlink(path.join(cwd, 'outside'), path.join(cwd, '.pi/work'))
await writer.write('safe contents')
await writer.close()
expect(await readFile(path.join(cwd, '.pi/held/safe.txt'), 'utf8')).toBe('safe contents')
await expect(readFile(path.join(cwd, 'outside/safe.txt'))).rejects.toThrow()
})
it('preserves executable script permissions and rejects oversized ZIP entries', async () => {
const zip = new AdmZip()
zip.addFile('run.sh', Buffer.from('#!/bin/sh\necho executable\n'))
@@ -308,7 +286,9 @@ describe('runner workspace file transfers', () => {
name.startsWith('.shumai-'),
)
expect(temporary).toBeDefined()
expect((await readdir(path.join(cwd, '.pi/skills', temporary!))).length).toBeGreaterThan(0)
expect(
(await readdir(path.join(cwd, '.pi/skills', temporary!, 'extracted'))).length,
).toBeGreaterThan(0)
},
{ interval: 5, timeout: 5000 },
)
+199 -148
View File
@@ -1,24 +1,37 @@
import { Readable, Writable } from 'node:stream'
import { createHash } from 'node:crypto'
import { on } from 'node:events'
import { constants, createWriteStream } from 'node:fs'
import { lstat, mkdir, mkdtemp, open, rename, rm } from 'node:fs/promises'
import path from 'node:path'
import { Readable, Transform } from 'node:stream'
import { pipeline } from 'node:stream/promises'
import { z } from 'zod'
import yauzl from 'yauzl'
import type {
RunnerFileDownloadMessage,
RunnerFileUploadMessage,
RunnerFileStatMessage,
RunnerToServerMessage,
} from '@shumai/dtos'
import { findExecutable, spawnFileHelper } from './filesystem'
const MAX_FILE_BYTES = 256 * 1024 * 1024
const MAX_ZIP_ENTRIES = 10_000
export type FileMessage =
RunnerFileDownloadMessage | RunnerFileUploadMessage | RunnerFileStatMessage
const metadataSchema = z.object({
exists: z.boolean().optional(),
isFile: z.boolean().optional(),
size: z.number().optional(),
name: z.string().optional(),
cached: z.boolean().optional(),
ready: z.boolean().optional(),
})
function pathParts(value: string): string[] {
const parts = value.split('/')
if (
value.includes('\\') ||
value.includes('\0') ||
parts.some((part) => !part || part === '.' || part === '..' || part.includes(':'))
)
throw new Error('Invalid workspace path.')
return parts
}
function isMissing(error: unknown): boolean {
return error instanceof Error && 'code' in error && error.code === 'ENOENT'
}
function transferUrl(address: string): URL {
const url = new URL(address)
@@ -28,146 +41,74 @@ function transferUrl(address: string): URL {
}
export class RunnerFiles {
private python?: Promise<string>
constructor(readonly cwd: string) {}
async initialize() {
await (this.python ??= findExecutable('python3'))
/** Basic workspace validation. Concurrent hostile filesystem mutation is outside v1's scope. */
private async resolve(relative: string, createParents = false): Promise<string> {
const parts = pathParts(relative)
if (parts[0] !== '.pi' || parts.length < 2) throw new Error('File paths must stay inside .pi/.')
let current = this.cwd
for (let index = 0; index < parts.length; index++) {
current = path.join(current, parts[index])
const parent = index < parts.length - 1
if (parent && createParents) await mkdir(current, { recursive: true, mode: 0o700 })
try {
const info = await lstat(current)
if (info.isSymbolicLink() || (parent && !info.isDirectory()))
throw new Error('Workspace paths cannot contain symlinks or non-directory parents.')
} catch (error) {
if (!isMissing(error)) throw error
}
}
return current
}
private async helper(operation: string, relative: string, expectedHash = '') {
await this.initialize()
const child = spawnFileHelper(await this.python!, this.cwd, operation, relative, expectedHash)
const control = child.stdio[3]
if (!(control instanceof Writable)) throw new Error('Missing filesystem commit channel.')
control.on('error', () => {})
if (operation === 'read' || operation === 'stat') control.end()
let stdout = ''
let stderr = ''
// Binary reads are consumed by fetch, all other operations return small JSON metadata.
if (operation !== 'read')
child.stdout.on('data', (chunk: Buffer) => {
stdout = (stdout + chunk.toString()).slice(-8192)
})
let firstLine: (value: string) => void
const ready = new Promise<string>((resolve) => {
firstLine = resolve
})
child.stderr.on('data', (chunk: Buffer) => {
stderr = (stderr + chunk.toString()).slice(-8192)
if (stderr.includes('\n')) firstLine(stderr.split('\n')[0]!)
})
// A failed helper must not produce an unhandled EPIPE while HTTP is still streaming.
child.stdin.on('error', () => {})
const done = new Promise<z.infer<typeof metadataSchema>>((resolve, reject) => {
child.once('error', (error) => {
firstLine('')
reject(error)
})
child.once('close', (code) => {
firstLine(stderr)
if (code !== 0)
reject(new Error(stderr.trim().split('\n').at(-1) || 'Runner file operation failed.'))
else if (operation === 'read') resolve({})
else {
try {
resolve(metadataSchema.parse(JSON.parse(stdout)))
} catch (error) {
reject(error)
}
}
})
})
void done.catch(() => {})
let stopping = false
const stop = () => {
if (stopping || child.exitCode !== null || child.signalCode !== null) return
stopping = true
control.end()
child.stdin.destroy()
child.kill('SIGTERM')
const fallback = setTimeout(() => child.kill('SIGKILL'), 5000)
void done.finally(() => clearTimeout(fallback)).catch(() => {})
}
return { child, done, ready, stop, commit: () => control.end('1') }
}
async createWriter(relative: string, expectedHash = '') {
const task = await this.helper('write', relative, expectedHash)
try {
const metadata = metadataSchema.parse(JSON.parse(await task.ready))
if (!metadata.ready) throw new Error('Runner file writer did not initialize.')
} catch (error) {
task.stop()
await task.done.catch(() => {})
throw error
}
async createWriter(relative: string) {
const file = await open(
await this.resolve(relative, true),
constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW,
0o600,
)
return {
async write(data: string) {
await new Promise<void>((resolve, reject) =>
task.child.stdin.write(data, (error) => {
if (error) reject(error)
else resolve()
}),
)
},
async close() {
task.child.stdin.end()
task.commit()
return await task.done
write: async (data: string) => {
await file.writeFile(data)
},
close: () => file.close(),
}
}
async handle(message: FileMessage, signal: AbortSignal): Promise<RunnerToServerMessage> {
try {
if (message.type === 'file.stat') {
const task = await this.helper('stat', message.srcPath)
task.child.stdin.end()
const result = await task.done
signal.throwIfAborted()
if (message.type === 'file.download')
return {
type: 'file.download.result',
executionId: message.executionId,
ok: true,
...(await this.download(message, signal)),
}
const filename = await this.resolve(message.srcPath)
if (message.type === 'file.upload') return await this.upload(message, filename, signal)
try {
const info = await lstat(filename)
return {
type: 'file.stat.result',
executionId: message.executionId,
ok: true,
exists: result.exists ?? false,
...result,
exists: true,
isFile: info.isFile(),
size: info.size,
name: path.basename(filename),
}
} catch (error) {
if (!isMissing(error)) throw error
return {
type: 'file.stat.result',
executionId: message.executionId,
ok: true,
exists: false,
}
}
if (message.type === 'file.download') {
const response = await fetch(transferUrl(message.url), { signal, redirect: 'error' })
if (!response.ok || !response.body) {
await response.body?.cancel()
throw new Error(`Download failed (HTTP ${response.status}).`)
}
const task = await this.helper(
message.extractZip ? 'extract' : 'write',
message.destPath,
message.expectedHash,
)
const abort = () => {
task.stop()
}
signal.addEventListener('abort', abort, { once: true })
try {
if (signal.aborted) signal.throwIfAborted()
await pipeline(response.body, task.child.stdin, { signal })
signal.throwIfAborted()
task.commit()
return {
type: 'file.download.result',
executionId: message.executionId,
ok: true,
...(await task.done),
}
} catch (error) {
task.stop()
await task.done.catch(() => {})
throw error
} finally {
signal.removeEventListener('abort', abort)
}
}
return await this.upload(message, signal)
} catch (error) {
const result = {
executionId: message.executionId,
@@ -187,20 +128,26 @@ export class RunnerFiles {
private async upload(
message: RunnerFileUploadMessage,
filename: string,
signal: AbortSignal,
): Promise<RunnerToServerMessage> {
const task = await this.helper('read', message.srcPath)
task.child.stdin.end()
const abort = () => {
task.stop()
}
signal.addEventListener('abort', abort, { once: true })
const file = await open(
filename,
constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK,
)
try {
const info = metadataSchema.parse(JSON.parse(await task.ready))
if (!info.isFile || info.size === undefined) throw new Error('Invalid upload file.')
const info = await file.stat()
if (!info.isFile() || info.size > MAX_FILE_BYTES)
throw new Error('Upload must be a regular file no larger than 256 MiB.')
// Node and Bun declare different DOM stream types for the same fetch-compatible stream.
const body = info.size
? (Readable.toWeb(
file.createReadStream({ autoClose: false, end: info.size - 1 }),
) as unknown as ReadableStream<Uint8Array>)
: new Uint8Array()
const response = await fetch(transferUrl(message.url), {
method: 'PUT',
body: Readable.toWeb(task.child.stdout) as unknown as ReadableStream<Uint8Array>,
body,
...{ duplex: 'half' },
headers: {
'content-type': message.contentType ?? 'application/octet-stream',
@@ -211,18 +158,122 @@ export class RunnerFiles {
})
await response.body?.cancel()
if (!response.ok) throw new Error(`Upload failed (HTTP ${response.status}).`)
await task.done
return {
type: 'file.upload.result',
executionId: message.executionId,
ok: true,
size: info.size,
name: info.name,
name: path.basename(filename),
}
} finally {
signal.removeEventListener('abort', abort)
task.stop()
await task.done.catch(() => {})
await file.close()
}
}
private async download(message: RunnerFileDownloadMessage, signal: AbortSignal) {
const destination = await this.resolve(message.destPath, true)
const temporary = await mkdtemp(path.join(path.dirname(destination), '.shumai-'))
let preserveBackup = false
try {
const response = await fetch(transferUrl(message.url), { signal, redirect: 'error' })
if (!response.ok || !response.body) {
await response.body?.cancel()
throw new Error(`Download failed (HTTP ${response.status}).`)
}
const hash = createHash('sha256')
let size = 0
const archive = path.join(temporary, 'download')
await pipeline(
response.body,
new Transform({
transform(chunk: Buffer, _encoding, callback) {
size += chunk.length
if (size > MAX_FILE_BYTES) {
callback(new Error('Download exceeds 256 MiB.'))
return
}
hash.update(chunk)
callback(null, chunk)
},
}),
createWriteStream(archive, { flags: 'wx', mode: 0o600 }),
{ signal },
)
if (message.expectedHash && hash.digest('hex') !== message.expectedHash)
throw new Error('Downloaded file hash does not match.')
let source = archive
if (message.extractZip) {
source = path.join(temporary, 'extracted')
await mkdir(source, { mode: 0o700 })
await this.extract(archive, source, signal)
}
signal.throwIfAborted()
await this.resolve(message.destPath)
if (message.extractZip) {
const backup = path.join(temporary, 'previous')
let backedUp = false
try {
await rename(destination, backup)
backedUp = true
} catch (error) {
if (!isMissing(error)) throw error
}
try {
await rename(source, destination)
} catch (error) {
if (backedUp) {
preserveBackup = true
await rename(backup, destination)
preserveBackup = false
}
throw error
}
} else await rename(source, destination)
return { size, cached: false }
} finally {
if (!preserveBackup) await rm(temporary, { recursive: true, force: true })
}
}
private async extract(archive: string, directory: string, signal: AbortSignal) {
const zip = await new Promise<yauzl.ZipFile>((resolve, reject) =>
yauzl.open(
archive,
{ lazyEntries: true, strictFileNames: true, autoClose: false },
(error, opened) => (error ? reject(error) : resolve(opened)),
),
)
let size = 0
let count = 0
try {
const entries = on(zip, 'entry', { close: ['end'], signal }) as AsyncIterable<[yauzl.Entry]>
zip.readEntry()
for await (const [entry] of entries) {
if (++count > MAX_ZIP_ENTRIES) throw new Error('ZIP contains too many entries.')
const parts = pathParts(entry.fileName.replace(/\/$/, ''))
const mode = entry.externalFileAttributes >>> 16
const kind = mode & 0o170000
if (kind && kind !== 0o100000 && kind !== 0o040000)
throw new Error('ZIP links and special files are forbidden.')
size += entry.uncompressedSize
if (size > MAX_FILE_BYTES) throw new Error('Extracted ZIP exceeds 256 MiB.')
const destination = path.join(directory, ...parts)
if (entry.fileName.endsWith('/')) await mkdir(destination, { recursive: true, mode: 0o700 })
else {
await mkdir(path.dirname(destination), { recursive: true, mode: 0o700 })
const input = await new Promise<Readable>((resolve, reject) =>
zip.openReadStream(entry, (error, stream) => (error ? reject(error) : resolve(stream))),
)
await pipeline(
input,
createWriteStream(destination, { flags: 'wx', mode: 0o600 | (mode & 0o155) }),
{ signal },
)
}
zip.readEntry()
}
} finally {
zip.close()
}
}
}
-192
View File
@@ -1,192 +0,0 @@
import { spawn } from 'node:child_process'
import { constants } from 'node:fs'
import { access, realpath } from 'node:fs/promises'
import path from 'node:path'
import { commandEnv } from './config'
export async function findExecutable(name: string): Promise<string> {
for (const directory of (process.env.PATH ?? '').split(path.delimiter)) {
if (!directory) continue
const candidate = path.resolve(directory, name)
try {
await access(candidate, constants.X_OK)
return await realpath(candidate)
} catch {
/* Try the next PATH entry. */
}
}
throw new Error(`${name} is required on the runner machine and must be available on PATH.`)
}
// Node has no portable openat API. This small, isolated Python helper uses directory
// descriptors for every workspace access, so concurrent shell symlink swaps cannot
// redirect host-side transfers or logs outside the workspace. No network or credentials.
const FILESYSTEM_HELPER = String.raw`
import os, sys, stat, json, hashlib, tempfile, zipfile, secrets, signal
MAX = 256 * 1024 * 1024
FLAGS = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW
def cancelled(signum, frame): raise InterruptedError('File transfer aborted.')
signal.signal(signal.SIGTERM, cancelled)
root = os.open(sys.argv[1], FLAGS)
operation, relative = sys.argv[2:4]
def components(value):
parts = value.split('/')
if chr(92) in value or chr(0) in value or any(not p or p in ('.', '..') or ':' in p for p in parts):
raise ValueError('Invalid workspace path.')
return parts
def parent_at(base, parts, create=False):
current = os.dup(base)
try:
for part in parts[:-1]:
if create:
try: os.mkdir(part, 0o700, dir_fd=current)
except FileExistsError: pass
following = os.open(part, FLAGS, dir_fd=current)
os.close(current)
current = following
return current, parts[-1]
except BaseException:
os.close(current)
raise
def remove_at(parent, name):
try: info = os.stat(name, dir_fd=parent, follow_symlinks=False)
except FileNotFoundError: return
if stat.S_ISDIR(info.st_mode):
child = os.open(name, FLAGS, dir_fd=parent)
try:
for entry in os.listdir(child): remove_at(child, entry)
finally: os.close(child)
os.rmdir(name, dir_fd=parent)
else: os.unlink(name, dir_fd=parent)
def commit():
if os.read(3, 1) != b'1': raise InterruptedError('File transfer was not committed.')
def publish_directory(parent, temporary, name):
backup = '.shumai-' + secrets.token_hex(16)
backed_up = False
published = False
mask = signal.pthread_sigmask(signal.SIG_BLOCK, {signal.SIGTERM})
try:
try:
os.rename(name, backup, src_dir_fd=parent, dst_dir_fd=parent)
backed_up = True
except FileNotFoundError: pass
try:
os.replace(temporary, name, src_dir_fd=parent, dst_dir_fd=parent)
published = True
except BaseException:
if backed_up:
os.rename(backup, name, src_dir_fd=parent, dst_dir_fd=parent)
backed_up = False
raise
finally:
try: signal.pthread_sigmask(signal.SIG_SETMASK, mask)
finally:
if backed_up and published: remove_at(parent, backup)
def copy_input(destination, expected):
digest, size = hashlib.sha256(), 0
while True:
chunk = sys.stdin.buffer.read(65536)
if not chunk: break
size += len(chunk)
if size > MAX: raise ValueError('Download exceeds 256 MiB.')
digest.update(chunk)
destination.write(chunk)
if expected and digest.hexdigest() != expected: raise ValueError('Downloaded file hash does not match.')
return size
try:
parts = components(relative)
if parts[0] != '.pi' or len(parts) < 2: raise ValueError('File paths must stay inside .pi/.')
parent, name = parent_at(root, parts, operation in ('write', 'extract'))
try:
if operation in ('stat', 'read'):
try: fd = os.open(name, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=parent)
except FileNotFoundError:
if operation != 'stat': raise
print(json.dumps({'exists': False}))
sys.exit(0)
try:
info = os.fstat(fd)
metadata = {'exists': True, 'isFile': stat.S_ISREG(info.st_mode), 'size': info.st_size, 'name': name}
if operation == 'stat': print(json.dumps(metadata))
else:
if not stat.S_ISREG(info.st_mode) or info.st_size > MAX: raise ValueError('Upload must be a regular file no larger than 256 MiB.')
print(json.dumps(metadata), file=sys.stderr, flush=True)
with os.fdopen(os.dup(fd), 'rb') as source:
remaining = info.st_size
while remaining:
chunk = source.read(min(65536, remaining))
if not chunk: raise ValueError('File changed during upload.')
sys.stdout.buffer.write(chunk)
remaining -= len(chunk)
finally: os.close(fd)
else:
# A private sibling staging entry is published only after validation.
temporary = '.shumai-' + secrets.token_hex(16)
try:
if operation == 'extract':
os.mkdir(temporary, 0o700, dir_fd=parent)
target = os.open(temporary, FLAGS, dir_fd=parent)
try:
with tempfile.TemporaryFile() as archive:
size = copy_input(archive, sys.argv[4])
archive.seek(0)
with zipfile.ZipFile(archive) as zip:
entries = zip.infolist()
if len(entries) > 10000: raise ValueError('ZIP contains too many entries.')
if sum(entry.file_size for entry in entries) > MAX: raise ValueError('Extracted ZIP exceeds 256 MiB.')
for entry in entries:
mode = entry.external_attr >> 16
kind = stat.S_IFMT(mode)
if kind not in (0, stat.S_IFREG, stat.S_IFDIR): raise ValueError('ZIP links and special files are forbidden.')
entry_parent, entry_name = parent_at(target, components(entry.filename.rstrip('/')), True)
try:
if entry.is_dir():
try: os.mkdir(entry_name, 0o700, dir_fd=entry_parent)
except FileExistsError: pass
else:
fd = os.open(entry_name, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600 | (mode & 0o155), dir_fd=entry_parent)
with os.fdopen(fd, 'wb') as output, zip.open(entry) as source:
copied = 0
while True:
chunk = source.read(65536)
if not chunk: break
copied += len(chunk)
if copied > entry.file_size: raise ValueError('Invalid ZIP entry size.')
output.write(chunk)
finally: os.close(entry_parent)
finally: os.close(target)
commit()
publish_directory(parent, temporary, name)
elif operation == 'write':
fd = os.open(temporary, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600, dir_fd=parent)
print(json.dumps({'ready': True}), file=sys.stderr, flush=True)
with os.fdopen(fd, 'wb') as output: size = copy_input(output, sys.argv[4])
else: raise ValueError('Unknown file operation.')
if operation == 'write':
commit()
os.replace(temporary, name, src_dir_fd=parent, dst_dir_fd=parent)
print(json.dumps({'size': size, 'cached': False}))
finally: remove_at(parent, temporary)
finally: os.close(parent)
except FileNotFoundError:
if operation == 'stat': print(json.dumps({'exists': False}))
else: print('File or directory not found.', file=sys.stderr); sys.exit(1)
except BaseException as error:
if isinstance(error, SystemExit): raise
print(str(error), file=sys.stderr)
sys.exit(1)
finally: os.close(root)
`
export function spawnFileHelper(
python: string,
cwd: string,
operation: string,
relative: string,
expectedHash = '',
) {
return spawn(python, ['-I', '-c', FILESYSTEM_HELPER, cwd, operation, relative, expectedHash], {
env: commandEnv(),
stdio: ['pipe', 'pipe', 'pipe', 'pipe'],
})
}
+15
View File
@@ -23,6 +23,21 @@ describe('runner bash execution', () => {
command,
})
it('runs with no executables on PATH when SRT is not requested', async () => {
vi.stubEnv('PATH', '')
await shell.initialize()
let output = ''
const result = await shell.run(
request('printf no-extra-runtime'),
new AbortController().signal,
(_stream, data) => {
output += data
},
)
expect(result).toMatchObject({ exitCode: 0 })
expect(output).toBe('no-extra-runtime')
})
it('streams both outputs, returns the exit code, and saves a log in the runner workspace', async () => {
const output: string[] = []
const result = await shell.run(
+1 -2
View File
@@ -6,7 +6,7 @@ import path from 'node:path'
import type { RunnerExecResultMessage, RunnerExecStartMessage } from '@shumai/dtos'
import { commandEnv } from './config'
import { RunnerFiles } from './files'
import { findExecutable } from './filesystem'
import { findExecutable } from './executable'
const MAX_OUTPUT_BYTES = 64 * 1024 * 1024
const MAX_TIMEOUT_SEC = 3600
@@ -21,7 +21,6 @@ export class RunnerShell {
) {}
async initialize() {
await this.files.initialize()
if (!this.srtPath) return
// Snapshot once: a command editing the source config cannot weaken later commands.
this.settings = await readFile(this.srtPath, 'utf8')