[OPIK-5750] [SDK] feat: add error visibility to runner TUI for crashes and crash loops#6154
Merged
petrotiurin merged 6 commits intomainfrom Apr 9, 2026
Merged
Conversation
…s and crash loops The supervisor now notifies the TUI when a child process crashes and is restarted, and when crash-loop protection activates. Adds a general-purpose on_error callback to Supervisor and a corresponding error() method on RunnerTUI. The child_restarted message now includes the reason. Implements OPIK-5750 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…isibility Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Python SDK Unit Tests Results (Python 3.11)2 820 tests 2 820 ✅ 1m 47s ⏱️ Results for commit d51a459. ♻️ This comment has been updated with latest results. |
…akiness All tests that call sup.run() now pass watch=False to _make_supervisor to avoid the file watcher interfering with test timing and shutdown events. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…or child exit logic TestChildExit now uses mocks to test exit handling logic directly instead of spawning actual Python processes. Tests now run in 0.05s instead of 8+ seconds. - test_restarts_on_nonzero_exit_if_stable: verify callback fires on crash restart - test_triggers_error_on_crash_loop: verify error callback fires when guard unstable - test_clean_exit_zero_no_restart: verify clean exit sets shutdown event Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test had a nonsensical if 0 == 0: placeholder that didn't actually test anything. The behavior it attempted to document (exit code 0 → shutdown) is already covered by _main_loop integration tests in TestShutdown. Removed to keep TestChildExit focused on testing _handle_child_exit behavior with fast unit tests. Implements OPIK-5750
Contributor
Python SDK E2E Tests Results (Python 3.11)365 tests 363 ✅ 16m 32s ⏱️ Results for commit 7a72b31. ♻️ This comment has been updated with latest results. |
collincunn
approved these changes
Apr 9, 2026
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.
Details
The runner supervisor silently restarted the child process on crashes without notifying the user via the TUI. This adds two missing visibility paths:
A general-purpose
on_errorcallback is added toSupervisor(separate fromon_child_restart) so the TUI can distinguish informational restarts from error states.With this change:

Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
Testing
ruff,ruff-format,mypy)opik connectagainst a crashing child process validates the error and restart messages appearDocumentation
N/A