fix: use JSON-RPC POST for Dewey doctor health check#17
Open
yvonnedevlinrh wants to merge 2 commits into
Open
Conversation
Replace http.Client.Get() with memory.Client.Health() in checkDewey() to send a proper JSON-RPC 2.0 POST instead of an incompatible HTTP GET to the MCP endpoint. This eliminates spurious "Dewey returned HTTP 400" warnings when Dewey is healthy. - Replace raw HTTP GET with memory.NewClient().Health() JSON-RPC call - Add protocol-aware JSON-RPC mock handler for tests - Strengthen test assertions (Name, Status, Message, Duration) - Add TestCheckDewey_RPCError for JSON-RPC error response coverage - Include OpenSpec artifacts and retrospective learnings Fixes: unbound-force#16 Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
The memory.Client.Health() approach still failed because the MCP Streamable HTTP transport requires an Accept header with both application/json and text/event-stream, and uses the initialize method (not dewey_health). Replace with a direct MCP initialize probe that properly handles SSE responses. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
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.
Replace http.Client.Get() with memory.Client.Health() in checkDewey() to send a proper JSON-RPC 2.0 POST instead of an incompatible HTTP GET to the MCP endpoint. This eliminates spurious "Dewey returned HTTP 400" warnings when Dewey is healthy.
Fixes: #16
Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Yvonne Devlin ydevlin@redhat.com