@@ -566,7 +566,8 @@ pub(super) fn resolve_integration<'a>(
566566// ---------------------------------------------------------------------------------------------------------------
567567
568568// Picker order under “Popular”.
569- const PRIORITY : [ & str ; 6 ] = [ "opencode-go" , "opencode" , "openai" , "github-copilot" , "anthropic" , "google" ] ;
569+ const PRIORITY : [ & str ; 7 ] =
570+ [ "opencode-go" , "opencode" , "openai" , "anthropic" , "claude-agent" , "github-copilot" , "google" ] ;
570571
571572fn login ( context : & Context , args : & AuthLoginArgs ) -> error:: Result < ( ) > {
572573 if args. target . is_none ( ) {
@@ -1673,6 +1674,47 @@ mod tests {
16731674 assert_eq ! ( entries[ 0 ] . value. to_string( ) , r#"{"type":"key","key":"k","metadata":{"a":1,"b":3}}"# ) ;
16741675 }
16751676
1677+ #[ test]
1678+ fn login_choices_group_and_order_like_connect ( ) {
1679+ let integration = |id : & str , name : & str , metadata : Option < & str > , connection : & str | -> IntegrationInfo {
1680+ let metadata = metadata. map ( |value| format ! ( r#","metadata":{value}"# ) ) . unwrap_or_default ( ) ;
1681+ serde_json:: from_str ( & format ! (
1682+ r#"{{"id":"{id}","name":"{name}"{metadata},"methods":[{{"type":"key"}}],"connections":[{connection}]}}"#
1683+ ) )
1684+ . unwrap ( )
1685+ } ;
1686+ let go = r#"{"type":"credential","id":"go","label":"Go","method":"key"}"# ;
1687+ let choices = login_choices ( & [
1688+ integration ( "mistral" , "Mistral" , None , "" ) ,
1689+ integration ( "github-copilot" , "GitHub Copilot" , None , "" ) ,
1690+ integration ( "claude-agent" , "Claude Agent" , None , "" ) ,
1691+ integration ( "anthropic" , "Anthropic" , None , "" ) ,
1692+ integration ( "google" , "Google" , None , "" ) ,
1693+ integration ( "openai" , "OpenAI" , None , "" ) ,
1694+ integration ( "linear" , "Linear" , Some ( r#"{"source":"mcp"}"# ) , "" ) ,
1695+ integration ( "github" , "GitHub" , Some ( r#"{"source":"mcp"}"# ) , "" ) ,
1696+ integration ( "opencode" , "OpenCode Console" , None , "" ) ,
1697+ integration ( "opencode-go" , "OpenCode Go" , None , go) ,
1698+ ] ) ;
1699+ let actual: Vec < ( & str , & str , bool ) > =
1700+ choices. iter ( ) . map ( |choice| ( choice. value . as_str ( ) , choice. category , choice. connected ) ) . collect ( ) ;
1701+ assert_eq ! (
1702+ actual,
1703+ [
1704+ ( "github" , "MCP" , false ) ,
1705+ ( "linear" , "MCP" , false ) ,
1706+ ( "opencode-go" , "Popular" , true ) ,
1707+ ( "opencode" , "Popular" , false ) ,
1708+ ( "openai" , "Popular" , false ) ,
1709+ ( "anthropic" , "Popular" , false ) ,
1710+ ( "claude-agent" , "Popular" , false ) ,
1711+ ( "github-copilot" , "Popular" , false ) ,
1712+ ( "google" , "Popular" , false ) ,
1713+ ( "mistral" , "Services" , false ) ,
1714+ ]
1715+ ) ;
1716+ }
1717+
16761718 #[ test]
16771719 fn login_choices_hide_opencode_go_until_a_go_key_is_saved ( ) {
16781720 let integration = |id : & str , connection : & str | -> IntegrationInfo {
0 commit comments