fix(cli): report mismatched service status - #36275
Closed
kitlangton wants to merge 2 commits into
Closed
Conversation
kitlangton
force-pushed
the
service-status
branch
from
July 11, 2026 00:15
b4c3c9e to
b9fc8b9
Compare
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.
Summary
stoppedoutput fromservice statuswith explicit JSON inspection statesservice statusis an operator-invoked, read-only command. OpenCode does not call it automatically, and inspection never starts, stops, replaces, or signals a process.States
stoppedinvalidunhealthylegacy{ "healthy": true }without PID/version identityinconsistentrunningcompatiblecompares the reported server version with the installed CLI versionThe registration password is used for the health request but is never included in output.
Examples
Healthy but version-mismatched:
{ "status": "running", "url": "http://127.0.0.1:4096", "pid": 81804, "version": "0.0.0-next-15293", "compatible": false, "clientVersion": "0.0.0-next-15295" }Registration and health disagree:
{ "status": "inconsistent", "fields": ["pid", "version"], "registration": { "url": "http://127.0.0.1:4096", "pid": 81804, "version": "0.0.0-next-15293" }, "health": { "pid": 81900, "version": "0.0.0-next-15295" }, "clientVersion": "0.0.0-next-15295" }No registration:
{ "status": "stopped", "clientVersion": "0.0.0-next-15295" }Lifecycle Boundary
This PR changes diagnostics only.
Service.discover(options)retains its exact-version gate,Service.start(options)still replaces mismatched daemons, and lifecycle operations retain legacy-health support. The client tests explicitly verify gated and ungated discovery after the inspection refactor.Verification
bun run testfrompackages/client: 24 passedbun run test test/service.test.tsfrompackages/cli: 3 passedbun typecheckfrompackages/client: passedbun typecheckfrompackages/cli: passedFixes #36274