Repository navigation
fix(agent): bound shell execution and show quiet command progress - #1378
Conversation
|
Good catch, yeah we should definitely have something here. However, unless there is a critical reason otherwise, I have a strict rule that should be documented somewhere about not touching the pi subdirs. See if you can add a bounded thing without that. I think the longer term solution here is to do what I've seen other agents do which is moving tasks to the background and add polling, waiting, and shell killing capabilities around long shell commands. |
|
Updated this to keep all Pi directories unchanged. The timeout and progress handling now live in Maple using the existing operations hook. Kept the 30-minute default with longer timeouts allowed, and fixed the completion race. Background execution with poll/wait/stop is tracked in #1380. Local CI passes. |
AnthonyRonning
left a comment
There was a problem hiding this comment.
Reviewed at 0a48340: Maple-only wrapper with the Pi directories unchanged, CI green. Merging as the interim fix; background jobs remain in #1380. One test-only nit for a follow-up: on macOS with TMPDIR under /tmp, quiet_shell_reports_effective_folder_deadline_and_idle_time_until_stop compares the raw tempdir path against the canonical /private/tmp/... cwd, so it should compare canonicalized paths.
The quiet-shell test from #1378 compared the folder the shell reports with the temporary project path as given. The session works in the project's canonical path, so the test failed wherever the temporary folder is behind a symbolic link, as `/tmp` is on macOS. That includes the pre-commit hook inside the Nix shell. It now compares the canonical path, as the other project-root tests do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A model-generated command changed into
/tmpand searched../../, reaching the filesystem root and blocking on AppArmor's revision interface. The saved checkout and working-directory propagation were correct. There was no default command deadline, and the live timeline discarded progress updates.This fix lives entirely in Maple. The Pi directories are unchanged. Maple wraps the existing
BashOperationsinterface and owns the live status updates.workdirtool argument is added.Regression tests live in Maple and cover saved worktrees across cold loads, invalid working directories, explicit deadline overrides, blocked pipeline cancellation/deadline/drop, unresponsive operations, retained output, and late-update ordering. They use disposable directories and FIFOs, without scanning
/or reading blocking kernel interfaces.Background execution with polling, waiting, and stopping is tracked separately in #1380.
Validation on this revision (pinned Nix environments, local disposable fixtures):
just cipassed: formatting, packaging/Git metadata fixtures, all Clippy feature sets, dependency checks, workspace tests, all-target build, and headless tests (351 passed, 2 ignored).nix flake check --no-update-lock-file --print-build-logspassed all seven Linux checks.crates/UPSTREAM.md.These safeguards do not sandbox shell commands or rewrite search expressions. Commands can still change directories, and deliberately detached processes can escape Unix process groups. Native macOS/Windows runtime behavior and packaged-app smoke remain unverified locally;
ci:windowsremains on this PR. No live service, AppArmor policy, credentials, pairing, or application state was changed.Need help on this PR? Tag
@codesmith-botwith what you need.