Stability improvements: V0.6 Maybe#772
Conversation
…-platforms Fix CUDA downloads on unsupported platforms
fix: replace deprecated datetime.utcnow() with datetime.now(UTC) thro…
fix: enforce 10MB size limit and validate extensions for avatar uploads
fix: fail fast when model not downloaded instead of retrying infinitely
…ment fix: personality LLM now respects the selected refinement model
fix(backend): enable long-form Whisper transcription on PyTorch path
fix(linux): avoid abort when hiding the dictate pill
📝 WalkthroughWalkthroughA focused stability pass applying seven bug fixes: CUDA binary downloads are now gated to Windows only with fast-fail enforcement; personality and compose endpoints respect the configured LLM model; transcription endpoint respects the configured STT model; avatar uploads validate extensions and enforce a 10 MB cap; PyTorch Whisper enables long-form transcription; model generation fails fast when the model is absent; Linux dictate pill crash is prevented via a compile flag; and all ChangesStability Bug Fixes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
backend/routes/tasks.py (1)
89-96:⚠️ Potential issue | 🟡 MinorNormalize parsed timestamps to UTC when tzinfo is missing.
Timestamps created in
backend/utils/progress.pyusedatetime.now().isoformat(), which produces naive datetime strings without timezone information. When these strings are parsed withfromisoformat(), the.replace("Z", "+00:00")has no effect (no "Z" present), andfromisoformat()returns a naive datetime. This causesstarted_atto be inconsistent—sometimes naive, sometimes aware with UTC—despite the fallback on parse failure.Proposed fix
if timestamp_str: try: started_at = datetime.fromisoformat(timestamp_str.replace("Z", "+00:00")) + if started_at.tzinfo is None: + started_at = started_at.replace(tzinfo=UTC) except (ValueError, AttributeError): started_at = datetime.now(UTC) else: started_at = datetime.now(UTC)🤖 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 `@backend/routes/tasks.py` around lines 89 - 96, The parsed timestamp from fromisoformat() may return a naive datetime (without timezone info) since the original timestamp string lacks a "Z" suffix, making the replace operation ineffective. After successfully parsing the timestamp_str with fromisoformat() in the try block, check if the resulting started_at object has no timezone information (tzinfo is None), and if so, explicitly set it to UTC using the replace method with tzinfo=UTC. This ensures all parsed timestamps are consistently timezone-aware datetimes in UTC, matching the fallback behavior in the else clause.
🤖 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 `@backend/database/models.py`:
- Around line 47-48: All DateTime column definitions in the models file that
receive timezone-aware UTC datetimes via datetime.now(UTC) must include the
timezone=True parameter to preserve timezone information through the database
round-trip. Update the created_at and updated_at columns at lines 47-48, and
apply the same timezone=True parameter to all other DateTime columns mentioned
(at lines 85, 96-97, 114, 125-126, 141, 155, 166, 257-258, and 281) to ensure
consistent behavior across all timestamp columns and prevent SQLite from
stripping timezone information on storage and retrieval.
In `@backend/routes/profiles.py`:
- Around line 151-153: Remove ".svg" from the _ALLOWED_IMAGE_EXTS set constant
to prevent SVG uploads which can pose security risks due to active content.
Additionally, ensure that the file extension validation logic (likely used
elsewhere around lines 238-243 as mentioned) properly handles edge cases like
extensionless filenames by requiring that a valid extension is present and
matches one of the allowed raster image extensions in the set. The allowed
extensions should be limited to safe raster formats only: ".png", ".jpg",
".jpeg", ".gif", ".webp", and ".bmp".
In `@backend/services/cuda.py`:
- Line 34: The CUDA_DOWNLOAD_UNSUPPORTED_REASON constant message is misleading
for non-Linux platforms like macOS because it specifically mentions "Linux
users" when the actual gate applies to all non-Windows systems. Update this
constant string to use platform-agnostic language that covers all non-Windows
platforms instead of Linux-specific guidance (e.g., replace "Linux users" with
"users on non-Windows platforms" or similar terminology).
---
Outside diff comments:
In `@backend/routes/tasks.py`:
- Around line 89-96: The parsed timestamp from fromisoformat() may return a
naive datetime (without timezone info) since the original timestamp string lacks
a "Z" suffix, making the replace operation ineffective. After successfully
parsing the timestamp_str with fromisoformat() in the try block, check if the
resulting started_at object has no timezone information (tzinfo is None), and if
so, explicitly set it to UTC using the replace method with tzinfo=UTC. This
ensures all parsed timestamps are consistently timezone-aware datetimes in UTC,
matching the fallback behavior in the else clause.
🪄 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: 83e4e74a-e457-4ca9-93cc-9ef933ba0b60
📒 Files selected for processing (20)
CHANGELOG.mdapp/src/lib/api/types.tsbackend/backends/pytorch_backend.pybackend/database/models.pybackend/routes/cuda.pybackend/routes/generations.pybackend/routes/profiles.pybackend/routes/tasks.pybackend/services/channels.pybackend/services/cuda.pybackend/services/export_import.pybackend/services/generation.pybackend/services/history.pybackend/services/profiles.pybackend/services/stories.pybackend/tests/test_cuda_download.pybackend/utils/tasks.pydocs/content/docs/overview/gpu-acceleration.mdxdocs/content/docs/overview/introduction.mdxtauri/src-tauri/src/main.rs
I have been working on ironing out some of the bugs and errors for my own build but would like to share if you want any.
Summary by CodeRabbit
Release Notes