fix: integrate Claude CLI provider state
This commit is contained in:
@@ -3,6 +3,7 @@ import * as gitHttp from './gitApiHttp';
|
||||
import { opencodeClient } from './opencode/client';
|
||||
import { renderMagicPrompt } from './magicPrompts';
|
||||
import { runtimeFetch } from './runtime-fetch';
|
||||
import { requestSmallModel } from './smallModelRequest';
|
||||
import { materializeOpenDraftSession, useSessionUIStore } from '@/sync/session-ui-store';
|
||||
import { useSelectionStore } from '@/sync/selection-store';
|
||||
import { useConfigStore } from '@/stores/useConfigStore';
|
||||
@@ -283,7 +284,7 @@ export async function generateCommitMessage(
|
||||
try {
|
||||
const diffs = await collectSelectedFileDiffs(directory, files);
|
||||
const { currentProviderId, currentModelId } = useConfigStore.getState();
|
||||
const response = await runtimeFetch('/api/small-model/generate', {
|
||||
const response = await requestSmallModel({
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -293,7 +294,7 @@ export async function generateCommitMessage(
|
||||
...(currentProviderId ? { preferredProviderID: currentProviderId } : {}),
|
||||
...(currentModelId ? { preferredModelID: currentModelId } : {}),
|
||||
}),
|
||||
});
|
||||
}, { silentStatuses: [404] });
|
||||
|
||||
if (response.status === 404) {
|
||||
// No authenticated provider has a small model — fall back to the
|
||||
@@ -411,7 +412,7 @@ export async function generatePullRequestDescription(
|
||||
|
||||
try {
|
||||
const { currentProviderId, currentModelId } = useConfigStore.getState();
|
||||
const response = await runtimeFetch('/api/small-model/generate', {
|
||||
const response = await requestSmallModel({
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -421,7 +422,7 @@ export async function generatePullRequestDescription(
|
||||
...(currentProviderId ? { preferredProviderID: currentProviderId } : {}),
|
||||
...(currentModelId ? { preferredModelID: currentModelId } : {}),
|
||||
}),
|
||||
});
|
||||
}, { silentStatuses: [404] });
|
||||
|
||||
if (response.status === 404) {
|
||||
// No authenticated provider has a small model — fall back to the
|
||||
|
||||
Reference in New Issue
Block a user