Skip to content

fix(executor): retry transient connection failures when binding a tool call's delegation - #8174

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/executor-delegation-read-retry
Sep 22, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/executor-delegation-read-retry

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Every tool call a workflow run delegates (Function, MCP, files, knowledge) first binds its executor delegation by loading the canonical workflow/run context — a plain read with no retry anywhere above it
  • A single reset pooled connection (ECONNRESET) on that read failed the whole block, and the tool layer masks DB errors, so users saw "An internal error occurred while executing the tool. Please try again." with no retry actually happening
  • Wrap the canonical loads in bindInternalExecutorDelegation with the existing withDatabaseReadRetry (at most 3 attempts, transient connection/serialization codes only); not_found and non-transient errors still propagate unchanged on the first attempt

Type of Change

  • Bug fix

Testing

  • Added tests for a reset connection on the run load and on the current-workflow load; confirmed both fail without the fix and pass with it (18/18)
  • Existing infrastructure-failure test now also asserts a non-transient error is not retried
  • bun run type-check, bun run lint, check:audits, block-registry, and docs-manifest:check 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 22, 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 22, 2026 10:29pm UTC

Request Review

@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

@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the new retries are limited to idempotent canonical reads and preserve existing delegation validation and failure semantics.

Summary

This PR makes executor-delegation binding resilient to transient database read failures without changing its authorization or error-classification behavior.

  • Wraps root workflow, run, execution, and current-workflow canonical context reads with the existing bounded database-read retry helper.
  • Preserves immediate propagation for missing resources and non-transient infrastructure failures.
  • Adds coverage for transient connection resets on run and deployment-version loads and verifies that permanent failures are attempted only once.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Claims[Verified executor delegation] --> Root[Load canonical root context]
  Root --> RetryRoot{Transient database error?}
  RetryRoot -->|Yes, attempts remain| Root
  RetryRoot -->|No| Validate[Validate workflow and execution binding]
  Validate --> Current{Current workflow present?}
  Current -->|Yes| Child[Load current workflow context]
  Child --> RetryChild{Transient database error?}
  RetryChild -->|Yes, attempts remain| Child
  RetryChild -->|No| Scope[Verify workspace consistency]
  Current -->|No| Principal[Create scoped executor principal]
  Scope --> Principal
Loading

Reviews (1) · Last reviewed commit: "fix(executor): retry transient connectio..."

@waleedlatif1
waleedlatif1 merged commit 480b304 into staging Sep 22, 2026
35 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/executor-delegation-read-retry branch September 22, 2026 22:37

This branch was previously deployed

1 inactive deployment
Preview — f9d96e1d Deployed Sep 22, 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