Hold backup and remote-train host output and pulls to a size #200
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cap-host-output"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
backupandremote-trainnow hold what a backup or training host sends back to a size.New
hostrunplugin library (plugins/_lib_hostrun.py, API 0.1, provisional)run(cmd, input=, timeout=, limit=)runs a command in its own session and keeps at most 64 KB of each of stdout and stderr.sshunderrsync, say), andtruncatedis set.subprocess.runraises, so callers keep theirexceptclauses.remote-trainsshandrsyncgoes throughhostrun. A truncated result is a failure ("the host sent more output than expected").rsync -tz --max-size(64 KB for a sidecar, 256 MB for a model) instead of-az, so a directory or link in its place is skipped._read_jsonopens without blocking and reads only a regular file within its size: 64 KB for a pulled sidecar, 1 MB for the plugin's own files.backuprsync,scpand thessh mkdirgo throughhostrun. A truncated result is a failure on the card.Checklist
tests/test_hostrun_lib.py(real child processes):_read_jsonrefuses large files, FIFOs and folders;subprocess.runorcapture_outputany more.hostrun.runinstead ofsubprocess.run.test_web.pythat fail locally on main too (local werkzeug).plugin-libraries.md(table and ahostrunsection),remote-training.md(bounded pulls), CLAUDE.md.Release impact
plugins/*.pyonly (the new library is aplugins/_lib_*.pyfile, which the engine installs like any plugin), plus tests and docs.Notes for review
Nothing changes for a working host: status lines, error messages and rsync's
--statsare far below 64 KB, and a Kestrel model is a few MB. The 256 MB model limit is generous on purpose.🤖 Generated with Claude Code