File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -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.' ,
Original file line number Diff line number Diff line change @@ -151,12 +151,15 @@ export const buildOutboundMessages = ({
151151 styleMode,
152152 existingSummary,
153153} ) => {
154+ const normalizedRepositoryContext = toChatText ( repositoryContext )
154155 const systemMessages = [
155156 {
156157 role : 'system' ,
157158 content : collectSystemRolePrompt ( { renderMode, styleMode } ) ,
158159 } ,
159- { role : 'system' , content : repositoryContext } ,
160+ ...( normalizedRepositoryContext
161+ ? [ { role : 'system' , content : normalizedRepositoryContext } ]
162+ : [ ] ) ,
160163 ...( editorContext ? [ { role : 'system' , content : editorContext } ] : [ ] ) ,
161164 ]
162165 const conversation = collectConversation ( messages )
You can’t perform that action at this time.
0 commit comments