Skip to content

feat(eve): support file parts in tool model output#685

Open
BlackishGreen33 wants to merge 4 commits into
vercel:mainfrom
BlackishGreen33:bg/feat-tool-model-output-files-456
Open

feat(eve): support file parts in tool model output#685
BlackishGreen33 wants to merge 4 commits into
vercel:mainfrom
BlackishGreen33:bg/feat-tool-model-output-files-456

Conversation

@BlackishGreen33

@BlackishGreen33 BlackishGreen33 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Closes #456.

Description

Authored tools could return text or JSON to the model, but they could not return files or images. This meant a tool could create an image, while the model still had no way to inspect it.

This PR adds a content output type with text and file parts. File parts use { type: "data", data: string }; the string must contain base64-encoded data. Eve validates the fields and base64 syntax, then copies each part into a new, clean object before passing it to the AI SDK. URLs, data URLs, provider references, raw bytes, and sandbox references remain out of scope.

The original execute return value is still used for action.result, channels, and hooks. Only the value sent back to the model is normalized.

The tools documentation now includes an image example and explains the supported file source. The existing agent-tools model-output eval now returns a small PNG and checks that the model can identify it while action.result keeps the original tool result.

Fork pull requests cannot access the repository secrets required by the model-backed E2E, Vercel E2E, and TUI jobs. Those jobs now use the repository's existing fork guard pattern and report as skipped for fork pull requests. Same-repository pull requests, main pushes, and manual workflow runs still run the full checks.

How did you test your changes?

Passed with Node.js v24.15.0:

  • pnpm --filter eve exec vitest run --config vitest.unit.config.ts src/harness/tools.test.ts (49 passed)
  • pnpm typecheck
  • pnpm lint
  • pnpm exec oxfmt --check on the changed files
  • pnpm check:deps
  • pnpm guard:invariants
  • pnpm docs:check
  • pnpm test:unit
  • pnpm test:integration
  • pnpm build
  • pnpm test:scenario
  • git diff --check

I also attempted pnpm exec eve eval --strict dynamic-tools/model-output. It stopped before the model or tool call because this environment does not have AI_GATEWAY_API_KEY or VERCEL_OIDC_TOKEN. The PR is draft until that eval can run with provider credentials.

A patch changeset is included for the published eve package.

PR Checklist

  • I linked an issue with prior discussion confirming this change is wanted
  • I ran the relevant checks from CONTRIBUTING.md
  • I added tests and documentation where relevant
  • I added a changeset if this touches the published eve package
  • DCO sign-off passes for every commit (git commit --signoff)

Signed-off-by: 墨綠BG <s5460703@gmail.com>
Signed-off-by: 墨綠BG <s5460703@gmail.com>
Signed-off-by: 墨綠BG <s5460703@gmail.com>
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@BlackishGreen33 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: 墨綠BG <s5460703@gmail.com>
@BlackishGreen33 BlackishGreen33 marked this pull request as ready for review July 10, 2026 17:53
Copilot AI review requested due to automatic review settings July 10, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Allow authored tools to return file/image parts to the model

2 participants