Skip to content

Celune 4.1.0#19

Open
celunah wants to merge 23 commits into
mainfrom
dev
Open

Celune 4.1.0#19
celunah wants to merge 23 commits into
mainfrom
dev

Conversation

@celunah

@celunah celunah commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Now THAT is an update. CodeRabbit, do your summary below.

Summary by CodeRabbit

  • New Features

    • Browser WebUI for audio/commands, volume control for playback, YouTube SFX support, and compiled auto-update support
  • Documentation

    • New UI gallery, updated README (branding, install/run notes, Web UI), and developer contribution guidelines
  • Improvements

    • Smoother energy-based audio reactivity/glow, backend upgraded to Qwen3-VL, CLI/launcher update handling, CI now produces launcher build artifacts
  • Tests

    • Expanded unit tests covering WebUI, playback/mixing, updater, persona, and pipeline behaviors

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9621ca4-8b47-4890-a0dd-ee08a4219c75

📥 Commits

Reviewing files that changed from the base of the PR and between 812ebd5 and d7913dc.

📒 Files selected for processing (6)
  • AGENTS.md
  • GALLERY.md
  • README.md
  • celune/pipeline.py
  • scripts/build_nuitka.ps1
  • scripts/build_nuitka.sh
✅ Files skipped from review due to trivial changes (2)
  • GALLERY.md
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/build_nuitka.ps1

📝 Walkthrough

Walkthrough

Celune 4.1.0 adds compiled launcher distribution with in-app updates, a Gradio-based browser WebUI, a shared playback mixer for audio ducking, internal state refactoring via dataclasses, and Qwen3-VL persona model support. The launcher and build scripts enable automatic binary updates. The playback mixer coordinates speech and SFX with per-source gain and glow synchronization. The WebUI mirrors runtime state and accepts slash commands. Core classes reorganize mutable state into grouped containers for clarity.

Changes

Core Launcher and Build Infrastructure

Layer / File(s) Summary
Version and Build Configuration
pyproject.toml, requirements.txt, .gitignore, AGENTS.md
Version bumped to 4.1.0; yt-dlp and nuitka>=4.1.2 added to dependencies; bin/ directory added to .gitignore; new AGENTS.md contributor guidelines cover code standards, CI workflow, and development practices.
Build Scripts for Linux and Windows
scripts/build_nuitka.sh, scripts/build_nuitka.ps1
New Nuitka build scripts for Linux (AppImage via appimagetool, launcher.c compilation) and Windows (exe via MSVC, launcher.c compilation); both generate celune-update.json with version/revision/artifact hashes.
C Launcher Update Support
launcher.c
Launcher rewritten to find repo root via .venv/pyvenv.cfg walk, detect EXIT_PENDING_UPDATE, spawn update helpers (Unix: fork/execv, Windows: CreateProcessA), and run the compiled target with proper PATH/PYTHONHOME/NUITKA_PYTHONPATH configuration.
Compiled Path Resolution and Running Detection
celune/paths.py
New running_compiled() and project_root() functions detect compiled execution and resolve repo root; default_config_path() and legacy_config_path() now use project_root() instead of file-relative paths.
Compiled Bundle Update Detection and Application
celune/updater.py
New compiled-bundle path: SHA-256 checksum matching against remote manifest from nightly.link ZIP; update_to_latest(install_dir) applies updates; apply_update_and_restart() waits for parent PID exit and restarts launcher.
Entrypoint Update Flows and Doctor Python Selection
celune/entrypoint.py
When running_compiled(), pending updates trigger launcher request with EXIT_PENDING_UPDATE instead of in-process logic; __apply_update command handler added; doctor --fix uses _doctor_subprocess_python() to select venv or system Python based on mode.
Main Python Version Gating for Launcher
main.py
APP_NAME/APP_SLUG defined locally; _too_old_python() detects Python < 3.12; main exits early with code 6 if unsupported, before entrypoint load (special messaging for doctor command).

Core State Refactoring

