Repository navigation
Description
What happened?
DaytonaSandboxProvider.registerSnapshot() issues a raw fetch to the Daytona API with no AbortSignal / timeout:
// packages/trueforge-core/src/core/sandbox/provider/DaytonaProvider.ts (main @ 506bf5c, registerSnapshot)
response = await fetch(`${this.apiUrl}/snapshots`, {
method: 'POST',
headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ name: this.buildRef, imageName: this.imageUri }),
});That call is reached from buildImage(), which runs — without any timeout wrapper — inside three request-facing paths via checkSnapshotStatus:
GET /api/v1/capabilities(packages/trueforge/src/apis/capabilities.ts:35) — this is the UI's boot/capability probe, hit on app load.GET /api/v1/settings/sandbox-providers(packages/trueforge/src/apis/sandboxProviders.ts:41) — the settings page.- Turn creation when a fresh sandbox is needed (
packages/trueforge/src/apis/turns.ts:200,sandboxProvider: async ({...}) => {... checkSnapshotStatus ...}).
The only caller that bounds the round-trip is PUT /settings/sandbox-providers, which wraps it in withTimeout(provider.buildImage(), BUILD_REQUEST_TIMEOUT_MS /* 3s */) (sandboxProviders.ts:18,84). The three paths above have no such cap, so a Daytona endpoint that accepts the connection but stalls the response hangs these requests for up to undici's default ~5-minute header/body timeouts — per request. During that window:
- The UI capability probe and settings page hang with no feedback.
- New turns that need a sandbox stall before execution starts.
- Each hung request keeps a server connection + event-loop task alive; a Daytona brownout turns into piled-up concurrent requests.
Related side effect worth noting while here: checkSnapshotStatus is invoked from GET handlers and can mutate persisted status (and re-activate an idle snapshot via snapshot.activate), so plain reads trigger external writes — retrying clients amplify the external call volume.
Steps to reproduce
- Configure a Daytona sandbox provider.
- Simulate a stalled Daytona API for
POST {apiUrl}/snapshots(e.g. pointapiUrlat a TCP sink that accepts but never responds, or add an artificial delay). GET /api/v1/capabilitiesorGET /api/v1/settings/sandbox-providers(with a snapshot in a non-ready/non-fresh state sobuildImageis reached) — the request hangs ~5 minutes instead of failing fast.
Expected behavior
Every outbound Daytona call should carry an explicit timeout (the codebase already has both primitives: AbortSignal.timeout as used by mcpOAuthFetch, and withTimeout as used by the PUT handler), and status refreshes reachable from GET/request-hot paths should reuse the same bounded budget as the PUT path.
How are you running TrueForge?
Docker Compose
Version
main @ 506bf5c
Relevant logs or screenshots
No error is logged during the hang; requests simply do not complete until undici's default timeouts fire.
Environment
OS: any
Node.js version: 22.14+
Activity
thesujai commentedon Aug 25, 2026
@aniruddhaadak80 thanks for reporting this
Can make the timeout 1 min for this case