Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.List;

import org.junit.jupiter.api.Test;

import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotModel;
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotModel.CopilotModelCapabilities;
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotModel.CopilotModelCapabilitiesLimits;
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotModel.CopilotModelCapabilitiesSupports;
import com.microsoft.copilot.eclipse.core.lsp.protocol.CopilotScope;
import com.microsoft.copilot.eclipse.core.lsp.protocol.byok.ByokModel;
import com.microsoft.copilot.eclipse.core.lsp.protocol.byok.ByokModelCapabilities;
Expand Down Expand Up @@ -76,4 +81,15 @@ void testConvertByokModelToCopilotModel_preservesTokenLimits() {
assertEquals(128000, result.getCapabilities().limits().maxInputTokens());
assertEquals(16000, result.getCapabilities().limits().maxOutputTokens());
}

@Test
void testResolveDefaultReasoningEffort_prefersMediumForClaudeModels() {
CopilotModel model = new CopilotModel();
model.setModelFamily("claude-3.7-sonnet");
Comment thread
ethanyhou marked this conversation as resolved.
model.setCapabilities(new CopilotModelCapabilities(
new CopilotModelCapabilitiesSupports(false, List.of("low", "medium", "high"), true),
new CopilotModelCapabilitiesLimits(null, null, null, null)));

assertEquals("medium", ModelUtils.resolveDefaultReasoningEffort(model));
}
Comment thread
ethanyhou marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ public static String formatBillingMultiplier(double multiplier) {
}

/**
* Separator used between parts of the model picker suffix (e.g. "1M | High | $$$").
* Separator used between parts of the model picker suffix (e.g. "1M - High - $$$").
*/
private static final String SUFFIX_PART_SEPARATOR = " | ";
private static final String SUFFIX_PART_SEPARATOR = " - ";

/**
* Returns the display suffix for a model in the model picker.
Expand Down Expand Up @@ -196,8 +196,8 @@ public static String formatTokenCount(int tokens) {
}

/**
* Returns the default reasoning effort to use when the user has not made a selection. Prefers {@code high} for
* Claude models and {@code medium} for all others, falling back to the first entry in the supported list.
* Returns the default reasoning effort to use when the user has not made a selection. Prefers {@code medium} when
* it is supported, falling back to the first entry in the supported list.
Comment thread
ethanyhou marked this conversation as resolved.
*
* @param model the model
* @return the default effort identifier, or {@code null} when none can be determined
Expand All @@ -207,11 +207,8 @@ public static String resolveDefaultReasoningEffort(CopilotModel model) {
if (efforts.isEmpty()) {
return null;
}
String modelFamily = model.getModelFamily();
String preferred = modelFamily != null && modelFamily.toLowerCase(Locale.ROOT).startsWith("claude") ? "high"
: "medium";
for (String effort : efforts) {
if (preferred.equalsIgnoreCase(effort)) {
if ("medium".equalsIgnoreCase(effort)) {
return effort;
}
}
Expand Down
Loading