feat(tools): add exec tool enhancement with background execution and PTY support#1869
Merged
yinwm merged 1 commit intosipeed:mainfrom Mar 25, 2026
Merged
Conversation
928a3f9 to
c3fdaa2
Compare
…PTY support (sipeed#1752) - Unified exec tool with actions: run/list/poll/read/write/send-keys/kill - PTY support using creack/pty library - Process session management with background execution - Process group kill for cleaning up child processes - Session cleanup: 30-minute TTL for old sessions - Output buffer: 100MB limit with truncation Actions: - run: execute command (sync or background) - list: list all sessions - poll: check session status - read: read session output - write: send input to session stdin - send-keys: send special keys (up, down, ctrl-c, enter, etc.) - kill: terminate session Tests: - PTY: allowed commands, write/read, poll, kill, process group kill - Non-PTY: background execution, list, read, write, poll, kill, process group kill - Session management: add/get/remove/list/cleanup
c3fdaa2 to
3f1ac29
Compare
yinwm
approved these changes
Mar 25, 2026
Collaborator
yinwm
left a comment
There was a problem hiding this comment.
LGTM. The fixes for loong64 and Windows build issues look good. Comprehensive test coverage with +946 lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-submit of #1752 (was reverted by #1865)
Fixes
ztypes_loong64.go, causingundefined: _C_intPTY_PATCH_LOONG64in Makefile to dynamically create type definitionssyscall.SysProcAttr.Setsiddoesn't exist on Windowssysproc_unix.go/sysproc_windows.gowith build tagsNew Files
pkg/tools/sysproc_unix.goSetsidsetup (//go:build !windows)pkg/tools/sysproc_windows.go//go:build windows)Modified Files
Makefilepkg/tools/shell.gosyscallimport, callsetSysProcAttrForPty()Testing
make build-all- All platforms compile successfully (amd64, arm, arm64, loong64, riscv64, mipsle, darwin-arm64, windows-amd64, netbsd-amd64, netbsd-arm64)go test ./pkg/tools/...- All tests pass