Layer / File(s) Summary
Celune Core State Refactoring into Dataclasses
celune/celune.py
Refactored init to initialize grouped @dataclass containers (CeluneCallbackState, CeluneBackendState, CeluneModelState, CeluneVoiceState, CelunePipelineState, CeluneAudioState, CeluneRuntimeState); _forward_property() exposes attributes as properties; extension autoload and change_voice use project_root().
CeluneUI State Refactoring with Marquee Status Rendering
celune/ui/app.py
Refactored init to use grouped @dataclass containers (CeluneUIWidgetState, CeluneUIThemeState, CeluneUIBindingState, CeluneUILogCaptureState, CeluneUIInteractionState); added status marquee rendering with width-aware behavior; tutorial_token and tutorial_active exposed as @property; graceful_exit documented.
Volume Parameter Support for Play APIs
celune/extensions/base.py, celune/extensions/manager.py
Added volume: float = 1.0 parameter to PlayCallable protocol, CeluneExtension.play(), and Celune.play(); updated extensions/manager.py to use type[CeluneExtension] instead of Type[CeluneExtension].

Audio Playback and Mixer Refactor

Layer / File(s) Summary
Shared Playback Mixer Architecture for SFX and Speech
celune/pipeline.py
Introduced PlaybackChunk and PlaybackSourceDone dataclasses; refactored to track per-source buffers, status, and gain; added mixer helpers for ducking/gain ramping, YouTube SFX download via yt-dlp, per-source completion tracking; removed generation progress tracking; playback_worker rewritten to mix overlapping sources, coordinate glow, handle force-stop, and finalize idle behavior.
AudioRGBGlow Smoothed Audio Reactivity and Reset
celune/chroma.py
Changed from speech-timing pulse/hold model to RMS-based smoothed audio level; added reset_audio_reactivity() to clear chunks and restore idle brightness; uses ERROR color constant; changed chunk scheduling to FPS-based; adjusted brightness alpha computation.
ERROR Color Constant
celune/colors.py
Added ERROR: Final[str] = "#ce2006" constant; updated configure_theme docstring for CEVOICE/CECHAR pack references.

WebUI Integration

Layer / File(s) Summary
WebUI State, Routing, and Middleware
celune/api.py
Added large WebUI state scaffold (global buffers for status/logs/resources/input locks, polling constants, full CSS/favicon/head markup); _configure_webui_theme() derives palette from CEVOICE bundle; _is_browser_ui_request() detects /ui routes; middleware bypasses auth/rate limiting for WebUI; api_log() appends to WebUI log buffer and guards print() with ValueError handling.
WebUI Rendering and Component Interaction
celune/api.py
Implemented WebUI helpers: HTML renderers for logs/status/resources, Gradio state updaters (voice/send/input enablement), snapshot builders, speak command handling (slash commands, wake-from-sleep), voice cycling, streaming audio collection, full Gradio UI construction with timers and event handlers.
WebUI Mounting and API Root Redirect
celune/api.py
API root handler redirects / to /ui and is excluded from schema; Gradio app mounted onto FastAPI with custom CSS, footer links, favicon, and head content; run_api() celune type annotation updated.
UI Commands with WebUI and Volume Support
celune/ui/commands.py
Updated asset lookup to use project_root(); extended /play command to accept optional volume, parse as float (default 1.0), start playback in background thread with volume logging; YouTube URLs logged as "YouTube audio", local paths as "Playing …".

Backend and Model Updates

Layer / File(s) Summary
Backend Generation Progress API Removal
celune/backends/base.py, celune/backends/qwen3.py
Removed generation_progress_total() and generation_progress_steps() methods from base and Qwen3 backends; updated docstring references to CEVOICE/CECHAR packs.
Qwen3-VL Model Migration for Persona Backend
celune/persona/runtime.py, default_config.yaml
Updated PersonaBackend.load to load Qwen3VLForConditionalGeneration instead of Qwen2_5_VL; added model_type guard (TypeError if not qwen3_vl); changed quantization CUDA errors to RuntimeError; config updated to use Qwen3-VL-4B and increase short-term memory limit to 20.
CEVOICE/CECHAR Documentation Updates
celune/cevoice.py, celune/analysis.py, celune/chroma.py, multiple files
Updated all references from "CEVOICE" to "CEVOICE/CECHAR"; changed default_bundle_path() and bundled_voices_dir() to use project_root() instead of file-relative paths; updated docstrings across CEVoice, backend, constants, and UI files.

Testing and Documentation

