Skip to content

fix(python_repl): drive non-interactive mode from STRANDS_NON_INTERACTIVE#518

Draft
yonib05 wants to merge 2 commits into
strands-agents:mainfrom
yonib05:fix/python-repl-non-interactive-env
Draft

fix(python_repl): drive non-interactive mode from STRANDS_NON_INTERACTIVE#518
yonib05 wants to merge 2 commits into
strands-agents:mainfrom
yonib05:fix/python-repl-non-interactive-env

Conversation

@yonib05

@yonib05 yonib05 commented Jun 27, 2026

Copy link
Copy Markdown
Member

Description

python_repl selected non-interactive mode from a non_interactive_mode
keyword argument:

non_interactive_mode = kwargs.get("non_interactive_mode", False)

This let a caller suppress the execution confirmation prompt per invocation.
shell.py already reads this from the STRANDS_NON_INTERACTIVE environment
variable. This change brings python_repl in line: non-interactive mode is now
an operator/environment setting rather than a per-call keyword argument.

Changes

  • Read non_interactive_mode from STRANDS_NON_INTERACTIVE, matching shell.py.
  • Document STRANDS_NON_INTERACTIVE in the tool description.
  • Update tests to set the environment variable instead of passing the keyword,
    and add a test that passing the keyword no longer suppresses the prompt.

Testing

  • pytest tests/test_python_repl.py passes.
  • ruff format --check and ruff check pass on the changed files.

…TIVE

Non-interactive mode was selected by a non_interactive_mode keyword argument,
which let a caller suppress the execution confirmation prompt per invocation.
Read it from the STRANDS_NON_INTERACTIVE environment variable instead, matching
shell.py, so suppressing the prompt is an operator decision and the keyword
argument no longer bypasses confirmation.
@yonib05 yonib05 marked this pull request as draft June 29, 2026 21:46
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.

1 participant