feat: expand ai commit agent support (#1928)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: brennanb2025 <brennankbenson@gmail.com>
This commit is contained in:
Leynier Gutiérrez González
2026-05-19 02:32:53 -07:00
committed by GitHub
co-authored by Copilot brennanb2025
parent 363ddb5ef6
commit 03b889512b
31 changed files with 2512 additions and 175 deletions
+25 -2
View File
@@ -8,6 +8,7 @@ import {
GitCommit,
GitCommitCompare,
GitCommitDiff,
GitDiscoverCommitMessageModels,
GitDiff,
GitFilePath,
GitGenerateCommitMessage,
@@ -127,7 +128,8 @@ export const GIT_METHODS: RpcMethod[] = [
if (
params.commitMessageAi === undefined &&
params.agentCmdOverrides === undefined &&
params.enableGitHubAttribution === undefined
params.enableGitHubAttribution === undefined &&
params.commitMessageDiscoveryHostKey === undefined
) {
return runtime.generateRuntimeCommitMessage(params.worktree)
}
@@ -142,10 +144,27 @@ export const GIT_METHODS: RpcMethod[] = [
: {}),
...(params.enableGitHubAttribution !== undefined
? { enableGitHubAttribution: params.enableGitHubAttribution }
: {}),
...(params.commitMessageDiscoveryHostKey !== undefined
? { commitMessageDiscoveryHostKey: params.commitMessageDiscoveryHostKey }
: {})
})
}
}),
defineMethod({
name: 'git.discoverCommitMessageModels',
params: GitDiscoverCommitMessageModels,
handler: async (params, { runtime }) =>
runtime.discoverRuntimeCommitMessageModels(
params.worktree,
params.agentId,
params.agentCmdOverrides !== undefined
? {
agentCmdOverrides: params.agentCmdOverrides as GlobalSettings['agentCmdOverrides']
}
: {}
)
}),
defineMethod({
name: 'git.cancelGenerateCommitMessage',
params: WorktreeSelector,
@@ -165,7 +184,8 @@ export const GIT_METHODS: RpcMethod[] = [
if (
params.commitMessageAi === undefined &&
params.agentCmdOverrides === undefined &&
params.enableGitHubAttribution === undefined
params.enableGitHubAttribution === undefined &&
params.commitMessageDiscoveryHostKey === undefined
) {
return runtime.generateRuntimePullRequestFields(params.worktree, input)
}
@@ -180,6 +200,9 @@ export const GIT_METHODS: RpcMethod[] = [
: {}),
...(params.enableGitHubAttribution !== undefined
? { enableGitHubAttribution: params.enableGitHubAttribution }
: {}),
...(params.commitMessageDiscoveryHostKey !== undefined
? { commitMessageDiscoveryHostKey: params.commitMessageDiscoveryHostKey }
: {})
})
}