Layer / File(s) Summary
Test Infrastructure and Coverage for New Features
tests/support.py, tests/test_api_webui.py, tests/test_pipeline.py, tests/test_runtime_paths.py, tests/test_runtime_and_ui_commands.py, tests/test_main_doctor.py, plus updates to other test files
Updated FakeGlow/FakeStream in support.py; added comprehensive ApiWebUITests covering routing, snapshots, callbacks, commands, and speech; added YouTube SFX and playback mixing tests; added compiled-path and update tests; added /play command tests; updated doctor tests for Python version gating and compiled mode; removed generation progress assertions.
Documentation: README, Guides, and Gallery
README.md, GALLERY.md
Updated README with new wordmark/badges, license note, True Color guidance, binary artifact download instructions, bin/ directory references, launcher vs binary-bin clarification, and adjusted Windows setup comments; added GALLERY.md with UI demo screenshots.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly Related PRs

  • celunah/celune#6: Overlaps with glow/audio-reactivity work in celune/chroma.py.
  • celunah/celune#17: Related through celune/updater.py update flow changes and compiled-update logic.
  • celunah/celune#15: Related via celune/api.py FastAPI/WebUI mounting and middleware adjustments.

"A launcher bundles the hope,
Audio mixes, no more to grope,
Browser WebUI steals the show,
State in classes helps us grow!" 🐰

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (7)
celune/ui/app.py (1)

107-114: ⚡ Quick win

Simplify the default value assignment.

Lines 107-109 wrap None in parentheses across multiple lines, which is unnecessarily verbose.

♻️ Simplify formatting
-    runtime_redirect_original_handlers: Optional[dict[str, list[logging.Handler]]] = (
-        None
-    )
+    runtime_redirect_original_handlers: Optional[dict[str, list[logging.Handler]]] = None
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@celune/ui/app.py` around lines 107 - 114, The three attribute defaults are
written with unnecessary multi-line parentheses; simplify by assigning None
directly to runtime_redirect_original_handlers and
runtime_redirect_original_propagate and use single-line declarations for
runtime_redirect_original_handlers, runtime_redirect_original_propagate, and
warnings_capture_enabled in the class where they are defined (referencing
runtime_redirect_original_handlers, runtime_redirect_original_propagate, and
warnings_capture_enabled) so each default is a direct simple literal (e.g.,
runtime_redirect_original_handlers: Optional[dict[str, list[logging.Handler]]] =
None) instead of the wrapped multi-line form.
celune/entrypoint.py (1)

285-291: 💤 Low value

Document why compiled execution uses venv Python for doctor repairs.

The _doctor_subprocess_python() function returns _doctor_venv_python() when running_compiled() instead of the current interpreter. This design choice should be briefly commented to explain that the compiled binary cannot directly invoke setup.py, so doctor repairs delegate to the venv interpreter.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@celune/entrypoint.py` around lines 285 - 291, Add a brief inline comment to
_doctor_subprocess_python explaining that when running_compiled() is true the
compiled binary cannot directly invoke setup.py or perform interpreter-based
repairs, so doctor fixes must be executed via the virtualenv interpreter
returned by _doctor_venv_python(); otherwise use _doctor_running_python() for
normal (non-compiled) runs. This clarifies the rationale behind choosing
_doctor_venv_python over the current interpreter.
celune/extensions/manager.py (1)

24-24: 💤 Low value

Consider using typing.Type for consistency with classic typing syntax guideline.

The built-in type[CeluneExtension] (PEP 585) is valid for Python 3.12+, but the coding guideline prefers classic typing syntax. Consider:

from typing import Type

def register(self, extension_cls: Type[CeluneExtension]) -> CeluneExtension:

This maintains consistency with the project's stated preference for classic typing module usage.

As per coding guidelines: prefer classic typing syntax.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@celune/extensions/manager.py` at line 24, Replace the PEP 585-style
annotation in the register method with the classic typing.Type usage: update the
register signature in class Manager (register(self, extension_cls:
type[CeluneExtension]) -> CeluneExtension) to use typing.Type for extension_cls
and add the corresponding import from typing; ensure CeluneExtension remains the
return type and the new Type[CeluneExtension] annotation references the same
CeluneExtension symbol.

Source: Coding guidelines

.github/workflows/ci.yml (2)

60-99: 💤 Low value

Consider pinning GitHub Actions to commit hashes for supply-chain security.

Static analysis flagged unpinned action references at lines 74 and 96. While version tags (@v5, @v7) provide convenience, pinning to commit hashes prevents unexpected behavior from tag reassignments.

Example:

- uses: astral-sh/setup-uv@bbf0a5ef00a28e8f6e8e6d245bd7b381b4cf1b68  # v7

Note: This may be an intentional trade-off between security and maintainability.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 60 - 99, The workflow uses unpinned
action tags (actions/checkout@v5, astral-sh/setup-uv@v7,
actions/upload-artifact@v6) which can be maliciously reassigned; update each
uses: reference to pin them to their specific commit SHA instead of the tag
(replace `@v5/`@v7/@v6 with the corresponding full commit hash for each action)
and verify the chosen SHAs match the intended tag versions before committing.

Source: Linters/SAST tools


101-131: 💤 Low value

Consider pinning GitHub Actions to commit hashes for supply-chain security.

Static analysis flagged unpinned action references at lines 110 and 128. Additionally, line 106-107 has a credential persistence warning—consider adding persist-credentials: false to the checkout action if the workflow doesn't need to push commits.

Example:

- name: Checkout repository
  uses: actions/checkout@<hash>  # v5
  with:
    persist-credentials: false

Note: These may be intentional trade-offs for this project.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 101 - 131, Update the workflow to pin
third-party actions to immutable commit SHAs instead of tags for the steps named
"Checkout repository" (uses: actions/checkout@v5), "Install uv" (uses:
astral-sh/setup-uv@v7) and "Upload Windows launcher artifacts" (uses:
actions/upload-artifact@v6) by replacing the tag with the corresponding commit
hash; also add the with: persist-credentials: false option to the "Checkout
repository" step to avoid leaking credentials when not needed. Ensure you
reference and update the exact steps by their step names ("Checkout repository",
"Install uv", "Upload Windows launcher artifacts") so the SHA pins and the
persist-credentials setting are applied in the correct places.

Source: Linters/SAST tools

celune/colors.py (1)

17-17: ⚡ Quick win

Use classic type alias syntax instead of PEP 695 type statement.

The coding guideline prefers classic typing syntax. The type RGB = ... statement is PEP 695 syntax (Python 3.12+). Consider using the classic type alias pattern:

RGB = tuple[int, int, int]

or with explicit annotation:

from typing import TypeAlias
RGB: TypeAlias = tuple[int, int, int]

As per coding guidelines: prefer classic typing syntax over newer PEP syntax features.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@celune/colors.py` at line 17, Replace the PEP 695 "type" statement that
defines the RGB alias with the classic type-alias pattern: change the RGB
declaration to a simple assignment-style alias to a 3-tuple of ints, or
alternatively annotate RGB using typing.TypeAlias, so the name RGB resolves as
the intended tuple[int, int, int] type; update the RGB declaration in colors.py
accordingly.

Source: Coding guidelines

celune/api.py (1)

556-732: 💤 Low value

Dynamic attribute injection for callback tracking.

Line 732 uses setattr(celune, "_webui_callbacks_wrapped", True) to track whether callbacks have been wrapped. While functional, this injects a private attribute onto the Celune instance.

Consider adding a typed attribute to the Celune class if this pattern persists, or documenting the convention. For now, the approach works and prevents double-wrapping.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@celune/api.py` around lines 556 - 732, The current callback-wrapping uses
dynamic attribute injection via setattr(celune, "_webui_callbacks_wrapped",
True) in _wrap_celune_callbacks which mutates the Celune instance at runtime;
instead add a typed attribute _webui_callbacks_wrapped: bool = False to the
Celune class definition and update _wrap_celune_callbacks to read and set that
attribute directly (e.g., check getattr/celune._webui_callbacks_wrapped and
assign celune._webui_callbacks_wrapped = True) so the flag is part of the class
surface rather than injected dynamically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@celune/pipeline.py`:
- Around line 2356-2361: When _ensure_playback_stream(engine, BASE_SR) returns
False you must call release_pipeline(engine) before clearing mixer state and
breaking so engine.locked is cleared; update the failure branch that currently
clears
source_buffers/source_done/_playback_source_statuses(engine)/_playback_source_meta(engine)
to first call release_pipeline(engine) (or the appropriate release_pipeline call
used elsewhere) and then clear state and break, ensuring subsequent say()/play()
calls are not rejected due to engine.locked remaining True.
- Around line 833-858: The subprocess call in _download_youtube_sfx uses
subprocess.run without a timeout which can hang; add a reasonable timeout
argument (e.g., timeout=<seconds>) to the subprocess.run call that invokes
yt_dlp_module and wrap the call in a try/except that catches
subprocess.TimeoutExpired and handles it the same way as the current non-zero
return/error paths (log the timeout, set completed/return appropriate failure
state, and clean up any partial output) so behavior matches existing error
handling for _download_youtube_sfx.

