Skip to content

file_write: external_effect_with_args does a blocking exists() in async context #2

@sanil-23

Description

@sanil-23

Follow-up from @M3gA-Mind's review on PR tinyhumansai#2631.

Issue: file_write's external_effect_with_args calls target.exists() (synchronous stat) inline in the async tool loop, blocking a tokio executor thread. Fast for local paths (microseconds), but violates async hygiene and would be a problem on a slow/remote filesystem.

File: src/openhuman/tools/impl/filesystem/file_write.rs (the target.exists() create-vs-edit probe)

Options:

  • Make the existence check async (the Tool trait makes external_effect_with_args sync today, so this needs a trait change); or
  • Pre-compute existence in the gate routing (where async is available) and pass it in via a separate check_external_effect path.

tinyhumansai#2631 documents this as an intentional sync/blocking call for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions