Skip to content

file_write tool missing append support despite documentation claims #344

@abhisheksp

Description

@abhisheksp

Description
The file_write tool currently does not support appending content to files, forcing an overwrite every time it is used. This contradicts the documentation which suggests that append mode is supported.

Documentation Discrepancy
The documentation at Strands Agents - File Operations indicates that append mode is a supported feature. However, the actual implementation hardcodes the write mode to overwrite ("w"), making it impossible to append to existing files.

Expected Behavior
The tool should align with the documentation and support an optional mode to allow appending content to an existing file, rather than overwriting it.

Task

  • Update the file_write tool to support an append mode.
  • Ensure the default behavior remains as overwrite to preserve existing functionality.
  • Verify the fix with appropriate tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions