Skip to content

perf(settings): coalesce AI status polling - #527

Closed
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-ai-status-polling-pr
Closed

perf(settings): coalesce AI status polling#527
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-ai-status-polling-pr

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Coalesced Whisper.cpp, Parakeet, and Qwen3 status polling in the settings AI tab into one Promise.all-based tick.
  • Added equality guards before scheduling React status state updates, using one combined model-status snapshot.
  • Preserved direct model download/progress updates and added a focused regression/perf script.

Why

  • The AI settings tab previously ran three independent 1s polling loops. When statuses were field-identical but returned as new objects, the large tab could still commit up to three times per second.
  • The new path keeps the same IPC status reads but batches the poll result and skips React updates when nothing semantically changed.

Compatibility impact

  • No IPC contract changes.
  • No user-facing settings changes.
  • Download progress remains update-sensitive because bytesDownloaded/progress fields are included in the equality checks.

How tested

  • node --test scripts/test-ai-model-status-polling.mjs
    • Baseline unchanged polling over five 1s ticks: 15 state updates / 15 profiler-style commits.
    • Coalesced unchanged polling over five 1s ticks: 0 state updates / 0 profiler-style commits.
    • Coalesced all-changing polling over five 1s ticks: 5 state updates / 5 profiler-style commits.
  • ./node_modules/.bin/tsc --noEmit --target ES2020 --module ESNext --moduleResolution bundler --strict --skipLibCheck src/renderer/src/settings/aiModelStatusPolling.ts
  • git diff --check origin/main..HEAD

Stack validation

  • Created clean branch codex/perf-ai-status-polling-pr from origin/main and cherry-picked only the AI status polling fix.
  • git rev-list --count origin/main..HEAD reports 1 commit.
  • Scoped diff contains only src/renderer/src/settings/AITab.tsx, src/renderer/src/settings/aiModelStatusPolling.ts, and scripts/test-ai-model-status-polling.mjs.
  • Full renderer typecheck was attempted with ./node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit, but origin/main currently reports unrelated renderer errors outside this patch area, including src/renderer/src/App.tsx, src/renderer/src/CameraExtension.tsx, src/renderer/src/hooks/useLauncherCommandModel.ts, Raycast runtime files, and pre-existing src/renderer/src/settings/AITab.tsx issues unrelated to this polling change.

@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Consolidated into #531, which combines the AI chat streaming, Cursor Prompt streaming, Raycast useAI streaming, and AI status polling performance work in one upstream PR. Closing this superseded scoped PR in favor of the consolidated replacement.

@JustYannicc JustYannicc closed this Jul 3, 2026
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.

1 participant