Commit Graph

2 Commits

Author SHA1 Message Date
Matt Aitchison
06b239d8fe fix: resolve file-artifact handles with uppercased uuid hex
The handle regex matches hex case-insensitively, but store keys are
lowercase uuid4 strings. Normalize the captured uuid to lowercase before
lookup so a handle echoed by the model with uppercase hex still resolves
to its bytes instead of leaking the raw token to the downstream tool.
2026-06-04 19:14:56 -05:00
Matt Aitchison
f300c1f2a6 fix: add FileArtifact to keep binary tool I/O out of the LLM context
Binary file data (PPTX, PDF, images) returned by one tool and echoed by
the model as a base64 argument to another tool drifts by a few characters,
invalidating the base64 and corrupting the resulting file.

Tools can now return a FileArtifact instead of a base64 string. The agent
executor stores the bytes out-of-band (execution-scoped, TTL-backed) and
shows the model a short, namespaced `crewai+file://` handle, expanding it
back to exact base64 just before the consuming tool runs. Wired into the
native (default AgentExecutor + legacy) and ReAct execution paths with
per-run cleanup.
2026-06-04 19:07:52 -05:00