feat: Updated the REPL mcp auth path to use the prettified error messaging
CI / All (ubuntu-latest) (push) Failing after 23s
CI / All (macos-latest) (push) Has been cancelled
CI / All (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-07-07 15:18:56 -06:00
parent ce212fe660
commit 7673799d83
3 changed files with 18 additions and 10 deletions
+2 -3
View File
@@ -287,8 +287,7 @@ impl McpRegistry {
Err(e) if is_auth_required_error(&e) => {
warn!(
"MCP server '{id}' requires OAuth authentication. \
Run `coyote --auth-mcp {id}` or `.mcp auth {id}` in the REPL to authenticate, \
then restart Coyote."
Run `coyote --auth-mcp {id}` or `.mcp auth {id}` in the REPL to authenticate."
);
return Ok(None);
}
@@ -409,7 +408,7 @@ fn merge_bearer_token(
}
}
fn is_auth_required_error(e: &Error) -> bool {
pub(crate) fn is_auth_required_error(e: &Error) -> bool {
e.chain()
.any(|cause| cause.to_string().contains("Auth required"))
}