feat(offloader): return explicit paths in preview and auto-enable retrieval#2222
feat(offloader): return explicit paths in preview and auto-enable retrieval#2222lizradway merged 4 commits intostrands-agents:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This comment was marked as outdated.
This comment was marked as outdated.
|
Assessment: Request Changes The approach of making storage references actionable (file paths, S3 URIs) is solid and the backward compatibility design in Review Categories
Solid overall design — once the relative-path bug is fixed and tested, this is ready to go. |
|
Assessment: Comment The critical relative-path bug from round 1 is fixed and properly tested — nice work. Two remaining suggestions, neither blocking. Review Categories
The core logic and backward compatibility design are solid. |
|
Assessment: Approve All feedback from rounds 1 and 2 has been addressed — the critical relative-path bug is fixed, round-trip tests are in place, and the PR description now includes clear example previews for each storage type. No new issues found. Remaining non-blocking suggestions from prior rounds
Nice work on the backward compatibility design — accepting both old and new reference formats in |
|
Assessment: Approve Clean iteration. The conditional No new issues found. All prior feedback from rounds 1–4 is addressed. |
|
Assessment: Approve The tool spec docstring update (line 158–159) is a good addition — it ensures the LLM sees the "fallback only" guidance both in the offloaded preview text and in the tool description itself. No new issues. |
Description
FileStorage.store()andS3Storage.store()return internal keys (e.g.,1234567890_1_tooluse_abc.txtorartifacts/1234567890_1_tooluse_abc) that appear in the agent's offloaded preview. While the agent could infer usable paths from these, doing so required the LLM to reason about the storage backend and construct the correct path — this PR makes the references explicit.Storage changes
store()now returns the full file path (e.g.,./artifacts/1234_1_key.txt), preserving whatever relative/absolute form the user configured forartifact_dir.retrieve()accepts both full paths and bare filenames for backward compatibility. Metadata lookup uses the filename portion of the resolved path.Example preview (absolute dir)
Example preview (relative dir)
store()now returns ans3://URI (e.g.,s3://my-bucket/prefix/1234_1_key).retrieve()strips thes3://bucket/prefix when present, also accepts raw keys. Rejects URIs for the wrong bucket early withKeyError.Example preview
Example preview
Retrieval tool default
include_retrieval_toolnow defaults toTrue(previouslyFalse). The inline guidance steers agents to use existing tools first (e.g., file read, bash, AWS CLI) and only fall back toretrieve_offloaded_contentwhen direct access is not possible. This ensuresInMemoryStorageusers can always access offloaded content without needing to explicitly opt in.Related Issues
#1296
Documentation PR
N/A
Type of Change
New feature
Testing
How have you tested the change?
76 tests passing across
test_storage.pyandtest_plugin.pyNew storage tests: reference format, relative/absolute artifact dir, bare filename retrieval, raw S3 key retrieval, wrong bucket rejection, path traversal on filename portion
New plugin integration tests (
TestActionableReferences): FileStorage path in preview text, FileStorage path in image placeholder, InMemoryStorage opaque reference in previewNew default-behavior tests: retrieval tool registered by default, not registered when explicitly disabled
End-to-end test script against real S3 (
tool-externalization-demobucket)I ran
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.