You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local agent: 'Cannot start a runtime from within a runtime' panic on shutdown/hot-reload #1082
The app panics on shutdown and hot-reload with a Tokio runtime conflict during inference engine teardown, followed by a Metal/llama.cpp assertion failure.
Observed Error
thread 'main' panicked at packages/desktop-app/src-tauri/src/commands/local_agent.rs:222:12:
Cannot start a runtime from within a runtime.
...
GGML_ASSERT([rsets->data count] == 0) failed
Reproduction
Launch the app with local Ollama agent enabled
Close the app OR trigger a hot-reload (Tauri dev mode)
Panic occurs during inference engine teardown
Root Cause
The panic originates at packages/desktop-app/src-tauri/src/commands/local_agent.rs:222 — the inference engine teardown is attempting to start a new Tokio runtime from within an already-running async context. This triggers the Cannot start a runtime from within a runtime panic.
The secondary GGML_ASSERT([rsets->data count] == 0) failure is a Metal GPU residency set leak from llama.cpp — likely caused by the Tokio panic aborting cleanup before GPU resources are released.
Impact
Non-blocking: the app has already closed/reloaded by the time this fires
No data loss
Pre-existing: not introduced by recent changes
Acceptance Criteria
Inference engine teardown does not panic on app close
Inference engine teardown does not panic on hot-reload
Metal GPU residency set is properly released on teardown
No GGML_ASSERT failures in llama.cpp during shutdown
Activity
malibio commentedon Apr 11, 2026
Frontend baseline: 3918 passed (128 test files), 0 failed
Fix: inference engine teardown Tokio runtime panic on shutdown/hot-re…
malibio commentedon Apr 11, 2026
PR created: #1098. All acceptance criteria met. Code review passed clean (APPROVE). Two cosmetic suggestions noted, both non-blocking.
Fix: inference engine teardown Tokio runtime panic on shutdown/hot-re…
malibio commentedon Apr 11, 2026
PR #1098 merged. All acceptance criteria met. Review passed clean.
Fix: address retroactive review findings for #1082 and fix e2e test c…
Fix: address retroactive review findings for #1082 and fix e2e test c…
malibio commentedon Apr 17, 2026
Follow-up PR #1103 merged. All retroactive review findings from PR #1098 addressed and review passed clean.
Fix: address retroactive review findings for #1082 and fix e2e test c…
Fix: inference engine teardown Tokio runtime panic on shutdown/hot-re…
Fix: address retroactive review findings for #1082 and fix e2e test c…
Fix: address retroactive review findings for #1082 and fix e2e test c…