@@ -33,6 +33,7 @@ import { ExternalLink } from "@/components/external-link"
3333import { useServerSDK } from "@/context/server-sdk"
3434import { useServerSync } from "@/context/server-sync"
3535import { useLanguage } from "@/context/language"
36+ import { usePlatform } from "@/context/platform"
3637import { useSettings } from "@/context/settings"
3738import { popularProviders , useProviders } from "@/hooks/use-providers"
3839import { CustomProviderForm } from "./dialog-custom-provider"
@@ -386,6 +387,7 @@ function ProviderConnection(props: {
386387 const serverSDK = useServerSDK ( )
387388 const params = useParams ( )
388389 const language = useLanguage ( )
390+ const platform = usePlatform ( )
389391 const settings = useSettings ( )
390392 const newLayout = settings . general . newLayoutDesigns
391393 const providers = useProviders ( ( ) => props . directory ?.( ) )
@@ -560,6 +562,11 @@ function ProviderConnection(props: {
560562 } )
561563 . then ( ( x ) => {
562564 if ( ! alive . value ) return
565+ if ( props . provider === "opencode" && platform . platform === "desktop" ) {
566+ const url = new URL ( x . data . url )
567+ url . searchParams . set ( "client_id" , "opencode-desktop" )
568+ x . data . url = url . href
569+ }
563570 dispatch ( { type : "auth.complete" , authorization : x . data } )
564571 } )
565572 . catch ( ( e ) => {
0 commit comments