From ecdbd66542a0e8672ced5c208648c61a4d601307 Mon Sep 17 00:00:00 2001 From: KCM Date: Wed, 6 May 2026 17:54:10 -0500 Subject: [PATCH 1/2] fix: chat with pat on local-only workspaces. --- src/modules/github/chat/drawer.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/modules/github/chat/drawer.js b/src/modules/github/chat/drawer.js index b1243c0..2b4a0fc 100644 --- a/src/modules/github/chat/drawer.js +++ b/src/modules/github/chat/drawer.js @@ -743,12 +743,6 @@ export const createGitHubChatDrawer = ({ return } - const repository = getSelectedRepository?.() - if (!repository?.fullName) { - setChatStatus('Select a writable repository before starting chat.', 'error') - return - } - const selectedModel = getSelectedModel() stopPendingRequest() From 5671b491c45613570445071a9c0c5933f5d2fab7 Mon Sep 17 00:00:00 2001 From: KCM Date: Wed, 6 May 2026 18:03:18 -0500 Subject: [PATCH 2/2] refactor: address pr comments. --- src/modules/github/chat/drawer.js | 9 +++++++-- src/modules/github/chat/payload.js | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/github/chat/drawer.js b/src/modules/github/chat/drawer.js index 2b4a0fc..8727f67 100644 --- a/src/modules/github/chat/drawer.js +++ b/src/modules/github/chat/drawer.js @@ -627,8 +627,13 @@ export const createGitHubChatDrawer = ({ const collectRepositoryContext = () => { const repository = getSelectedRepository?.() + const repositoryFullName = + typeof repository?.fullName === 'string' ? repository.fullName.trim() : '' + + if (!repositoryFullName) { + return '' + } - const repositoryLabel = toRepositoryLabel(repository) const repositoryUrl = toRepositoryUrl(repository) const defaultBranch = repository && typeof repository.defaultBranch === 'string' @@ -637,7 +642,7 @@ export const createGitHubChatDrawer = ({ const contextLines = [ 'Selected repository context:', - `- Repository: ${repositoryLabel}`, + `- Repository: ${repositoryFullName}`, ...(repositoryUrl ? [`- Repository URL: ${repositoryUrl}`] : []), `- Default branch: ${defaultBranch}`, 'Use this repository as the default target for the user request unless they explicitly override it.', diff --git a/src/modules/github/chat/payload.js b/src/modules/github/chat/payload.js index d3228db..29a0c2b 100644 --- a/src/modules/github/chat/payload.js +++ b/src/modules/github/chat/payload.js @@ -151,12 +151,15 @@ export const buildOutboundMessages = ({ styleMode, existingSummary, }) => { + const normalizedRepositoryContext = toChatText(repositoryContext) const systemMessages = [ { role: 'system', content: collectSystemRolePrompt({ renderMode, styleMode }), }, - { role: 'system', content: repositoryContext }, + ...(normalizedRepositoryContext + ? [{ role: 'system', content: normalizedRepositoryContext }] + : []), ...(editorContext ? [{ role: 'system', content: editorContext }] : []), ] const conversation = collectConversation(messages)