Merged
Conversation
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.
Closes #2
This pull request introduces a robust process monitoring and auto-restart mechanism for the
opencode-server.shscript, ensuring that both the OpenCode server and its Caddy proxy are automatically relaunched if they unexpectedly die. It also adds comprehensive tests to verify the monitor’s behavior and updates the workflow to run tests on pull requests. The changes improve reliability, support graceful shutdowns, and ensure no orphaned processes remain between runs.Process monitoring and reliability improvements:
opencode-server.shthat checks the health of the OpenCode and Caddy processes, automatically relaunching them if they die unexpectedly. The monitor uses a configurable interval (OPENCODE_MONITOR_INTERVAL) and writes its PID to the PID file. It respects a stop flag for intentional shutdowns. [1] [2] [3] [4] [5]Graceful shutdown and process management:
Testing improvements:
tests/test-devcontainer.shwith new tests to verify that the monitor process is terminated on stop, and that both the OpenCode and Caddy processes are relaunched if killed externally. Also added tests to ensure processes are not relaunched after a proper stop. [1] [2]Continuous integration:
.github/workflows/test.yml) to automatically run the test suite on pull requests targeting themainbranch.