components/execd 1.0.19
What's New
✨ Features
-
PTY session takeover for device handoff. New
?takeover=1query parameter onGET /pty/:sessionId/wslets a second client reclaim a live PTY session instead of getting409 ALREADY_CONNECTED. The existing holder is evicted with close code4001(TAKEN_OVER), the shell process keeps running untouched, and the new client can replay scrollback via?since=<offset>for seamless screen restore. Enables desktop ⇄ mobile session handoff without restarting the shell. Fully backward compatible — without the flag, behavior is unchanged. (#997) -
PTY custom command execution.
POST /ptynow accepts an optionalcommandfield. When set, the PTY session runsbash -c <command>for one-shot terminal I/O instead of an interactive shell. When omitted, behavior is unchanged (interactive bash). (#1032) -
Directory listing endpoint. New
GET /directories/listendpoint withdepth-controlled directory traversal (defaultdepth=1for immediate children). Also adds atypefield (file,directory,symlink,other) toFileInforesponses —/files/infonow usesLstatso symlinks are reported as symlinks instead of being resolved to their target type. Supported across all five SDKs. (#1001) -
Line-based file reading.
GET /files/downloadnow supportsoffset(1-based line number) andlimit(line count) query parameters for line-based reads, mutually exclusive with the existingRangeheader. Uses streamingbufio.Readerwithout buffering the entire file. Updated across OpenAPI spec and all SDKs. (#1030) -
Replace file content feedback.
POST /files/replacenow returns areplacedCountper file, so callers can detect no-match (replacedCount=0) and multi-match scenarios. Response going from empty body to JSON is non-breaking; old SDKs ignoring the body continue to work. Updated across all SDKs and MCP server. (#991) -
OTLP endpoint auto-discovery. When neither
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTnorOTEL_EXPORTER_OTLP_ENDPOINTis set, execd now resolves the node IP fromHOST_IPenv var or/etc/hostinfoand points the OTLP/HTTP exporter at<node-ip>:4318. Eliminates the need for callers to template the full endpoint URL. (#963) -
Supervisor binary in container image. The
opensandbox-supervisorbinary (built fromcomponents/internal/cmd/supervisor) is now included in the execd runtime image for future process management use. (#1056)
🐛 Bug Fixes
-
GET /files/infonow returns 404 for missing paths instead of 500. Two cooperating bugs —fmt.Errorfusing%sinstead of%w(stripping theos.ErrNotExistsentinel) andos.IsNotExistnot walking wrapped errors — made the 404 branch inhandleFileErrorunreachable. Both fixed. (#1026) -
POST /files/mvnow returns 404 for missing source instead of 500. Same sentinel-stripping pattern as #1026 inRenameFile—%s→%wfixes the error chain sohandleFileErrorreaches its 404 branch. (#1028) -
MakeDirno longer chmod/chown pre-existing directories. PreviouslyMakeDirappliedChmodFileunconditionally, which could change permissions on directories that already existed. Now checks existence first and only applies permissions to newly created dirs.SetFileOwnershipalso returns nil when both owner and group are empty. (#1025)
📦 Misc
- Modernize all
os.IsNotExistcalls toerrors.Is(err, fs.ErrNotExist)across 7 callsites in 5 files, matching Go's recommended idiom. Also fixes a pre-emptive%s→%wsentinel loss inValidateWorkingDir. (#1029)
👥 Contributors
Thanks to these contributors ❤️
- Docker Hub: opensandbox/execd:v1.0.19
- Aliyun Registry: sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.19