In `@GALLERY.md`:
- Around line 17-19: The "Change voice" section heading is plain text and needs
to be a Markdown heading; update the line containing "Change voice" to a proper
heading (e.g., prefix with a Markdown header token like "### " or the same
heading level used by other gallery sections) so the section renders
consistently with the other headings and leaves the existing image/link block
intact.

In `@scripts/build_nuitka.ps1`:
- Line 76: After running the Nuitka command invocation (& uv `@arguments`) check
the PowerShell exit code stored in $LASTEXITCODE and abort the script if it is
non-zero; specifically, immediately after the & uv `@arguments` call inspect
$LASTEXITCODE and call exit or throw an error to prevent continuing to the C
launcher compilation step (the subsequent launcher build), so the script only
proceeds to compile the launcher when the Nuitka step succeeded.
- Around line 12-13: The environment variables $env:CL and $env:_CL_ are set
globally before the Nuitka invocation (& uv `@arguments`) so they affect both
Nuitka's MSVC invocation and the later manual compile/link command stored in
$compileCmd; scope them only for the launcher build by setting and restoring
them immediately around the launcher invocation (or explicitly pass equivalent
flags to Nuitka) instead of leaving them set for the whole script—wrap the
temporary assignments in a local/try/finally or save original values, set
$env:CL and $env:_CL_ just before running cmd /c $compileCmd (or before & uv
`@arguments` if the intent is for Nuitka only), then restore the originals after
that command completes so $compileCmd runs with the original environment.

