Skip to content

fix(launcher): persist engine configuration before showing save success (#125) - #163

Merged
BerryUIKI merged 8 commits into
devfrom
bugfix/persist-engine-config-125
Oct 6, 2026
Merged

BerryUIKI merged 8 commits into
devfrom
bugfix/persist-engine-config-125

Conversation

@BerryUIKI

Copy link
Copy Markdown
Owner

Summary

Fixes #125.

Resolves an issue where engine configuration changes (port and extra launch arguments) in the configuration modal were not persisted to the backend or synchronized when switching engines, resulting in false success notices, stale defaults (such as SD WebUI showing default ComfyUI port 8188), and unconfigured runtime launch.

Key Changes

  1. Runtime Supervisor & Manager Configuration:

    • Extended ComfySupervisor and WebUISupervisor to accept configurable extra_args and port, incorporating them into the engine process command line.
    • Added engine_configs.json disk persistence in EngineManager under runtime_dir to preserve configurations across application sessions and restarts.
    • Implemented validation for port numbers (1-65535), backend port collisions (8000), and inter-engine port conflicts.
    • Added running-engine detection to inform users when an engine restart is required for changes to take effect.
    • Preserved connection identity (connection_id) and external engine zero-process ownership guarantees.
  2. Backend API:

    • Added GET /api/v1/engines/{instance_id}/config and POST/PUT /api/v1/engines/{instance_id}/config endpoints.
    • Added schemas EngineConfig, EngineConfigUpdateRequest, and EngineConfigResponse.
  3. Frontend Store & UI Synchronization:

    • Added fetchEngineConfig and saveEngineConfig to useEngineStore.
    • Updated EngineConfigModal to synchronize on opening and engine selection ([isOpen, instance?.id]), dynamically populating port and flags from the selected engine and fetching fresh backend config.
    • Added pending loading state (isSaving spinner), backend error handling banners, and restart required explanations.
    • Wired onSave in App.tsx through saveEngineConfig, updating instances and embedded views in state.
  4. Automated Testing:

    • Added backend test suite (backend/tests/test_engine_config.py - 9 tests) covering config persistence, engine switching, port conflict validation, restart required detection, launch command verification, external ownership, and execution routing.
    • Added frontend unit tests (frontend/src/tests/engineConfig.test.ts and frontend/src/tests/engineStore.test.ts - 18 tests) covering store config fetching/saving, endpoint updating, engine switching, port validation, and restart requirement detection.

Validation Evidence

  • Backend tests: pytest backend/tests passed (269 passed, 0 failures).
  • Frontend tests: vitest run passed (11 test files, 72 passed, 0 failures).
  • Frontend typecheck: tsc --noEmit passed with 0 errors.
  • Frontend linter: eslint src passed with 0 errors.

@BerryUIKI
BerryUIKI merged commit 6610174 into dev Oct 6, 2026
3 checks passed
@BerryUIKI
BerryUIKI deleted the bugfix/persist-engine-config-125 branch October 6, 2026 22:11
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