Skip to content

feat(cli): add --yes-shell-commands and reflect shell output in --message mode - #6002

Open
zsicheng0214 wants to merge 1 commit into
Aider-AI:mainfrom
TraceLite-AI:feat/yes-shell-commands-and-message-reflection
Open

zsicheng0214 wants to merge 1 commit into
Aider-AI:mainfrom
TraceLite-AI:feat/yes-shell-commands-and-message-reflection

Conversation

@zsicheng0214

Copy link
Copy Markdown

Summary

Add an explicit opt-in --yes-shell-commands flag (default False) for sandboxed CI/benchmark environments, and reflect shell command output back to the model in --message mode while resetting self.shell_commands per reflection step.

Root Cause & Reproduction

  1. In InputOutput.confirm_ask() (aider/io.py), --yes-always intentionally evaluates res = "n" if explicit_yes_required else "y", refusing Run shell command? prompts by default for interactive safety. However, there was no opt-in CLI flag allowing isolated Docker/CI automation to authorize shell command execution alongside --yes-always.
  2. In Coder.run_one() / Coder.send_message() (aider/coders/base_coder.py), shared_output = self.run_shell_commands() appended shared_output to self.cur_messages without setting self.reflected_message (unlike auto_lint and auto_test), causing one-shot --message invocations to exit before the model could inspect the command output or apply follow-up edits. In addition, self.shell_commands was only cleared once in init_before_message() rather than before each send_message() step.

Discovered via TraceTrial-Bench (arXiv:2610.32285).

Changes

  • aider/args.py, aider/main.py, aider/io.py: add --yes-shell-commands (default False), preserving --yes-always's existing default refusal when --yes-shell-commands is not passed.
  • aider/coders/base_coder.py: clear self.shell_commands before each send_message() step in run_one(), and set self.reflected_message = shared_output (bounded by self.max_reflections) when yes_shell_commands is enabled.
  • tests/basic/test_yes_shell_commands.py: unit tests verifying default refusal, opt-in approval, output reflection, and per-step command list reset.

@CLAassistant

CLAassistant commented Nov 19, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@zsicheng0214
zsicheng0214 force-pushed the feat/yes-shell-commands-and-message-reflection branch from 90e4ca3 to e2dac99 Compare November 19, 2026 05:58
@zsicheng0214
zsicheng0214 marked this pull request as ready for review November 19, 2026 06:10

This branch has not been deployed

No deployments
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