Skip to content

Honor configured timeouts instead of capping transfers at 30s (fixes #253)#263

Open
swimmer-303 wants to merge 2 commits into
zachlatta:mainfrom
swimmer-303:split/timeout-fix
Open

Honor configured timeouts instead of capping transfers at 30s (fixes #253)#263
swimmer-303 wants to merge 2 commits into
zachlatta:mainfrom
swimmer-303:split/timeout-fix

Conversation

@swimmer-303

@swimmer-303 swimmer-303 commented Jul 11, 2026

Copy link
Copy Markdown

Split out from #254 so the small bug fix can land independently.

LLMAPITransport pinned timeoutIntervalForResource = 30 at the session level, silently overriding the README-documented transcription_timeout_seconds / post_processing_timeout_seconds / context_request_timeout_seconds overrides — any transfer over 30s was killed regardless of settings, breaking slow local models.

Sessions now derive their whole-transfer budget from each request's configured timeout (30s floor), cached per timeout value so TLS connection reuse is preserved. Uploads keep their fresh-session-per-call poisoning defense.

Fixes #253

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed long transfers to slow local models being interrupted by an unintended 30-second timeout.
    • Configured transcription, post-processing, and context timeouts are now honored during requests and uploads.
    • Improved timeout handling for both standard requests and file transfers.

The session-level timeoutIntervalForResource=30 silently overrode the
transcription_timeout_seconds, post_processing_timeout_seconds, and
context_request_timeout_seconds settings, killing long transfers to
slow local models. Sessions are now cached per resource timeout derived
from each request's configured timeout, preserving connection reuse.
Uploads keep their fresh-session-per-call behavior.

Fixes zachlatta#253

(cherry picked from commit 9e89b6e)
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e88840d-f5fa-426f-a398-7dae0ba4c019

📥 Commits

Reviewing files that changed from the base of the PR and between 7427ca9 and 94faff6.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • Sources/LLMAPITransport.swift

📝 Walkthrough

Walkthrough

LLMAPITransport now derives URLSession resource timeouts from each request, caches shared sessions by timeout, applies the same logic to uploads, and documents removal of the fixed 30-second cap.

Changes

Timeout-aware transport

Layer / File(s) Summary
Session timeout management
Sources/LLMAPITransport.swift
Session resources are keyed by request-derived timeouts, protected by a lock, and constrained by a minimum timeout floor.
Upload timeout wiring
Sources/LLMAPITransport.swift, CHANGELOG.md
Uploads use request-derived ephemeral sessions, and the changelog records the removed 30-second cap.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • zachlatta/freeflow#85: Also changes LLMAPITransport.swift URLSession and timeout handling.
  • zachlatta/freeflow#216: Makes service timeout durations configurable through UserDefaults, which this transport now honors.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: honoring configured timeouts instead of a fixed 30s cap.
Linked Issues check ✅ Passed The transport now derives session resource timeouts from request settings, so configured transcription and transfer timeouts are honored.
Out of Scope Changes check ✅ Passed The changelog update is directly related to the timeout fix, and no unrelated changes are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch split/timeout-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URLSession timeoutIntervalForResource=30 in LLMAPITransport silently caps user timeout overrides

1 participant