Skip to content

[BUG] resource leak in the shell tool #368

@guanh01

Description

@guanh01

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

0.2.19

Tools Package Version

0.2.20.dev1+gc106e7ea9

Tools used

  1. Shell

Python Version

3.13.5

Operating System

Linux

Installation Method

pip

Steps to Reproduce

  1. Install strands
  2. Invoke strands agent with shell tool for thousands of times
  3. The shell tool will start to malfunction/hang because the resource leaking -- file descriptor resources are exhausted.

Expected Behavior

The shell tool should close the file descriptor after it finishes the command execution.

Actual Behavior

The file descriptor is never closed.

Additional Context

No response

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions