agent-zero/plugins/_code_execution
Alessandro 86dca86f6f prompts: restore legacy, plugins, agent0 profile
Restore main.communication, main.solving, main.tips and tool.response, which made the model dumber. For some reasons the drawback was more visible with frontier LLMs.

restore builtin plugins and agent0 profile
2026-04-03 06:49:25 +02:00
..
extensions refactor: split system prompt into per-concern extensions with extensibility hooks 2026-03-20 12:12:47 +08:00
helpers refactor - plugin names and builtin plugins 2026-03-10 22:20:53 +01:00
prompts prompts: restore legacy, plugins, agent0 profile 2026-04-03 06:49:25 +02:00
tools refactor(chat_branching): ID-based log ↔ history linking for precise branch trimming 2026-03-24 03:04:09 -07:00
webui generated logos for builtin plugins 2026-03-19 17:35:03 +01:00
default_config.yaml refactor - plugin names and builtin plugins 2026-03-10 22:20:53 +01:00
plugin.yaml refactor - plugin names and builtin plugins 2026-03-10 22:20:53 +01:00
README.md refactor: normalize plugin paths, add README viewer to plugin info modal, and update plugin hub filters 2026-03-22 08:05:32 +01:00

Code Execution

Run terminal commands and execute Python or Node.js code through Agent Zero using persistent shell sessions.

What It Does

This plugin provides the code execution tool used by agents for development tasks. It supports:

  • Terminal commands in interactive shell sessions
  • Python execution through ipython -c
  • Node.js execution through node /exe/node_eval.js
  • Persistent sessions keyed by session number
  • Session reset and output retrieval
  • Local or SSH-backed execution depending on plugin configuration

Main Behavior

  • Persistent shells
    • Maintains per-session shell state in agent data so subsequent calls can reuse the same terminal session.
  • Multiple runtimes
    • Dispatches requests based on runtime: terminal, python, nodejs, output, or reset.
  • Remote execution support
    • Can open SSH interactive sessions instead of local shells when configured.
  • Streaming output
    • Continuously reads shell output, updates the current log item, and detects progress while commands are running.
  • Safety around running sessions
    • Tracks whether a shell is currently busy and can prevent overlapping commands unless explicitly allowed.

Key Files

  • Tool
    • tools/code_execution_tool.py contains runtime dispatch, session lifecycle, and streaming output logic.
  • Helpers
    • helpers/shell_local.py provides the local interactive shell implementation.
    • helpers/shell_ssh.py provides the SSH-backed interactive shell implementation.
  • Configuration
    • default_config.yaml defines execution, prompt, and timeout settings.
  • Prompts
    • prompts/ contains the response templates shown to the agent.

Configuration Scope

  • Settings section: agent
  • Per-project config: true
  • Per-agent config: true
  • Always enabled: false

Plugin Metadata

  • Name: _code_execution
  • Title: Code Execution
  • Description: Code execution tool supporting terminal, Python, and Node.js runtimes via local TTY or SSH.