Skip to content

perf(settings): clean up Ollama pull listeners#553

Closed
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-ollama-pull-progress-cleanup-pr
Closed

perf(settings): clean up Ollama pull listeners#553
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-ollama-pull-progress-cleanup-pr

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Ollama pull progress/done/error preload subscriptions now return unsubscribe functions.
  • Settings > AI registers through a small helper, cleans up on unmount, ignores events whose requestId does not match the active pull, and skips identical percent/status progress writes.
  • Added a focused lifecycle harness covering remount churn, request-id filtering, and progress dedupe.

Why

Remounting Settings > AI could leave stale pull listeners behind, multiplying pull progress, completion refresh, and error callbacks on future pulls.

Compatibility impact

Existing callers can keep ignoring the return value. The only renderer call site now uses it for cleanup. Single-pull UX and final Ollama status refresh behavior are preserved.

How tested

  • node --test scripts/test-ollama-pull-listener-cleanup.mjs
    • before inline listeners: 5 remounts + 1 active mount => progress/done/error callbacks 6/6/6, listeners after cleanup 6/6/6
    • after cleanup listeners: progress/done/error callbacks 1/1/1, listeners after cleanup 0/0/0
  • ./node_modules/.bin/tsc -p tsconfig.main.json --noEmit
  • ./node_modules/.bin/vite build
  • Attempted ./node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit; fails on existing upstream-main renderer type debt outside this patch, including App.tsx, CameraExtension.tsx, AITab.tsx, and quicklink icon typing errors.
  • On the integration-stack implementation branch, also ran node --test scripts/test-ai-model-status-polling.mjs.

Stack validation

Clean PR branch from SuperCmdLabs/SuperCmd:main with one cherry-picked fix commit. It does not include the integration-stack commits.

@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by #556, which now includes the Ollama pull listener cleanup commit (31caa81) and carries the validation/performance evidence in the consolidated campaign body.

@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