Skip to content

feat: add configurable timeout for decompilation#123

Open
jethac wants to merge 2 commits intoLaurieWired:mainfrom
jethac:pr/configurable-timeouts
Open

feat: add configurable timeout for decompilation#123
jethac wants to merge 2 commits intoLaurieWired:mainfrom
jethac:pr/configurable-timeouts

Conversation

@jethac
Copy link

@jethac jethac commented Jan 11, 2026

tl,dr

Add configurable timeout parameter to decompile_function_by_address for handling large/complex functions.

⚠️ This PR is based on #121. The diff will be cleaner after #121 is merged and I rebase.

Background

Large functions can take minutes to decompile. The fixed 30s timeout causes these to fail with timeout errors, leaving users unable to analyze complex code. Users need control over how long to wait for decompilation.

Changes

  • Add timeout parameter to decompile_function_by_address (default: 120s, max: 1800s / 30min)
  • Add timeout parameter to internal safe_get() for per-request timeout control
  • Clamp user-provided timeout to valid range (10s - 1800s)

Testing

  • Verified default timeout works for typical functions
  • Tested with large function using timeout=300, successfully completed
  • Confirmed timeout values are clamped (e.g., timeout=9999 becomes 1800s)

- Replace requests with httpx for better connection pooling
- Add tenacity for automatic retry on transient failures
- Retry up to 3 times with exponential backoff on ConnectError/ConnectTimeout
- Add connection-pooled HTTP client singleton
- Add timeout parameter to decompile_function_by_address (default: 120s, max: 600s)
- Add timeout parameter to safe_get for per-request timeout control
- Large/complex functions can now use longer timeouts to complete decompilation
Copy link

@bethington bethington left a comment

Choose a reason for hiding this comment

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

LGTM! This addresses the timeout issues users have been reporting (Issue #79). Clean implementation.

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