Skip to content

Add ObjectStorageToolset for reading files on object storage - #73899

Merged
kaxil merged 2 commits into
commonai-native-frameworksfrom
commonai-object-storage-toolset
Sep 30, 2026
Merged

kaxil merged 2 commits into
commonai-native-frameworksfrom
commonai-object-storage-toolset

Conversation

@kaxil

@kaxil kaxil commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

An agent that needs to read files on S3, GCS, Azure or a local path had no toolset for it: HookToolset over a storage hook exposes whatever the hook's methods take, including buckets and paths the Dag author never meant to hand over. ObjectStorageToolset gives read-only access to the files under one ObjectStoragePath root, through three tools: list_files, get_file_info, and read_file, which returns a window of lines from a text file, or the schema and first rows of a Parquet or Avro file.

  • Every path resolves under the root. Absolute paths, schemes and .. are refused, and on a local root so is a symlink that leads outside it.
  • Reads are bounded. A large directory is listed a page at a time, with the offset to continue from. Bytes read and output size have limits, so one call cannot fill the context window or pull a large object into the worker.
  • A refusal is final, not a retry. A missing file, a path outside the root, or a file the model cannot read (binary, too large, corrupt) comes back as a failed call the model can read, without using the tool's retry budget.

It works in AgentOperator, a Pydantic AI agent, Strands and Google ADK, and is listed as experimental on the stability page. The root is only a path check: the connection's own permissions are the real limit, which the docs say.

A real Claude agent given only a reports root. It lists the root, pages through a directory with offset, reads a text file, a Parquet file and a gzip file, and is refused when it asks for ../payroll.txt:

Agent exploring files through ObjectStorageToolset


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@kaxil
kaxil added this pull request to stack #73905 September 29, 2026 12:49
@kaxil kaxil closed this Sep 29, 2026
@kaxil kaxil reopened this Sep 29, 2026
@kaxil
kaxil marked this pull request as ready for review September 29, 2026 13:17
@kaxil
kaxil force-pushed the commonai-object-storage-toolset branch from a1cd362 to 04645c4 Compare September 29, 2026 14:03
The toolset gives an agent read-only access to the files under one
ObjectStoragePath root: list a directory, get a file's size and
modification time, and read a text file a window of lines at a time or a
Parquet or Avro file as its schema and first rows. Paths are resolved
under the root, and absolute paths, schemes, '..' and symlinks that leave
a local root are refused. Like the other toolsets it works in
AgentOperator, a Pydantic AI agent, Strands and Google ADK.
A corrupt Parquet or Avro file is refused rather than failing the run: pyarrow's ArrowInvalid is a ValueError, which the refusal already catches. On an object store only the toolset's own path check applies, so encoded dots and backslashes are tested there to show they stay part of a key under the root.
@kaxil
kaxil force-pushed the commonai-object-storage-toolset branch from 1ee0534 to 3b94bde Compare September 30, 2026 06:01
@kaxil
kaxil merged commit e46d193 into main Sep 30, 2026
66 of 77 checks passed
@kaxil
kaxil deleted the commonai-object-storage-toolset branch September 30, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants