Agents can take an unpredictable amount of time to do their work — an LLM tool-calling loop might finish in seconds or run for hours depending on the task. Tensorlake handles this by letting functions run indefinitely as long as they keep sending heartbeats in the form of progress updates. A timeout only kicks in if a function stops making progress — it doesn’t finish within the allotted time and it doesn’t send any progress updates to reset the clock.Documentation Index
Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
Use this file to discover all available pages before exploring further.
Setting Timeouts
Set thetimeout attribute on the @function() decorator to control how long a function can run before it is terminated and marked as failed.
| Value | |
|---|---|
| Default | 300 (5 minutes) |
| Minimum | 1 second |
| Maximum | 172800 (48 hours) |
Automatic Timeout Reset
When a function reports progress viactx.progress.update(), its timeout automatically resets. This allows functions to run indefinitely as long as they continue making progress.
- Function starts with 5 minute timeout
- At 3 minutes:
progress.update()called - Timeout resets to 5 minutes from this point
- Function can now run until minute 8 (3 + 5)
- Next
progress.update()resets timeout again
Examples
Agent Loops
An agent that runs hundreds of iterations can use a short timeout per iteration. Each progress update resets the clock:Batch Processing
Process an unbounded stream of items. The function runs as long as items keep arriving:Video/Audio Processing
Report progress every N frames to keep the timeout from firing during long media processing:Learn More
Streaming Progress
The full progress API, frontend integration, and SSE streaming.
Retries & Rate Limits
What happens after a timeout fires — auto-retry with checkpoint reuse.
Crash Recovery
Resume a request from where it timed out instead of restarting.
Durable Execution
How nested completed calls are reused across timeout-triggered retries.
Error Handling
Catch timeouts in caller code and degrade gracefully.
SDK Reference
Functions, retries, resource limits, and request context.