Skip to content

Various refactoring after 3.1.2 release#251

Open
leslielazzarino wants to merge 2 commits into
v3.1.2-beta.rc2from
3.1.3-starting-refactoring
Open

Various refactoring after 3.1.2 release#251
leslielazzarino wants to merge 2 commits into
v3.1.2-beta.rc2from
3.1.3-starting-refactoring

Conversation

@leslielazzarino

Copy link
Copy Markdown

Changes Made:

Clean up dead code, fix typo/version pin, route error paths through error sink

  • Architecture cleanup pass: remove dead IPC surface, fix a few small
    inconsistencies, and migrate genuine error/catch paths onto the central
    errors.report() sink (per AGENTS.md convention) instead of bare toast.error.

Dead code & small fixes:

  • Remove dead IPC commands refreshLLMModles / getDownloadedLLMs (both
    returned [] after the old ipexllm backend was removed). Dropped the
    handlers, preload bridge entries, and env.d.ts type defs.
  • Fix singal -> signal typo (all references) in
    service/model_download_adpater.py.
  • Pin OpenVINO backend to Python ==3.12.* (was >=3.10) to match the
    service/, home-agent/, and ComfyUI/ backends.

Error-handling consistency (route through useErrors sink):

  • InstallationManagement.vue: 5 service start/stop/setup failures now go
    through errors.report(...) with category backend/setup and serviceName
    context; removed the now-unused toast import.
  • McpServerDialog.vue: add/update failure reported as surface:'inline'
    (dialog already renders the message inline, drops a redundant toast);
    remove failure reported as a normal toast.
  • PromptArea.vue: audio-recorder error, image-load catch, and RAG-add
    catch now go through errors.report(...).

Backend process-lifecycle helpers (composition, not inheritance)

  • New WebUI/electron/subprocesses/processLifecycle.ts exporting
    terminateProcessTree() (SIGTERM → Windows taskkill /T /F tree / SIGKILL)
    and waitForServerReadyOrThrow() (health poll; supports llamacpp's
    getStartupError and openvino's stderr/exit-signal diagnostics).
  • service.ts (base stop()), openVINOBackendService.ts and
    llamaCppBackendService.ts now delegate to these instead of each
    reimplementing health-check / kill logic.
  • Fix: llamacpp LLM/embedding stops previously used SIGTERM→SIGKILL with no
    Windows tree-kill, leaking descendant processes and causing reinstall
    EPERM; they now tree-kill like the other backends.

Shared Python loopback-auth

  • New backend_shared/aipg_loopback_auth.py: stdlib-only, transport-agnostic
    evaluate_loopback_auth() + get_loopback_token().
  • service/web_api.py and home-agent/web_api.py import it via a
    ../backend_shared sys.path bootstrap (resolves identically in dev and
    packaged layouts); each keeps its own response/CORS handling so behavior
    is preserved.
  • build-config.json: package backend_shared/ alongside the backends.

Split comfyUiPresets store (1600 → 1368 lines)

  • New comfyUiMessages.ts: ComfyUI WS message schema + execution-error
    summarizer.
  • New comfyUiWorkflowTransforms.ts: workflow-graph transforms (OVMS image
    url inject, model-path normalize, node bypass).
  • comfyUiPresets.ts imports both; reactive store surface unchanged.
  • I have updated the documentation, if necessary.

 Clean up dead code, fix typo/version pin, route error paths through error sink

  Architecture cleanup pass: remove dead IPC surface, fix a few small
  inconsistencies, and migrate genuine error/catch paths onto the central
  errors.report() sink (per AGENTS.md convention) instead of bare toast.error.

  Dead code & small fixes:
  - Remove dead IPC commands refreshLLMModles / getDownloadedLLMs (both
    returned [] after the old ipexllm backend was removed). Dropped the
    handlers, preload bridge entries, and env.d.ts type defs.
  - Fix `singal` -> `signal` typo (all references) in
    service/model_download_adpater.py.
  - Pin OpenVINO backend to Python ==3.12.* (was >=3.10) to match the
    service/, home-agent/, and ComfyUI/ backends.

  Error-handling consistency (route through useErrors sink):
  - InstallationManagement.vue: 5 service start/stop/setup failures now go
    through errors.report(...) with category backend/setup and serviceName
    context; removed the now-unused toast import.
  - McpServerDialog.vue: add/update failure reported as surface:'inline'
    (dialog already renders the message inline, drops a redundant toast);
    remove failure reported as a normal toast.
  - PromptArea.vue: audio-recorder error, image-load catch, and RAG-add
    catch now go through errors.report(...).

Signed-off-by: Leslie Lazzarino <leslie.lazzarino@tngtech.com>
 #1 Backend process-lifecycle helpers (composition, not inheritance)
  - New WebUI/electron/subprocesses/processLifecycle.ts exporting
    terminateProcessTree() (SIGTERM → Windows taskkill /T /F tree / SIGKILL)
    and waitForServerReadyOrThrow() (health poll; supports llamacpp's
    getStartupError and openvino's stderr/exit-signal diagnostics).
  - service.ts (base stop()), openVINOBackendService.ts and
    llamaCppBackendService.ts now delegate to these instead of each
    reimplementing health-check / kill logic.
  - Fix: llamacpp LLM/embedding stops previously used SIGTERM→SIGKILL with no
    Windows tree-kill, leaking descendant processes and causing reinstall
    EPERM; they now tree-kill like the other backends.

  #2 Shared Python loopback-auth
  - New backend_shared/aipg_loopback_auth.py: stdlib-only, transport-agnostic
    evaluate_loopback_auth() + get_loopback_token().
  - service/web_api.py and home-agent/web_api.py import it via a
    ../backend_shared sys.path bootstrap (resolves identically in dev and
    packaged layouts); each keeps its own response/CORS handling so behavior
    is preserved.
  - build-config.json: package backend_shared/ alongside the backends.

  #3 Split comfyUiPresets store (1600 → 1368 lines)
  - New comfyUiMessages.ts: ComfyUI WS message schema + execution-error
    summarizer.
  - New comfyUiWorkflowTransforms.ts: workflow-graph transforms (OVMS image
    url inject, model-path normalize, node bypass).
  - comfyUiPresets.ts imports both; reactive store surface unchanged.

Signed-off-by: Leslie Lazzarino <leslie.lazzarino@tngtech.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74e3b03f-8f9b-43d2-ad7c-7122bd17188d

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 3.1.3-starting-refactoring

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.

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