Skip to content

Add chat participant, tools, and notifications view - #6280

Merged
Alex Ross (alexr00) merged 71 commits into
mainfrom
dev/chat
Oct 15, 2024
Merged

Add chat participant, tools, and notifications view#6280
Alex Ross (alexr00) merged 71 commits into
mainfrom
dev/chat

Conversation

@alexr00

@alexr00 Alex Ross (alexr00) commented Oct 15, 2024

Copy link
Copy Markdown
Member

Adds the following AI features:

  • A githubpr chat participant for handling github related requests
  • Several lm tools for the participant (or others) to use:
    • get issue
    • convert text to GH search syntax
    • Execute a GH issue/pr search
    • Display search results in a markdown table
    • Suggest a fix for an issue
  • A notifications view, with Copilot based sorting

@alexr00 Alex Ross (alexr00) self-assigned this Oct 15, 2024
- types
- match existing parse pattern
- cleanup
@alexr00
Alex Ross (alexr00) marked this pull request as ready for review October 15, 2024 10:22
@vs-code-engineering vs-code-engineering Bot added this to the October 2024 milestone Oct 15, 2024
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) October 15, 2024 10:38
@alexr00 Alex Ross (alexr00) changed the title Dev/chat Add chat participant and tools Oct 15, 2024
@alexr00 Alex Ross (alexr00) changed the title Add chat participant and tools Add chat participant, tools, and notifications view Oct 15, 2024

@Tyriar Daniel Imms (Tyriar) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part way through

Comment thread package.json
Comment thread src/commands.ts
Comment thread src/commands.ts
}

return folderRepoManager.activePullRequest;
return folderRepoManager.activePullRequest as unknown as T;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a safe cast? Is a pull request model the same as an issue model?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A PullRequestModel extends IssueModel. I don't know why typescript doesn't the direct cast to IssueModel.

Comment thread src/github/interface.ts
Comment on lines +176 to +177
comments?: IIssueComment[];
commentCount: number;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is commentCount just comments.length? Seems redundant

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not the same. commentCount will always be set, as in we will always fetch the number of comments using the GitHub API; however, for performance we do not always fetch any of the comments.

Comment thread src/github/interface.ts
Comment thread src/lm/displayIssuesTool.ts
Comment thread src/lm/participants.ts
Comment thread src/lm/participants.ts
Comment on lines +74 to +76
dispose() {
dispose(this.disposables);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Is there a base class to extends instead of this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, but we need one. Will tackle as debt across the codebase: #6285

Comment thread src/lm/participants.ts
Comment thread src/lm/searchTools.ts
Comment on lines +17 to +28
repo?: {
owner?: string;
name?: string;
};
}

interface ConvertToQuerySyntaxResult {
query: string;
repo?: {
owner?: string;
name?: string;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is repo: {} valid?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but it is valid for SearchToolParameters as the llm might not give us the proper arguments. Having owner and name optional here was the best way I could see to do this later:

type SearchToolParameters = ConvertToQuerySyntaxResult;

which lets me describe that the output of one tool should be the input of the next.

@Tyriar Daniel Imms (Tyriar) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Comment thread src/lm/searchTools.ts
Comment thread src/lm/searchTools.ts
Comment thread src/lm/tools/issueTool.ts
Comment thread src/lm/tools/issueTool.ts
Comment thread src/notifications/notificationsView.ts
@alexr00
Alex Ross (alexr00) merged commit d5a6d39 into main Oct 15, 2024
@alexr00
Alex Ross (alexr00) deleted the dev/chat branch October 15, 2024 16:43
@alexr00
Alex Ross (alexr00) restored the dev/chat branch October 16, 2024 08:39
@alexr00
Alex Ross (alexr00) deleted the dev/chat branch October 16, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants