Skip to content

fix(function): omit oversized display code instead of failing the execution - #8357

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/function-display-code-over-cap
Sep 28, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/function-display-code-over-cap

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • fix(execution): bound reference and context processing #8344 capped the Function execute contract's sourceCode at the 1 MiB source limit. sourceCode isn't the code that runs. It's the display copy used only to render errors, and the resolver inlines each referenced block output into it in full, while the executed code carries those values as __blockRef_N bindings. A Function block that references a large upstream output (e.g. data = <api.data> over ~1 MiB, which Python and shell never offload) therefore produced a request the route rejected, although its executed code was tiny. That same workflow runs on main
  • buildFunctionExecuteBody now omits sourceCode when it exceeds MAX_FUNCTION_CODE_LENGTH. Error rendering already falls back to the executed code when sourceCode is absent, which keeps line numbers correct; truncating would misplace them. The route keeps fix(execution): bound reference and context processing #8344's bound on both fields, and the cap on the executed code is unchanged

Type of Change

  • Bug fix

Testing

  • New execute.test.ts case: a body whose display code outgrows the cap passes the real functionExecuteBodySchema and carries no sourceCode, and display code within the cap is still sent. It fails on staging (safeParse(...).success === false)
  • Function tool, handler, route, and function-execution suites (371 tests), including fix(execution): bound reference and context processing #8344's own oversized-input rejections, pass. Type-check, lint, and check:audits pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 28, 2026 12:38am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes how function execution displays source code in errors.

The PR appears safe to merge.

Summary

The Function execute body now omits an oversized display-only sourceCode while retaining the executed code, allowing requests with large inlined references to pass the existing route limit.

  • Adds a test for oversized display code and preservation of display code within the limit.

Reviews (1) · Last reviewed commit: "fix(function): omit oversized display co..."

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 5c446f1 into staging Sep 28, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/function-display-code-over-cap branch September 28, 2026 00:48

This branch was previously deployed

1 inactive deployment
Preview — 38572bb6 Deployed Sep 28, 2026 by vercel[bot]
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.

1 participant