Skip to content

Commit 94bcf34

Browse files
Improve error handling in commit_profile method
Handle errors during profile commit and stop profile if needed. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 3519f0e commit 94bcf34

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎atom/model_engine/llm_engine.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ def start_profile(
372372
self._broadcast_utility("release_profile", token=token)
373373
return reserved
374374
try:
375-
return self._broadcast_utility("commit_profile", token=token)
375+
committed = self._broadcast_utility("commit_profile", token=token)
376+
if any("error" in result for result in committed):
377+
self.core_mgr.broadcast_utility_command("stop_profile")
378+
return committed
376379
except Exception:
377380
# Engines that did commit are recording behind a /start_profile
378381
# that failed, and nothing else will close their window.

0 commit comments

Comments
 (0)