fix: remove preset auto-optimization from AI send paths

matchPreset was replacing systemInstruction with the preset's
template on keyword match. Typing 'epic orchestra' would
auto-apply 'Epic Orchestra Intro (8 Bars)' restrictive template.

Removed both override blocks (Piano Roll MIDI gen + DAW
rearrange). System instruction stays as generic default.
User can still fill prompt via suggestion click without
forced template override.
This commit is contained in:
2026-07-28 20:26:03 +07:00
parent 0dc3f10406
commit 4c3d649506
2 changed files with 2 additions and 22 deletions
-20
View File
@@ -13855,16 +13855,6 @@ const App = () => {
setAiActionLog(prev => [...prev, { type: 'info', text: ` Provider: ${provider.name || 'default'} | Model: ${model}`, time: Date.now() }]);
let pianoSystemInstruction = 'You are a MIDI composer. Output ONLY valid JSON array of notes. No markdown, no explanation. Use 4/4 time. pitch=C4=60, D4=62, E4=64, F4=65, G4=67, A4=69, B4=71, C5=72.';
try {
const mgr = new window.PromptTemplateManager();
const match = mgr.matchPreset(prompt);
if (match) {
pianoSystemInstruction = match.preset.system_instruction_template;
setAiActionLog(prev => [...prev, { type: 'status', text: ` 🎯 Khớp Preset: "${match.preset.name}". Tự động tối ưu gợi ý...`, time: Date.now() }]);
}
} catch (e) {
console.error("Lỗi khi tìm preset:", e);
}
const result = await window.AIGateway.executeAIPrompt({
prompt: 'Generate MIDI notes for a piano roll. Return ONLY a JSON array: [{pitch(0-127), start_beat, duration_beats, velocity(0.0-1.0)}]. ' + prompt,
@@ -14026,16 +14016,6 @@ const App = () => {
});
let matchedInstruction = '';
try {
const mgr = new window.PromptTemplateManager();
const match = mgr.matchPreset(prompt);
if (match) {
matchedInstruction = match.preset.system_instruction_template;
setAiActionLog(prev => [...prev, { type: 'status', text: ` 🎯 Khớp Preset: "${match.preset.name}". Tự động tối ưu gợi ý...`, time: Date.now() }]);
}
} catch (e) {
console.error("Lỗi khi tìm preset:", e);
}
const result = await window.AIGateway.executeAIPrompt({
prompt: prompt,