Skip to content

Stability: ORT panic fix + gap analysis update - #802

Merged
joelteply merged 2 commits into
mainfrom
fix/stability-ipc-events
Apr 6, 2026
Merged

joelteply merged 2 commits into
mainfrom
fix/stability-ipc-events

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

TTS/STT init runs inside tokio::task::spawn so panics from missing
libonnxruntime.dylib are caught as JoinError instead of poisoning
the tokio runtime. Voice features degrade gracefully — core stays alive.
New issues mapped to phases:
- Phase 0: ORT panic (#792 DONE), IPC reconnection (#793), event bridge (#794), duplicate tabs (#795)
- Phase 2: LiveKit Docker validation (#797), Qwen3.5 native audio (#799), custom STT (#800), custom TTS (#801)
- Phase 10: Grid-routed inference (#798)
- Phase 11: Docker E2E with live+grid (#796)
Copilot AI review requested due to automatic review settings April 6, 2026 04:37
@joelteply
joelteply merged commit 4477dc1 into main Apr 6, 2026
9 checks passed
@joelteply
joelteply deleted the fix/stability-ipc-events branch April 6, 2026 04:37

Copilot AI 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.

Pull request overview

Improves runtime stability of continuum-core by isolating voice subsystem initialization so ORT dylib panics don’t take down the server, and updates the Alpha gap analysis planning doc with newly tracked stability/voice/docker issues.

Changes:

  • Run STT/TTS initialization inside an awaited spawned task to surface panics as JoinError and keep the core alive.
  • Add explicit logging when STT/TTS adapters are unavailable or when initialization panics.
  • Update ALPHA-GAP-ANALYSIS.md status/date and map issues #792–#801 into phases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/workers/continuum-core/src/main.rs Wrapes voice init in a spawned task and handles JoinError to avoid ORT panic crashing the server.
docs/planning/ALPHA-GAP-ANALYSIS.md Updates planning status and adds new issue mappings (#792–#801) and updated “done when” criteria.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +163 to +164
// Wrapped in catch_unwind because ORT panics (not errors) when libonnxruntime.dylib
// is missing. A missing TTS/STT model must NEVER crash the entire server.

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The comment says this is "Wrapped in catch_unwind", but the implementation uses a nested tokio::task::spawn + JoinError handling. Please either update the comment to match the actual mechanism, or explicitly use std::panic::catch_unwind if that’s the intended approach.

Suggested change
// Wrapped in catch_unwind because ORT panics (not errors) when libonnxruntime.dylib
// is missing. A missing TTS/STT model must NEVER crash the entire server.
// Run initialization in a nested Tokio task so any ORT panic (for example, when
// libonnxruntime.dylib is missing) is captured as a JoinError when awaited below.
// A missing TTS/STT model must NEVER crash the entire server.

Copilot uses AI. Check for mistakes.
Comment on lines +205 to +206
tracing::error!("⚠️ TTS/STT initialization panicked (ORT dylib missing?): {:?}", e);
tracing::error!(" Voice features disabled. Install libonnxruntime or set ORT_DYLIB_PATH.");

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

JoinError can indicate either a panic or task cancellation, but the log message always reports a panic ("initialization panicked"). Consider branching on is_panic() vs is_cancelled() so shutdown/runtime teardown doesn’t produce misleading error logs.

Suggested change
tracing::error!("⚠️ TTS/STT initialization panicked (ORT dylib missing?): {:?}", e);
tracing::error!(" Voice features disabled. Install libonnxruntime or set ORT_DYLIB_PATH.");
if e.is_panic() {
tracing::error!("⚠️ TTS/STT initialization panicked (ORT dylib missing?): {:?}", e);
tracing::error!(
" Voice features disabled. Install libonnxruntime or set ORT_DYLIB_PATH."
);
} else if e.is_cancelled() {
tracing::warn!(
"⚠️ TTS/STT initialization was cancelled during shutdown/runtime teardown."
);
tracing::warn!(" Voice features remain disabled.");
} else {
tracing::error!("⚠️ TTS/STT initialization failed to join: {:?}", e);
tracing::error!(" Voice features remain disabled.");
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ORT panic crashes server when libonnxruntime.dylib missing

2 participants