Add run_shell and run_python interpreter executors #33

Merged
weichen merged 1 commits from feature/exec-interpreters into main 2026-10-01 04:59:03 +00:00
Owner

Summary

  • Register run_shell and run_python: scripts are written under the session sandbox .agent/ and kept for audit, then executed by an absolute-path bash or python3 with the script path as the only argument.
  • Timeout is the earlier of the request context and timeout_sec (default 60s, cap 300s). On Linux the process group is killed. Non-zero exits and timeouts return text, not tool errors.
  • Office/PDF/image extensions get real MIME types on register_artifact so binary bytes are not indexed as text.

Test plan

  • go test ./... (19 packages), including echo retention, empty script, runtime.exec gate, process-group timeout, python ZIP magic, and register_artifact Artifact backfill
  • Owner merges this PR before the Dev gitlink PR
## Summary - Register run_shell and run_python: scripts are written under the session sandbox `.agent/` and kept for audit, then executed by an absolute-path bash or python3 with the script path as the only argument. - Timeout is the earlier of the request context and timeout_sec (default 60s, cap 300s). On Linux the process group is killed. Non-zero exits and timeouts return text, not tool errors. - Office/PDF/image extensions get real MIME types on register_artifact so binary bytes are not indexed as text. ## Test plan - [x] `go test ./...` (19 packages), including echo retention, empty script, runtime.exec gate, process-group timeout, python ZIP magic, and register_artifact Artifact backfill - [ ] Owner merges this PR before the Dev gitlink PR
weichen added 1 commit 2026-10-01 04:05:37 +00:00
Why: deliverable prompts already tell the model to generate Office files
with run_python and register them, but the executors were never
registered, so calls missed the registry and fell back to text-only
write_artifact.

Evidence: go test ./... — 19 packages ok, including echo/script-retention,
empty-script and runtime.exec gate, process-group timeout, python ZIP
magic, and ExecuteTool backfill of register_artifact after run_python.
Scripts stay under the session .agent/ directory; bash/python3 are
resolved to absolute paths; timeout kills the process group.

Impact: models can execute workspace scripts and register binary
deliverables. runtime.exec=false still fail-closes the whole family.
Office extensions now get real MIME types so binary bytes are not
indexed as text.

Refs: task feature/exec-interpreters
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 1691a1c483 into main 2026-10-01 04:59:03 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#33