Skip to content

Commit bf2fbd2

Browse files
authored
Remove repoContext (#2112)
in favor of GitHub Pull Request providing workspace context through the new API proposal.
1 parent 6a79f83 commit bf2fbd2

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

src/extension/prompts/node/agent/agentPrompt.tsx

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { ConfigKey, IConfigurationService } from '../../../../platform/configura
1010
import { isGpt51Family, isGpt5Family, isGpt5PlusFamily, isGptCodexFamily, isGptFamily, isVSCModelA, modelNeedsStrongReplaceStringHint } from '../../../../platform/endpoint/common/chatModelCapabilities';
1111
import { CacheType } from '../../../../platform/endpoint/common/endpointTypes';
1212
import { IEnvService, OperatingSystem } from '../../../../platform/env/common/envService';
13-
import { getGitHubRepoInfoFromContext, IGitService } from '../../../../platform/git/common/gitService';
1413
import { ILogService } from '../../../../platform/log/common/logService';
1514
import { IChatEndpoint } from '../../../../platform/networking/common/networking';
1615
import { IAlternativeNotebookContentService } from '../../../../platform/notebook/common/alternativeContent';
@@ -23,7 +22,6 @@ import { isDefined } from '../../../../util/vs/base/common/types';
2322
import { IInstantiationService } from '../../../../util/vs/platform/instantiation/common/instantiation';
2423
import { ChatRequestEditedFileEventKind, Position, Range } from '../../../../vscodeTypes';
2524
import { GenericBasePromptElementProps } from '../../../context/node/resolvers/genericPanelIntentInvocation';
26-
import { GitHubPullRequestProviders } from '../../../conversation/node/githubPullRequestProviders';
2725
import { ChatVariablesCollection } from '../../../prompt/common/chatVariablesCollection';
2826
import { getGlobalContextCacheKey, GlobalContextMessageMetadata, RenderedUserMessageMetadata, Turn } from '../../../prompt/common/conversation';
2927
import { InternalToolReference } from '../../../prompt/common/intents';
@@ -355,7 +353,6 @@ export class AgentUserMessage extends PromptElement<AgentUserMessageProps> {
355353
{hasTodoTool && <TodoListContextPrompt sessionId={this.props.sessionId} />}
356354
</Tag>
357355
<CurrentEditorContext endpoint={this.props.endpoint} />
358-
<RepoContext />
359356
<Tag name='reminderInstructions'>
360357
{/* Critical reminders that are effective when repeated right next to the user message */}
361358
<KeepGoingReminder modelFamily={this.props.endpoint.family} />
@@ -539,35 +536,6 @@ class CurrentEditorContext extends PromptElement<CurrentEditorContextProps> {
539536
}
540537
}
541538

542-
class RepoContext extends PromptElement<{}> {
543-
constructor(
544-
props: {},
545-
@IGitService private readonly gitService: IGitService,
546-
@IInstantiationService private readonly instantiationService: IInstantiationService,
547-
) {
548-
super(props);
549-
}
550-
551-
async render(state: void, sizing: PromptSizing) {
552-
const activeRepository = this.gitService.activeRepository?.get();
553-
const repoContext = activeRepository && getGitHubRepoInfoFromContext(activeRepository);
554-
if (!repoContext || !activeRepository) {
555-
return;
556-
}
557-
const prProvider = this.instantiationService.createInstance(GitHubPullRequestProviders);
558-
const repoDescription = await prProvider.getRepositoryDescription(activeRepository.rootUri);
559-
560-
return <Tag name='repoContext'>
561-
Below is the information about the current repository. You can use this information when you need to calculate diffs or compare changes with the default branch.<br />
562-
Repository name: {repoContext.id.repo}<br />
563-
Owner: {repoContext.id.org}<br />
564-
Current branch: {activeRepository.headBranchName}<br />
565-
{repoDescription ? <>Default branch: {repoDescription?.defaultBranch}<br /></> : ''}
566-
{repoDescription?.pullRequest ? <>Active pull request (may not be the same as open pull request): {repoDescription.pullRequest.title} ({repoDescription.pullRequest.url})<br /></> : ''}
567-
</Tag>;
568-
}
569-
}
570-
571539
class WorkspaceFoldersHint extends PromptElement<BasePromptElementProps> {
572540
constructor(
573541
props: BasePromptElementProps,

0 commit comments

Comments
 (0)