Skip to content

ADFA-6339 | Let the agent run, read and stop shell commands in the Terminal - #125

Open
jatezzz wants to merge 2 commits into
feat/ADFA-6337-agent-run-gradle-taskfrom
feat/ADFA-6339-agent-run-shell-command
Open

jatezzz wants to merge 2 commits into
feat/ADFA-6337-agent-run-gradle-taskfrom
feat/ADFA-6339-agent-run-shell-command

Conversation

@jatezzz

@jatezzz jatezzz commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR allows the AI agent to execute shell commands directly within the IDE's visible Terminal rather than making the user manually run them. It introduces three new tools: run_shell_command, read_terminal_session, and stop_terminal_session. Every command requires user approval, and the dialog now distinctly shows the full uncut command and its working directory. The agent can read back the exit code and up to 8000 characters of terminal output, or it can leave a long-running process (like a server) active and read its session later.

Details

  • run_shell_command: Runs scripts via bash, automatically bounds directories to the project root, and captures terminal output.
  • read_terminal_session / stop_terminal_session: Allow the agent to check on or interrupt existing background commands without needing new user approvals.
  • Updated ApprovalDialogFragment with ApprovalKind to properly format shell commands and directories in the review prompt.
  • Raised prompt character limits to support the new terminal output payloads.
Screen_Recording_20261007_161740_Code.on.the.Go.mp4

Ticket

ADFA-6339

Observation

The new shell tools are safely gated; they will only be registered and exposed to the AI if the host supports IdeTerminalService. Older IDE versions will operate as before without these tools.

Needs to be merged first:

…e Terminal

Add run_shell_command, read_terminal_session and stop_terminal_session on IdeTerminalService; run and stop always ask first. Handlers declare their approval preview; working_directory is contained before approval; each answer shows once. Fix the OpenAI backend dropping all tools after one model refused them. Bumps AI-Core to 3.4.0.

Refs: ADFA-6339
@jatezzz
jatezzz requested review from a team, Daniel-ADFA and itsaky-adfa October 7, 2026 22:04
Comment thread plugins/AI-Core/src/main/assets/prompts/tool_descriptions.yml
Comment thread plugins/AI-Core/ai-core.html Outdated
Report non-zero exits as results, poll terminal sessions as live reads, count shell commands as project changes, share Read/Stop session code, and correct the shell-state and network-access docs.

Refs: ADFA-6339
@jatezzz
jatezzz requested a review from hal-eisen-adfa October 8, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants