fix(mcp): align env token precedence with the documented order - #6342
Conversation
getEnvApiToken() resolved LOOPOVER_TOKEN ahead of LOOPOVER_MCP_TOKEN, the opposite of the precedence documented everywhere else. The README, printHelp, the missing-auth error, and the diagnostic sanitizer list all read "LOOPOVER_API_TOKEN, LOOPOVER_MCP_TOKEN, LOOPOVER_TOKEN" -- getEnvApiToken was the single outlier, so a user setting the MCP-specific token got the generic LOOPOVER_TOKEN instead when both were present. Fix the code to match the documented order (API > MCP > TOKEN) and pin the exact runtime precedence with a test that observes which token the CLI actually sends as the Authorization header. Closes JSONbored#6262
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 03:05:23 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6342 +/- ##
=======================================
Coverage 95.60% 95.60%
=======================================
Files 597 597
Lines 47185 47185
Branches 15017 15017
=======================================
Hits 45113 45113
Misses 1290 1290
Partials 782 782
Flags with carried forward coverage won't be shown. Click here to find out more. |
fix(mcp): align env token precedence with the documented order
getEnvApiToken() resolved LOOPOVER_TOKEN ahead of LOOPOVER_MCP_TOKEN, the
opposite of the precedence documented everywhere else. The README, printHelp,
the missing-auth error, and the diagnostic sanitizer list all read
"LOOPOVER_API_TOKEN, LOOPOVER_MCP_TOKEN, LOOPOVER_TOKEN" -- getEnvApiToken was
the single outlier, so a user setting the MCP-specific token got the generic
LOOPOVER_TOKEN instead when both were present.
Fix the code to match the documented order (API > MCP > TOKEN) and pin the
exact runtime precedence with a test that observes which token the CLI actually
sends as the Authorization header.
Closes #6262