opencode-studio-server 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1027,37 +1027,30 @@ app.post('/api/ohmyopencode', (req, res) => {
|
|
|
1027
1027
|
return res.status(400).json({ error: 'Missing preferences.agents' });
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
-
// Save preferences to studio.json
|
|
1031
1030
|
const studio = loadStudioConfig();
|
|
1032
1031
|
studio.ohmy = preferences;
|
|
1033
1032
|
saveStudioConfig(studio);
|
|
1034
1033
|
|
|
1035
|
-
// Load current oh-my-opencode.json or start fresh
|
|
1036
1034
|
const currentConfig = loadOhMyOpenCodeConfig() || {};
|
|
1037
1035
|
const warnings = [];
|
|
1038
1036
|
|
|
1039
|
-
// For each agent, pick first available model and apply thinking/reasoning
|
|
1040
1037
|
for (const [agentName, agentPrefs] of Object.entries(preferences.agents)) {
|
|
1041
1038
|
const choices = agentPrefs.choices || [];
|
|
1042
1039
|
const available = choices.find(c => c.available);
|
|
1043
1040
|
if (available) {
|
|
1044
|
-
// Set the model in oh-my-opencode.json
|
|
1045
1041
|
if (!currentConfig.agents) currentConfig.agents = {};
|
|
1046
1042
|
const agentConfig = { model: available.model };
|
|
1047
1043
|
|
|
1048
|
-
|
|
1049
|
-
if (agentPrefs.thinking && agentPrefs.thinking.type === 'enabled') {
|
|
1044
|
+
if (available.thinking && available.thinking.type === 'enabled') {
|
|
1050
1045
|
agentConfig.thinking = { type: 'enabled' };
|
|
1051
1046
|
}
|
|
1052
1047
|
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
agentConfig.reasoning = { effort: agentPrefs.reasoning.effort };
|
|
1048
|
+
if (available.reasoning && available.reasoning.effort) {
|
|
1049
|
+
agentConfig.reasoning = { effort: available.reasoning.effort };
|
|
1056
1050
|
}
|
|
1057
1051
|
|
|
1058
1052
|
currentConfig.agents[agentName] = agentConfig;
|
|
1059
1053
|
} else if (choices.length > 0) {
|
|
1060
|
-
// No available model, keep existing or warn
|
|
1061
1054
|
warnings.push(`No available model for agent "${agentName}"`);
|
|
1062
1055
|
}
|
|
1063
1056
|
}
|