Repository navigation
fix: use native fetch for CDM instance discovery - #232
Merged
Merged
Conversation
Use the same native fetch transport as the asynchronous CDM query path for OpenSearch index discovery. This avoids the remaining then-request transport failures observed after metric queries in the Crucible MCP integration job. Follow-up to #231 AI-Tool: Codex AI-Model: gpt-6.1-sol AI-Effort: not specified
atheurer
approved these changes
Nov 19, 2026
atheurer
left a comment
Contributor
There was a problem hiding this comment.
LGTM. getInstancesInfo() now uses native fetch instead of then-request/sync-rpc, matching the reported Crucible MCP discovery failure mode. Non-2xx responses are now rejected explicitly and host-offline handling is preserved; index/version discovery logic is unchanged.
Verified locally on 4b384d9:
node --check cdm.js— OKnpx prettier --check cdm.js— cleannpm run test:instance-discovery— 2/2 passnpm test— all suites pass (32 tests, 0 failures)
Non-blocking nits (fine to follow up separately):
var thenRequest = require("then-request");atcdm.js:3is now unused; the directthen-requestdependency inpackage.jsoncan likely be dropped too.- No coverage for connection-refused or malformed-JSON discovery responses (the 503 case is covered).
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
fetchfor OpenSearch instance discovery.Root Cause
The previous follow-up made
getInstancesInfo()asynchronous but retainedthen-request. In the Crucible MCP integration artifacts, CDM metric queries succeed and then subsequent discovery refreshes log transport failures, marking the reachable OpenSearch instances offline. Laterlist_indexed_resultscalls therefore return no runs.CDM's batched query path already uses native
fetchspecifically to avoid the legacy request transport. This change uses that same transport for discovery.Validation
node --check cdm.jscdm.jsnpm run test:instance-discoverynpm testFollow-up to #231.
— AI-signed: Codex | model: gpt-6.1-sol | effort: not specified | contribution: implemented transport change and PR description