Fix/critical bugs#1
Merged
Merged
Conversation
added 7 commits
May 12, 2026 11:57
…ng, AudioRecorder cycle
There was a problem hiding this comment.
Pull request overview
This PR targets a set of reliability and safety fixes across the Phonos server and macOS client, including improved cleanup on upload failures, safer audio tap capturing, and configurable model-load timeouts.
Changes:
- Improved server-side temp file cleanup during streamed uploads and added a startup warning when auth is disabled.
- Made model-load timeout configurable and added worker restart behavior on transcription timeouts.
- Fixed a potential retain cycle in the macOS
AudioRecordertap closure.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| CHANGELOG.md | Documents the 1.5.1 fixes/changes. |
| apps/server/phonos_server/transcription.py | Adds try/except cleanup around temp-file streaming writes. |
| apps/server/phonos_server/models.py | Uses configurable model-load timeout; restarts worker on transcription timeout. |
| apps/server/phonos_server/main.py | Logs a warning when auth is disabled at startup. |
| apps/server/phonos_server/config.py | Adds model_load_timeout_seconds setting. |
| apps/macos/Sources/AudioRecorder.swift | Uses [weak self] in the installTap closure to avoid a strong cycle. |
| .gitignore | Ignores findings.md and .codex. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -33,19 +33,29 @@ async def transcribe_audio( | |||
|
|
|||
| max_upload_bytes = settings.max_upload_mb * 1024 * 1024 | |||
| suffix = os.path.splitext(file.filename)[1] or ".wav" | |||
Comment on lines
214
to
226
| msg = self._result_queue.get(timeout=timeout) | ||
| except queue.Empty as exc: | ||
| self._last_error = f"Timed out transcribing audio after {timeout} seconds" | ||
| # Kill stale worker, reload fresh one to prevent stale results | ||
| self._stop_worker() | ||
| self._lock.release() | ||
| try: | ||
| self.load(self._model_name) | ||
| except Exception: | ||
| self._status = "error" | ||
| finally: | ||
| self._lock.acquire() | ||
| raise TimeoutError(self._last_error) from exc |
Comment on lines
+217
to
+225
| # Kill stale worker, reload fresh one to prevent stale results | ||
| self._stop_worker() | ||
| self._lock.release() | ||
| try: | ||
| self.load(self._model_name) | ||
| except Exception: | ||
| self._status = "error" | ||
| finally: | ||
| self._lock.acquire() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.