Commit graph

5 commits

Author SHA1 Message Date
Alessandro
0ddb5fb31d fix: release Paramiko import traceback
Some checks are pending
Build And Publish Docker Images / plan (push) Waiting to run
Build And Publish Docker Images / build (push) Blocked by required conditions
Paramiko caches its optional invoke import error with the original traceback, retaining the code-execution tool-loading stack and first agent.

Clear only the stale traceback while preserving the exception, and add focused regression coverage.
2026-07-21 00:56:59 +02:00
frdel
4ffcdf5246 Handle shell/SSH process exits as completion
Detect and treat terminated local/SSH/TTY shells as definitive command completion. Add is_terminated and get_exit_code helpers to LocalInteractiveSession, SSHInteractiveSession, and TTYSession; expand _is_closed_pty_error to recognize exited TTY processes. CodeExecution now reports a shell-exit prompt, recreates terminated sessions lazily before the next command, and returns immediately when a shell has exited. Docs and README updated to describe strict-mode/exit behavior, and tests were added/updated to cover the new termination detection and handling.
2026-07-20 17:04:05 +02:00
Alessandro
9837ff3432 Group multiline terminal commands
Execute multiline terminal input as one current-shell compound so intermediate prompts cannot complete queued work early. Preserve shell state and cover Bash and PowerShell grouping with regression tests.
2026-07-10 18:53:19 +02:00
Alessandro
f1787b65f5 Fix code execution PTY reset hangs
Start local PTY shells in a new process session and make close() escalate from SIGTERM to SIGKILL when a foreground command refuses to exit. This keeps code_execution_tool reset from blocking indefinitely on stuck terminal processes.\n\nAdd regression coverage for closing a TERM-resistant shell and document the reset lifecycle contract.
2026-07-09 03:29:52 +02:00
shisan
528c33b7ef Disable pagers in non-interactive code execution shells
The code execution tool runs commands inside TTY-backed shells (local PTY and
remote SSH). Commands like `git diff`/`git log` detect the TTY and pipe output
through a pager (more/less). These shells never receive interactive input, so
the pager blocks forever and spins at 100% CPU per process — on a 16-core host
5 pager processes pegged 5 cores for 8+ hours (#1697).

Disable pagers in both session types:
- LocalInteractiveSession: inject PAGER=cat / GIT_PAGER=cat into the TTY env
- SSHInteractiveSession: export the same in the initial shell command

`cat` streams the output through instead of blocking, and also covers other
pager-using tools (man, systemctl, journalctl). Adds regression tests.

Fixes #1697
2026-06-13 21:17:57 +08:00