Skip to content

fix: use JSON-RPC POST for Dewey doctor health check#17

Open
yvonnedevlinrh wants to merge 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/fix-dewey-doctor-check
Open

fix: use JSON-RPC POST for Dewey doctor health check#17
yvonnedevlinrh wants to merge 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/fix-dewey-doctor-check

Conversation

@yvonnedevlinrh

@yvonnedevlinrh yvonnedevlinrh commented Jun 11, 2026

Copy link
Copy Markdown

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: #16

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Yvonne Devlin ydevlin@redhat.com

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>
@gxmiranda gxmiranda requested review from gxmiranda and jflowers June 11, 2026 12:12
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>

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: checkDewey doctor check uses HTTP GET against POST-only MCP endpoint

2 participants