Skip to content

Add modular/optional feature packs and on-demand component installer for Video & Audio - #22

Closed
spelech wants to merge 2 commits into
mainfrom
feat/modular-feature-packs-454266730511521674
Closed

Add modular/optional feature packs and on-demand component installer for Video & Audio#22
spelech wants to merge 2 commits into
mainfrom
feat/modular-feature-packs-454266730511521674

Conversation

@spelech

@spelech spelech commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Introduces modular, separately installable feature packs for Video Generation (video-generation) and Audio TTS (audio-tts).

Key changes:

  • Updated Inno Setup installer.iss with [Components] (core, ext_video, ext_audio) and [Types] (full, compact, custom).
  • Added --with-video and --with-audio opt-in flags to install.ps1 and install_linux.sh.
  • Refactored setup_ai_tools.ps1 into discrete tasks Install-VideoPack and Install-AudioPack.
  • Implemented IComponentManagerService & ComponentManagerService to query, install, and uninstall optional feature packs.
  • Added REST endpoints GET /api/components, POST /api/components/install (with SSE progress stream), and POST /api/components/uninstall.
  • Created FeaturePackBannerControl UI banner control and integrated missing pack banners into EngineStudioTabControl.
  • Added "Installed Components & Add-ons" section with disk usage status and toggles in SettingsTabControl.
  • Added unit & integration tests in ComponentManagerAndEndpointsTests.cs.

Fixes #15


PR created automatically by Jules for task 454266730511521674 started by @spelech

…r Video & Audio

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@spelech

spelech commented Aug 24, 2026

Copy link
Copy Markdown
Owner Author

PR #22 Code Review: Modular Feature Packs & On-Demand Component Installer (Issue #15)

Verdict: APPROVED_WITH_NITPICKS 🟢 (with actionable recommendations)


🌟 Key Strengths & Architectural Highlights

  1. Clean Modular Architecture: Clean separation between core server functionality and optional feature packs (video-generation, audio-tts) across installer scripts, backend services, and front-end UI.
  2. REST & SSE Endpoints: Clear REST API contract with endpoints /api/components, /api/components/install, and /api/components/uninstall supporting real-time Server-Sent Events (SSE) progress reporting.
  3. Graceful UI Fallbacks: Reusable FeaturePackBannerControl in EngineStudioTabControl with rich metadata (Description, Disk Size, Min VRAM requirements) and single-click installation when components are missing.
  4. Settings Management UI: Dedicated "Installed Components & Add-ons" section in SettingsTabControl with real-time status pills and toggle/uninstall actions.
  5. Cross-Platform Script Support: Multi-platform installer support across Inno Setup ([Components] & [Types]), PowerShell (-WithVideo, -WithAudio), Linux shell script (--with-video, --with-audio), and setup_ai_tools.ps1.
  6. Automated Testing: Integration test suite in ComponentManagerAndEndpointsTests.cs covering querying, installation, and uninstallation.

🔍 Findings & Recommended Improvements

1. Path Resolution: Avoid Directory.GetCurrentDirectory() in Service/Desktop Execution [High Priority]

Location: Services/ComponentManagerService.cs

  • IsVideoPackInstalled, IsAudioPackInstalled, InstallComponentAsync, and UninstallComponentAsync use Directory.GetCurrentDirectory().
  • When running as a Windows Service (or launched from system directories/shortcuts), Directory.GetCurrentDirectory() points to C:\Windows\System32 (or / on Linux), which can cause directory creation/deletion in the wrong path or trigger UnauthorizedAccessException.
  • Recommendation: Use AppContext.BaseDirectory or resolve against configured settings (settings.WorkflowsPath, etc.):
var baseDir = AppContext.BaseDirectory;
var videoWorkflowDir = Path.Combine(baseDir, "Workflows", "Video");

2. Inno Setup: Map Components to [Dirs] [Medium Priority]

Location: scripts/installer.iss

  • installer.iss defines [Types] and [Components] (core, ext_video, ext_audio), but there are no [Dirs] or [Files] entries associated with Components: ext_video or Components: ext_audio.
  • Choosing "Full" vs "Compact" in the Inno Setup wizard currently does not create the corresponding feature pack folder scaffolding.
  • Recommendation: Add a [Dirs] section linking the component flags:
[Dirs]
Name: "{app}\Workflows\Video"; Components: ext_video
Name: "{app}\kokoro-fastapi"; Components: ext_audio
Name: "{app}\models\audio"; Components: ext_audio

3. Concurrency: Fire-and-forget Task.Run in SSE Stream Handler [Medium Priority]

Location: Endpoints/ComponentEndpoints.cs

  • In app.MapPost("/api/components/install"), Progress<double> triggers _ = Task.Run(async () => ...). Because these background tasks are un-awaited, the endpoint method can complete, execute Results.Empty, and close the HTTP response stream while un-awaited tasks are still queued on syncLock, potentially causing ObjectDisposedException.
  • Recommendation: Synchronize SSE writes sequentially or buffer progress via a System.Threading.Channels.Channel<T> consumed by a streaming writer.

4. Bash Argument Parsing Loop in install_linux.sh [Low Priority]

Location: scripts/install_linux.sh

  • Calling shift inside a for arg in "$@" loop can cause skipped arguments because the for loop already iterates over the pre-expanded positional arguments.
  • Recommendation: Use a standard while [ $# -gt 0 ] loop:
while [ $# -gt 0 ]; do
  case "$1" in
    --with-video)
      WITH_VIDEO=1
      shift
      ;;
    --with-audio)
      WITH_AUDIO=1
      shift
      ;;
    *)
      shift
      ;;
  esac
done

5. HttpClient Lifetime & Initial State Loading in SettingsViewModel.cs [Low Priority]

Location: LocalLLMServerManager.Shared/ViewModels/SettingsViewModel.cs

  • RefreshComponentStatusesAsync and ToggleComponentAsync create unmanaged new HttpClient() instances. Wrap with using var http = new HttpClient(); or use a shared client.
  • Call RefreshComponentStatusesAsync(apiBase, http) inside LoadSettingsAsync so the UI initializes with current component statuses immediately without requiring a manual refresh.

🏁 Summary

Overall, this PR provides a solid foundation for modular feature packs and on-demand installer capabilities. The architecture is clean, cohesive, and integrates smoothly into the app UI and backend endpoints. Addressing the path resolution and Inno Setup [Dirs] mapping will ensure rock-solid behavior in production installations.

…ponent installer for Video & Audio

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
spelech added a commit that referenced this pull request Aug 24, 2026
@spelech

spelech commented Aug 24, 2026

Copy link
Copy Markdown
Owner Author

Integrated and merged into main as part of release v3.7.0.

@spelech spelech closed this Aug 24, 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.

feat(installer): Add modular/optional feature packs and on-demand component installer for Video & Audio

1 participant