Skip to content

feat(python): support callable file providers#1297

Merged
chaliy merged 1 commit intomainfrom
fix/issue-1258-python-callable-file-providers
Apr 14, 2026
Merged

feat(python): support callable file providers#1297
chaliy merged 1 commit intomainfrom
fix/issue-1258-python-callable-file-providers

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 14, 2026

Summary

  • accept str | Callable[[], str] in Python files= for both Bash and BashTool
  • materialize callable-backed files lazily on first read and cache the result in the VFS
  • surface provider exceptions through command execution and preserve TypeError for non-string direct reads

Closes #1258

Verification

  • ./.venv/bin/python -m pytest tests/test_bashkit.py -q
  • uvx ruff check crates/bashkit-python
  • uvx ruff format --check crates/bashkit-python
  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • smoke: lazy providers via Bash.read_file() and BashTool.execute_sync("cat ...")

@chaliy chaliy merged commit 61858d2 into main Apr 14, 2026
18 checks passed
@chaliy chaliy deleted the fix/issue-1258-python-callable-file-providers branch April 14, 2026 21:20
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.

feat(python): support callable file providers in files dict

1 participant