Skip to content

perf(provider): lower dedicated daemon scheduling priority - #74

Draft
John-Ryan21337 wants to merge 1 commit into
cafeai:devfrom
John-Ryan21337:adoption/cafe-dev-provider-priority-20260911
Draft

John-Ryan21337 wants to merge 1 commit into
cafeai:devfrom
John-Ryan21337:adoption/cafe-dev-provider-priority-20260911

Conversation

@John-Ryan21337

Copy link
Copy Markdown
Contributor

What Changed

The dedicated provider daemon lowers its own scheduling priority before it constructs provider runtimes. Normally launched children inherit that priority, so a large worker batch competes less with interactive desktop work. The change preserves an already lower launcher priority and continues startup if the OS rejects the request.

Why

Adopts Club Code's provider scheduling behavior at Cafe's current dedicated-daemon boundary. It changes only the current daemon process; no process-table scan or external PID mutation is needed. Electron, the backend, direct backend-hosted providers, the optional supervisor, and existing external runtimes keep their current policy. This does not cap memory, GPU use, network use, or worker count.

Closes #71. Base: Cafe dev at 99fbaec89da429924171c89d66a8f3455e42d9b0.

Validation: formatting, lint, typecheck, full unit test graph (10 workspaces), and a forced desktop build passed. Five mocked priority-boundary tests cover current-process targeting, preserving lower priority, and contained OS failures. An explicit two-process Node smoke verified inherited priority on Windows; it did not change the caller's priority. Generated apps/server/dist/bin.mjs contains the startup boundary. Claude Opus 5 independently reviewed the exact source and passed its scoped audit at 2026-09-12T04:24:50Z; it did not claim to run tests.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes

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.

1 participant