In `@scripts/build_nuitka.sh`:
- Around line 99-143: The manifest currently hardcodes "Celune-linux-x64"; pass
the detected appimage_arch into the Python block and use it when building
manifest["artifact"]. Concretely, set CELUNE_ARCH="$appimage_arch" when invoking
the Python runner (or export it beforehand) where you call appimage_arch and run
uv run python -, and inside that Python snippet read os.environ["CELUNE_ARCH"]
and set manifest["artifact"] to "Celune-linux-" + that value (use the existing
manifest variable in the Python block). This ensures the artifact string
reflects the appimage_arch value determined earlier.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 60-99: The workflow uses unpinned action tags
(actions/checkout@v5, astral-sh/setup-uv@v7, actions/upload-artifact@v6) which
can be maliciously reassigned; update each uses: reference to pin them to their
specific commit SHA instead of the tag (replace `@v5/`@v7/@v6 with the
corresponding full commit hash for each action) and verify the chosen SHAs match
the intended tag versions before committing.
- Around line 101-131: Update the workflow to pin third-party actions to
immutable commit SHAs instead of tags for the steps named "Checkout repository"
(uses: actions/checkout@v5), "Install uv" (uses: astral-sh/setup-uv@v7) and
"Upload Windows launcher artifacts" (uses: actions/upload-artifact@v6) by
replacing the tag with the corresponding commit hash; also add the with:
persist-credentials: false option to the "Checkout repository" step to avoid
leaking credentials when not needed. Ensure you reference and update the exact
steps by their step names ("Checkout repository", "Install uv", "Upload Windows
launcher artifacts") so the SHA pins and the persist-credentials setting are
applied in the correct places.

In `@celune/api.py`:
- Around line 556-732: The current callback-wrapping uses dynamic attribute
injection via setattr(celune, "_webui_callbacks_wrapped", True) in
_wrap_celune_callbacks which mutates the Celune instance at runtime; instead add
a typed attribute _webui_callbacks_wrapped: bool = False to the Celune class
definition and update _wrap_celune_callbacks to read and set that attribute
directly (e.g., check getattr/celune._webui_callbacks_wrapped and assign
celune._webui_callbacks_wrapped = True) so the flag is part of the class surface
rather than injected dynamically.

In `@celune/colors.py`:
- Line 17: Replace the PEP 695 "type" statement that defines the RGB alias with
the classic type-alias pattern: change the RGB declaration to a simple
assignment-style alias to a 3-tuple of ints, or alternatively annotate RGB using
typing.TypeAlias, so the name RGB resolves as the intended tuple[int, int, int]
type; update the RGB declaration in colors.py accordingly.

In `@celune/entrypoint.py`:
- Around line 285-291: Add a brief inline comment to _doctor_subprocess_python
explaining that when running_compiled() is true the compiled binary cannot
directly invoke setup.py or perform interpreter-based repairs, so doctor fixes
must be executed via the virtualenv interpreter returned by
_doctor_venv_python(); otherwise use _doctor_running_python() for normal
(non-compiled) runs. This clarifies the rationale behind choosing
_doctor_venv_python over the current interpreter.

In `@celune/extensions/manager.py`:
- Line 24: Replace the PEP 585-style annotation in the register method with the
classic typing.Type usage: update the register signature in class Manager
(register(self, extension_cls: type[CeluneExtension]) -> CeluneExtension) to use
typing.Type for extension_cls and add the corresponding import from typing;
ensure CeluneExtension remains the return type and the new Type[CeluneExtension]
annotation references the same CeluneExtension symbol.

In `@celune/ui/app.py`:
- Around line 107-114: The three attribute defaults are written with unnecessary
multi-line parentheses; simplify by assigning None directly to
runtime_redirect_original_handlers and runtime_redirect_original_propagate and
use single-line declarations for runtime_redirect_original_handlers,
runtime_redirect_original_propagate, and warnings_capture_enabled in the class
where they are defined (referencing runtime_redirect_original_handlers,
runtime_redirect_original_propagate, and warnings_capture_enabled) so each
default is a direct simple literal (e.g., runtime_redirect_original_handlers:
Optional[dict[str, list[logging.Handler]]] = None) instead of the wrapped
multi-line form.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c426611-2f3e-4cf7-96c7-3a1c593cd1fe

📥 Commits

Reviewing files that changed from the base of the PR and between 238443f and 812ebd5.

⛔ Files ignored due to path filters (12)
  • celune.exe is excluded by !**/*.exe
  • resources/branding/celune.svg is excluded by !**/*.svg
  • resources/branding/celune_88x31_206.png is excluded by !**/*.png
  • resources/branding/celune_88x31_206_light.png is excluded by !**/*.png
  • resources/branding/celune_88x31_basic.png is excluded by !**/*.png
  • resources/branding/celune_88x31_basic_light.png is excluded by !**/*.png
  • resources/branding/celune_dark.svg is excluded by !**/*.svg
  • resources/branding/celune_wordmark.png is excluded by !**/*.png
  • resources/branding/celune_wordmark_dark.png is excluded by !**/*.png
  • resources/branding/celune_wordmark_transparent.png is excluded by !**/*.png
  • resources/celune.ico is excluded by !**/*.ico
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (68)
  • .github/workflows/build-linux.yml
  • .github/workflows/build-windows.yml
  • .github/workflows/ci.yml
  • .gitignore
  • AGENTS.md
  • GALLERY.md
  • README.md
  • celune.AppImage
  • celune/__init__.py
  • celune/analysis.py
  • celune/api.py
  • celune/backends/base.py
  • celune/backends/mini.py
  • celune/backends/qwen3.py
  • celune/backends/voxcpm2.py
  • celune/celune.py
  • celune/cevoice.py
  • celune/chroma.py
  • celune/colors.py
  • celune/config.py
  • celune/constants.py
  • celune/entrypoint.py
  • celune/extensions/base.py
  • celune/extensions/manager.py
  • celune/modeling.py
  • celune/namedays.py
  • celune/paths.py
  • celune/persona/impl.py
  • celune/persona/memory.py
  • celune/persona/runtime.py
  • celune/pipeline.py
  • celune/runtime.py
  • celune/ui/app.py
  • celune/ui/commands.py
  • celune/ui/headless.py
  • celune/ui/resources.py
  • celune/ui/terminal.py
  • celune/ui/theme.py
  • celune/updater.py
  • celune/utils.py
  • celune/vram.py
  • default_config.yaml
  • launcher.c
  • main.py
  • nuitka_main.py
  • pyproject.toml
  • requirements.txt
  • resources/celune.res
  • scripts/build_nuitka.ps1
  • scripts/build_nuitka.sh
  • scripts/run_ci.py
  • tests/support.py
  • tests/test_analysis_and_chroma.py
  • tests/test_api_audio.py
  • tests/test_api_think.py
  • tests/test_api_webui.py
  • tests/test_backends_and_extensions.py
  • tests/test_backends_mini.py
  • tests/test_celune_core.py
  • tests/test_config_and_utils.py
  • tests/test_main_doctor.py
  • tests/test_modeling.py
  • tests/test_namedays_i18n_updater.py
  • tests/test_persona_api.py
  • tests/test_persona_memory.py
  • tests/test_pipeline.py
  • tests/test_runtime_and_ui_commands.py
  • tests/test_runtime_paths.py
💤 Files with no reviewable changes (2)
  • .github/workflows/build-windows.yml
  • .github/workflows/build-linux.yml

Comment thread celune/pipeline.py Outdated
Comment thread celune/pipeline.py
Comment thread GALLERY.md Outdated
Comment thread scripts/build_nuitka.ps1
Comment on lines +12 to +13
$env:CL = "/O2 /GL /GS /guard:cf /DNDEBUG"
$env:_CL_ = "/link /LTCG /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if Nuitka or other tools invoke additional C/C++ compilations
rg -n 'cl\.exe|cl\s|msvc|compiler' scripts/build_nuitka.ps1

Repository: celunah/celune

Length of output: 335


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show relevant parts of the script (small enough to be safe)
sed -n '1,140p' scripts/build_nuitka.ps1 | nl -ba

# Find all uses of these env vars
rg -n '\$env:CL|\$env:_CL_' scripts/build_nuitka.ps1

# Find all cl.exe invocations (or other C/C++ compile drivers) in the script
rg -n 'cl\.exe|(^|\s)cl(\s|$)|msvc|compiler' scripts/build_nuitka.ps1

# Check if Nuitka or other tools are invoked in a way that might trigger extra C/C++ compilations
rg -n 'nuitka|pip|subprocess|build|compile|MSVC|vswhere|VsDevCmd|vcvars' scripts/build_nuitka.ps1

Repository: celunah/celune

Length of output: 101


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show relevant parts of the script with line numbers (use cat -n instead of nl)
sed -n '1,160p' scripts/build_nuitka.ps1 | cat -n

# Find all uses of these env vars
rg -n '\$env:CL|\$env:_CL_' scripts/build_nuitka.ps1

# Find all cl.exe invocations (or other C/C++ compile drivers) in the script
rg -n 'cl\.exe|(^|\s)cl(\s|$)|msvc|compiler' scripts/build_nuitka.ps1

# Check how/if Nuitka is invoked and whether the script resets env vars
rg -n 'nuitka|pip|subprocess|build|compile|MSVC|vswhere|VsDevCmd|vcvars|$env:CL\s*=|$env:_CL_\s*=' scripts/build_nuitka.ps1

Repository: celunah/celune

Length of output: 6746


Scope $env:CL / $env:_CL_ to the launcher build (or explicitly apply them to Nuitka).
In scripts/build_nuitka.ps1, $env:CL and $env:_CL_ are set at lines 12–13 before & uv @arguments`` runs Nuitka (line ~76), so they will affect both Nuitka’s MSVC cl usage and the later manual `cl`/link step in `$compileCmd` (line 98). If these flags are intended only for the launcher, set/restore the env vars just around `cmd /c $compileCmd` instead of leaving them for the whole script.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/build_nuitka.ps1` around lines 12 - 13, The environment variables
$env:CL and $env:_CL_ are set globally before the Nuitka invocation (& uv
`@arguments`) so they affect both Nuitka's MSVC invocation and the later manual
compile/link command stored in $compileCmd; scope them only for the launcher
build by setting and restoring them immediately around the launcher invocation
(or explicitly pass equivalent flags to Nuitka) instead of leaving them set for
the whole script—wrap the temporary assignments in a local/try/finally or save
original values, set $env:CL and $env:_CL_ just before running cmd /c
$compileCmd (or before & uv `@arguments` if the intent is for Nuitka only), then
restore the originals after that command completes so $compileCmd runs with the
original environment.

Comment thread scripts/build_nuitka.ps1
Comment thread scripts/build_nuitka.sh
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