Skip to content

perf(runtime): consolidate extension lifecycle and media fixes#601

Closed
JustYannicc wants to merge 8 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/consolidate-runtime-main-wave4
Closed

perf(runtime): consolidate extension lifecycle and media fixes#601
JustYannicc wants to merge 8 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/consolidate-runtime-main-wave4

Conversation

@JustYannicc

@JustYannicc JustYannicc commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Consolidates wave4 runtime/main/build/media fixes onto latest origin/main.
  • Reuses fresh extension command bundles with build stamps and stale-command detection.
  • Refreshes installed extension commands without rediscovering app/settings/script/quicklink commands.
  • Cleans extension spawned process lifecycle by renderer sender and clears registry-scoped child processes on ExtensionView teardown.
  • Adds abort-aware extension fetch proxy request IDs and async HTTP response decoding.
  • Cleans main abort listeners for AI provider requests and Ollama pull requests.
  • Streams cloud media uploads/downloads to avoid full Buffer concatenation for STT/TTS paths.
  • Guards Raycast action/list/grid/menubar registry microtasks after unmount.

Why

  • The individual wave PRs overlap in the same main/runtime surfaces, making review order and duplicate cleanup harder than the underlying changes warrant.
  • A single consolidation keeps the extension install/update/build flow compatible with docs/extension-install-flow.md while giving reviewers one branch to validate.

Compatibility impact

  • No feature trimming.
  • Raycast built-in/package facades are preserved; child_process remains routed through the SuperCmd facade so child processes can be tracked and cleaned per extension view.
  • Extension fetch keeps native fallback behavior for unsupported bodies and non-HTTP URLs.
  • Provider behavior is preserved while media buffers are streamed instead of concatenated.

How tested

  • node --test scripts/test-extension-runner-multi-command-build.mjs (13 pass, 1 measurement skip)
  • node --test scripts/test-extension-command-refresh-cache.mjs
  • node --test scripts/test-extension-fetch-proxy-abort.mjs scripts/test-http-response-decode-async.mjs
  • node --test scripts/test-cloud-media-buffering.mjs
  • node --test scripts/test-registry-microtask-lifecycle.mjs
  • node node_modules/typescript/bin/tsc -p tsconfig.main.json --noEmit --pretty false
  • Direct build:main equivalent: node node_modules/typescript/bin/tsc -p tsconfig.main.json --pretty false, then copied src/main/emoji-data.json to dist/main/emoji-data.json
  • Codex LSP diagnostics: no errors in touched TypeScript/TSX files.
  • Dependency restore for literal package script: /opt/homebrew/opt/node@22/bin/npm ci --ignore-scripts --force --no-audit --no-fund
  • Literal package script: /opt/homebrew/opt/node@22/bin/npm run build:main
  • Renderer-wide tsc -p tsconfig.renderer.json --noEmit still reports existing unrelated project errors; touched renderer files are LSP-clean.

Performance evidence

  • Extension build cache: unchanged 5-command fixture reuses 5/5 bundles; a single edited command rebuilds 1/5 bundles; 1/5/20-command fixtures batch into one esbuild call each.
  • Extension refresh benchmark: legacy path performed 40 structural discovery starts, targeted refresh performed 0 structural discovery starts and 40 extension-only starts; median refresh improved from 12.041 ms to 1.674 ms in the local harness.
  • HTTP decode harness: async gzip decode preserved output and reduced timer delay from 3.691 ms sync to 0.613 ms async in the fixture.
  • Cloud media harness: ElevenLabs STT avoided a 6,291,864 byte multipart body copy, Mistral Voxtral STT avoided a 7,340,475 byte multipart body copy, and ElevenLabs TTS streamed 5,767,168 bytes directly to the temp file without retaining a full response Buffer.
  • Registry lifecycle harness: action/list/grid/menubar post-unmount setState calls reproduced at 1 each in the legacy scheduler and dropped to 0 each after the guard.

Stack validation

Replaces

@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by the consolidated runtime/lifecycle/media PR: #622

@JustYannicc JustYannicc closed this Jul 5, 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