@@ -627,8 +627,13 @@ export const createGitHubChatDrawer = ({
627627
628628 const collectRepositoryContext = ( ) => {
629629 const repository = getSelectedRepository ?. ( )
630+ const repositoryFullName =
631+ typeof repository ?. fullName === 'string' ? repository . fullName . trim ( ) : ''
632+
633+ if ( ! repositoryFullName ) {
634+ return ''
635+ }
630636
631- const repositoryLabel = toRepositoryLabel ( repository )
632637 const repositoryUrl = toRepositoryUrl ( repository )
633638 const defaultBranch =
634639 repository && typeof repository . defaultBranch === 'string'
@@ -637,7 +642,7 @@ export const createGitHubChatDrawer = ({
637642
638643 const contextLines = [
639644 'Selected repository context:' ,
640- `- Repository: ${ repositoryLabel } ` ,
645+ `- Repository: ${ repositoryFullName } ` ,
641646 ...( repositoryUrl ? [ `- Repository URL: ${ repositoryUrl } ` ] : [ ] ) ,
642647 `- Default branch: ${ defaultBranch } ` ,
643648 'Use this repository as the default target for the user request unless they explicitly override it.' ,
@@ -743,12 +748,6 @@ export const createGitHubChatDrawer = ({
743748 return
744749 }
745750
746- const repository = getSelectedRepository ?. ( )
747- if ( ! repository ?. fullName ) {
748- setChatStatus ( 'Select a writable repository before starting chat.' , 'error' )
749- return
750- }
751-
752751 const selectedModel = getSelectedModel ( )
753752
754753 stopPendingRequest ( )
0 commit comments