Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • increased timeouts for function execution & agent

Type of Change

  • Bug fix

Testing

Tested manually

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
Copy link

vercel bot commented Dec 8, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Dec 8, 2025 11:55pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 8, 2025

Greptile Overview

Greptile Summary

This PR increases execution timeouts across the platform from conservative values (5s-3min) to a consistent 10-minute timeout for long-running operations.

Key Changes:

  • DEFAULT_FUNCTION_TIMEOUT: 5s → 600s (for custom tool code execution in agent blocks)
  • REQUEST_TIMEOUT: 120s → 600s (for LLM API requests in agent blocks)
  • DEFAULT_EXECUTION_TIMEOUT_MS: 180s → 600s (for function block code execution)
  • Removed unused MAX_EXECUTION_DURATION constant (was used for API route duration with buffer, no longer referenced)
  • Cleaned up unused timeout and validateStatus parameters from HTTP request tool (these were never implemented in the execution logic)

Impact:
The changes allow workflows with complex custom tools, long-running code, or slow LLM responses to complete successfully instead of timing out prematurely. The HTTP parameter cleanup removes dead code without affecting functionality since these parameters were never actually used in request execution.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward constant adjustments that increase timeout values to accommodate longer-running operations. The removed code (MAX_EXECUTION_DURATION, HTTP timeout/validateStatus params) was confirmed to be unused throughout the codebase. All modifications maintain backward compatibility since they only extend execution windows without changing behavior or breaking existing functionality.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/executor/constants.ts 5/5 Increased DEFAULT_FUNCTION_TIMEOUT and REQUEST_TIMEOUT from 5s/120s to 600s (10 minutes) for custom tool execution and LLM API requests
apps/sim/lib/execution/constants.ts 5/5 Increased DEFAULT_EXECUTION_TIMEOUT_MS from 180s (3 minutes) to 600s (10 minutes) and removed unused MAX_EXECUTION_DURATION constant
apps/sim/tools/http/request.ts 5/5 Removed unused timeout and validateStatus parameters from HTTP request tool configuration
apps/sim/tools/http/types.ts 5/5 Removed unused timeout and validateStatus fields from RequestParams interface

Sequence Diagram

sequenceDiagram
    participant User
    participant Workflow
    participant Agent as Agent Handler
    participant Function as Function Tool
    participant HTTP as HTTP Request
    participant LLM as LLM API

    Note over Agent,LLM: Timeout Changes: 5s/120s → 600s (10 min)

    User->>Workflow: Execute Workflow
    
    alt Agent Block Execution
        Workflow->>Agent: Execute Agent Block
        Agent->>Function: Execute Custom Tool
        Note right of Function: DEFAULT_FUNCTION_TIMEOUT<br/>5s → 600s (10 min)
        Function-->>Agent: Tool Result
        Agent->>LLM: Send API Request
        Note right of LLM: REQUEST_TIMEOUT<br/>120s → 600s (10 min)
        LLM-->>Agent: LLM Response
        Agent-->>Workflow: Agent Result
    end
    
    alt Function Block Execution
        Workflow->>Function: Execute Code
        Note right of Function: DEFAULT_EXECUTION_TIMEOUT_MS<br/>180s → 600s (10 min)
        Function-->>Workflow: Execution Result
    end
    
    alt HTTP Request
        Workflow->>HTTP: Make HTTP Request
        Note right of HTTP: Removed timeout/validateStatus params<br/>Uses default fetch timeout
        HTTP-->>Workflow: HTTP Response
    end
    
    Workflow-->>User: Workflow Complete
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 87084ed into staging Dec 9, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/timeouts branch December 9, 2025 00:26
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.

2 participants