Unify utility model settings and align git generation (#486)
* refactor(api): extend git generation payload types * refactor(settings): add git provider model fields * feat(config): persist git provider model defaults * feat(git-api): send provider and model ids * fix(git-api): forward generation options in runtime * feat(git-view): use configured model for commit generation * feat(git-view): pass configured model for PR generation * feat(vscode): forward model selection in git bridge payload * feat(vscode): align PR generation with session model flow * feat(web): resolve and generate git text with provider model * refactor(settings): unify utility model picker across providers * chore(settings): rename sidebar item to utility model * fix(git-model): validate and auto-heal stale utility selections --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
8647e0c1a4
commit
7a11867a19
@@ -210,7 +210,7 @@ export async function deleteRemoteBranch(directory: string, payload: GitDeleteRe
|
||||
export async function generateCommitMessage(
|
||||
directory: string,
|
||||
files: string[],
|
||||
options?: { zenModel?: string }
|
||||
options?: { zenModel?: string; providerId?: string; modelId?: string }
|
||||
): Promise<{ message: GeneratedCommitMessage }> {
|
||||
if (!Array.isArray(files) || files.length === 0) {
|
||||
throw new Error('No files provided to generate commit message');
|
||||
@@ -220,6 +220,12 @@ export async function generateCommitMessage(
|
||||
if (options?.zenModel) {
|
||||
body.zenModel = options.zenModel;
|
||||
}
|
||||
if (options?.providerId) {
|
||||
body.providerId = options.providerId;
|
||||
}
|
||||
if (options?.modelId) {
|
||||
body.modelId = options.modelId;
|
||||
}
|
||||
|
||||
const response = await fetch(buildUrl(`${API_BASE}/commit-message`, directory), {
|
||||
method: 'POST',
|
||||
@@ -259,20 +265,26 @@ export async function generateCommitMessage(
|
||||
|
||||
export async function generatePullRequestDescription(
|
||||
directory: string,
|
||||
payload: { base: string; head: string; context?: string; zenModel?: string }
|
||||
payload: { base: string; head: string; context?: string; zenModel?: string; providerId?: string; modelId?: string }
|
||||
): Promise<{ title: string; body: string }> {
|
||||
const { base, head, context, zenModel } = payload;
|
||||
const { base, head, context, zenModel, providerId, modelId } = payload;
|
||||
if (!base || !head) {
|
||||
throw new Error('base and head are required');
|
||||
}
|
||||
|
||||
const requestBody: { base: string; head: string; context?: string; zenModel?: string } = { base, head };
|
||||
const requestBody: { base: string; head: string; context?: string; zenModel?: string; providerId?: string; modelId?: string } = { base, head };
|
||||
if (context?.trim()) {
|
||||
requestBody.context = context.trim();
|
||||
}
|
||||
if (zenModel) {
|
||||
requestBody.zenModel = zenModel;
|
||||
}
|
||||
if (providerId) {
|
||||
requestBody.providerId = providerId;
|
||||
}
|
||||
if (modelId) {
|
||||
requestBody.modelId = modelId;
|
||||
}
|
||||
|
||||
const response = await fetch(buildUrl(`${API_BASE}/pr-description`, directory), {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user