Skip to content

fix(local-inference/ios): keep the screen awake during model download on the full-Bun engine (#11841) - #11897

Merged
lalalune merged 1 commit into
developfrom
fix/ios-keep-awake-full-bun-engine
Jul 3, 2026
Merged

fix(local-inference/ios): keep the screen awake during model download on the full-Bun engine (#11841)#11897
lalalune merged 1 commit into
developfrom
fix/ios-keep-awake-full-bun-engine

Conversation

@lalalune

@lalalune lalalune commented Jul 3, 2026

Copy link
Copy Markdown
Member

Relands the keep-awake-during-download fix for #11841 onto develop as a single squashed commit (the three source commits self-conflict in KeepAwakeBridge.swift when applied individually, so they are collapsed here).

What / why

On iOS, auto-lock could suspend the runtime mid-download and stall the model transfer (#11841). This holds the iOS idle timer open while an in-process model download is active, and — critically — makes it fire on the production full-Bun engine path, not just the JSContext compatibility bridge (device logs confirmed the sideload build runs compiledEngine=full-bun, where the host function was previously unregistered and the call a silent no-op).

  • downloader.ts — drive keep_awake_set around the active download.
  • KeepAwakeBridge.swift — JSContext-free core with a process-wide shared singleton + ref-counted setEnabled(_:) idle-timer holder.
  • KeepAwakeBridge+JSContext.swift (new) — compat-engine installer, split out so the core compiles into the full-Bun build (which omits JavaScriptCore).
  • FullBunEngineHost.swift — add a keep_awake_set host_call case.
  • BridgeInstaller.swift — install the keep-awake bridge.
  • plugin-capacitor-bridge/src/ios/bridge.ts — define keep_awake_set on the full-Bun path (fire-and-forget; failures can't affect the download).
  • podspec — compile KeepAwakeBridge.swift into the full-Bun source set.

Testing

🤖 Generated with Claude Code

… on the full-Bun engine (#11841)

Squashed reland of three fixes onto develop. iOS auto-lock could suspend the
runtime mid-download and stall it; hold the idle timer open while an in-process
model download is active, and make it fire on the production full-Bun engine
path (not just the JSContext compat bridge).

- downloader.ts: drive keep_awake_set around the active download.
- KeepAwakeBridge.swift: JSContext-free core with a process-wide `shared`
  singleton + `setEnabled(_:)` ref-counted idle-timer holder.
- KeepAwakeBridge+JSContext.swift: compat-engine installer, split out so the
  core compiles into the full-Bun build (no JavaScriptCore).
- FullBunEngineHost.swift: add a `keep_awake_set` host_call case.
- BridgeInstaller.swift: install the keep-awake bridge.
- ios/bridge.ts (capacitor): define `keep_awake_set` on the full-Bun path.
- podspec: compile KeepAwakeBridge.swift into the full-Bun source set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ffa5e39f-437f-4057-a89a-92f3d1d5dbdd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ios-keep-awake-full-bun-engine

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.

@claude

claude Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

❌ PR title does not match the required pattern. Please use one of these formats:

  • 'type: description' (e.g., 'feat: add new feature')
  • 'type(scope): description' (e.g., 'chore(core): update dependencies')
    Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert, release

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant