fix: report real credential status from get_setup_instructions#8
Merged
Conversation
get_setup_instructions always returned the setup payload with "Merit API credentials are not configured.", even when credentials were set and other tools worked. Now it returns a "configured" status payload when credentials are present, and only the setup guidance when they are missing. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
Problem
get_setup_instructionsalways returned the setup payload containing"error": "Merit API credentials are not configured."— even when credentials were configured and every other tool worked. The handler unconditionally calledbuild_setup_payload(), which hardcodes that error string regardless of config state.Fix
get_setup_instructionsnow reflects actual state:mode: "setup"with the error and instructions.mode: "configured"payload (credentials_present: true, activecountry, no misleadingerrorfield). API key/id are not leaked.The per-tool fallback path (
build_tool_handler→build_setup_payload) is untouched, so tools called without credentials still return setup guidance withblocked_tool/blocked_api_method.Tests
Added two tests covering both states. Full suite: 29 passed.
🤖 Generated with Claude Code