Skip to content

Bug: Resolve lifecycle and execution through the selected engine connection #127

Description

@BerryUIKI

Summary

Creative runners use default ComfyUI/WebUI clients instead of resolving the chosen registry connection. Frontend lifecycle dispatch often chooses by engine type rather than managed/external identity. EmbeddedEngineView.tsx:29 reconstructs a localhost URL from a port, ignoring the configured host, protocol, and path. Both WebUI start callbacks in App use the Comfy runtime toggle.

Environment and evidence

  • Review finding: F27 (2026-10-05 product/technical review).
  • Baseline: Windows, dev at c1c5dbe. The remote dev matched this commit when filing.
  • Evidence: Code.
  • Priority recommendation: P2 - material improvement or integration validation. This is review triage, not a production-incident severity declaration.
  • No real credentials, paid inference, engine installation, or unrelated process termination were used for review probes. Mocked observations establish the stated code behavior, not live-provider/GPU acceptance.

Reproduction or validation

Trace an external engine ID through frontend start/stop, creative execution, and EmbeddedEngineView. Frontend lifecycle selects managed routes by type, runners use default clients, the embedded URL is reconstructed from localhost/port, and WebUI start callbacks in App use the Comfy toggle. Validate with two mocked endpoints and assert the chosen connection receives the request.

User impact

The visible connection can differ from the engine receiving work or a start request.

Proposed approach

Carry one stable connection ID end to end; use its endpoint, capabilities, ownership, and lifecycle policy without type-based fallback.

Acceptance criteria

  • Carry one stable connection ID through all execution/lifecycle calls.
  • Use its endpoint, native URL, capabilities, ownership, and configuration.
  • Do not start/stop managed engines when an external connection is selected.
  • WebUI buttons dispatch WebUI operations.
  • Tests cover non-default hosts/ports and both managed/external connections.

Additional source references

Related work

Related closed issue: #72. This follows up connection identity/endpoint propagation beyond the earlier fixed port literals.

Verification scope

Real GPU inference, paid-provider compatibility, and a clean-machine packaged desktop journey remain unverified. Any follow-up implementation should target dev under the repository's contribution/branching rules.

Activity

  1. added
    bugSomething isn't working
    backendBackend Python / FastAPI / Engine issues
    frontendFrontend React / TypeScript / UI issues
    on Oct 4, 2026
  2. added
    architectureSystem architecture, contract invariants, and pipeline design
    on Oct 4, 2026
  3. BerryUIKI commented on Oct 6, 2026

    @BerryUIKI
    OwnerAuthor

    Issue #127 Completed ✅

    The frontend integration for engine connection routing has been successfully implemented and merged into dev.

    Implementation Summary

    Frontend Changes:

    • Added connection_id field to CreativeActionRequest and GenerationProvenance TypeScript interfaces
    • Updated creative store with stable connection ID support and legacy engine_id mapping
    • Implemented automatic ID conversion (managed_comfyui → comfyui-managed, managed_webui → webui-managed)
    • Updated engine store to include connection_id in instances with ownership-based lifecycle control
    • Modified lifecycle controls to route by engine type and prevent external engine control
    • Updated CreationDock UI to use connection_id in engine selection dropdown
    • Added comprehensive test suite with 13 tests

    Test Results

    ✅ Backend Tests: 9/9 connection routing tests passed (260 total backend tests passing)
    ✅ Frontend Tests: 13/13 new connection routing tests passed (41 total frontend tests passing)
    ✅ Rust Launcher Tests: All tests passed
    ✅ All CI checks passed

    Validation

    • Connection ID mapping validated for both ComfyUI and WebUI
    • Creative action requests correctly include both connection_id and engine_id for backward compatibility
    • Lifecycle controls properly route to type-specific endpoints
    • External (non-managed) engines correctly prevented from lifecycle operations
    • Connection registry compatibility confirmed with backend API

    Merged PR

    PR #161 merged into dev as commit 50b0ece

    Live Testing Limitations

    Full end-to-end testing requires running backend server with live engine instances. Unit and integration tests validate the routing logic and API contracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureSystem architecture, contract invariants, and pipeline designbackendBackend Python / FastAPI / Engine issuesbugSomething isn't workingfrontendFrontend React / TypeScript / UI issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions