fix: preserve thinking variant for generated messages
Uses the selected thinking variant for Git-generated session prompts Preserves current variant for voice-triggered messages
This commit is contained in:
@@ -348,6 +348,7 @@ type SessionGenerationContext = {
|
||||
providerID: string;
|
||||
modelID: string;
|
||||
agent?: string;
|
||||
variant?: string;
|
||||
};
|
||||
|
||||
const resolveSessionGenerationContext = (): SessionGenerationContext | null => {
|
||||
@@ -370,11 +371,17 @@ const resolveSessionGenerationContext = (): SessionGenerationContext | null => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const agentVariant = agent
|
||||
? context.getAgentModelVariantForSession(sessionId, agent, selectedModel.providerId, selectedModel.modelId)
|
||||
: undefined;
|
||||
const variant = agentVariant || config.currentVariant || undefined;
|
||||
|
||||
return {
|
||||
sessionId,
|
||||
providerID: selectedModel.providerId,
|
||||
modelID: selectedModel.modelId,
|
||||
agent,
|
||||
variant,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -399,6 +406,7 @@ const runStructuredGenerationInActiveSession = async ({
|
||||
providerID: generationSession.providerID,
|
||||
modelID: generationSession.modelID,
|
||||
agent: generationSession.agent,
|
||||
variant: generationSession.variant,
|
||||
});
|
||||
const trimmedDirectory = typeof directory === 'string' ? directory.trim() : '';
|
||||
const visiblePromptText = typeof visiblePrompt === 'string' ? visiblePrompt.trim() : '';
|
||||
@@ -429,6 +437,7 @@ const runStructuredGenerationInActiveSession = async ({
|
||||
modelID: generationSession.modelID,
|
||||
},
|
||||
...(generationSession.agent ? { agent: generationSession.agent } : {}),
|
||||
...(generationSession.variant ? { variant: generationSession.variant } : {}),
|
||||
parts: promptParts,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ export const realtimeClientTools = {
|
||||
}
|
||||
|
||||
// Get current provider and model from config store
|
||||
const { currentProviderId, currentModelId, currentAgentName } = useConfigStore.getState();
|
||||
const { currentProviderId, currentModelId, currentAgentName, currentVariant } = useConfigStore.getState();
|
||||
if (!currentProviderId || !currentModelId) {
|
||||
console.error("[Voice] No provider/model selected");
|
||||
return "error (no provider or model selected)";
|
||||
@@ -43,7 +43,16 @@ export const realtimeClientTools = {
|
||||
console.log("[Voice] Sending message to session:", sessionId);
|
||||
await useSessionUIStore
|
||||
.getState()
|
||||
.sendMessage(parsed.data.message, currentProviderId, currentModelId, currentAgentName ?? undefined);
|
||||
.sendMessage(
|
||||
parsed.data.message,
|
||||
currentProviderId,
|
||||
currentModelId,
|
||||
currentAgentName ?? undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
currentVariant ?? undefined,
|
||||
);
|
||||
return "sent";
|
||||
} catch (error) {
|
||||
console.error("[Voice] Failed to send message:", error);
|
||||
|
||||
Reference in New Issue
Block a user