@khanglvm/llm-router 2.2.0 → 2.2.1
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/package.json
CHANGED
package/src/cli/router-module.js
CHANGED
|
@@ -6538,6 +6538,15 @@ async function doSetClaudeCodeEffortLevel(context) {
|
|
|
6538
6538
|
const settingsFilePath = String(readArg(args, ["claude-code-settings-file", "claudeCodeSettingsFile", "claude-settings-file", "claudeSettingsFile"], "") || "").trim();
|
|
6539
6539
|
const effortLevel = String(readArg(args, ["thinking-level", "thinkingLevel", "effort-level", "effortLevel"], "") || "").trim();
|
|
6540
6540
|
|
|
6541
|
+
if (effortLevel && !normalizeClaudeCodeEffortLevel(effortLevel)) {
|
|
6542
|
+
return {
|
|
6543
|
+
ok: false,
|
|
6544
|
+
mode: context.mode,
|
|
6545
|
+
exitCode: EXIT_VALIDATION,
|
|
6546
|
+
errorMessage: `Invalid effort level '${effortLevel}'. Valid values: low, medium, high, max.`
|
|
6547
|
+
};
|
|
6548
|
+
}
|
|
6549
|
+
|
|
6541
6550
|
const result = await patchClaudeCodeEffortLevel({
|
|
6542
6551
|
settingsFilePath,
|
|
6543
6552
|
effortLevel,
|
|
@@ -3164,6 +3164,10 @@ export async function startWebConsoleServer(options = {}, deps = {}) {
|
|
|
3164
3164
|
if (method === "POST" && requestUrl.pathname === "/api/claude-code/effort-level") {
|
|
3165
3165
|
const body = await readJsonBody(req);
|
|
3166
3166
|
const effortLevel = String(body?.effortLevel || body?.thinkingLevel || "").trim();
|
|
3167
|
+
if (effortLevel && !normalizeClaudeCodeEffortLevel(effortLevel)) {
|
|
3168
|
+
sendJson(res, 400, { error: `Invalid effort level '${effortLevel}'. Valid values: low, medium, high, max.` });
|
|
3169
|
+
return;
|
|
3170
|
+
}
|
|
3167
3171
|
const result = await patchClaudeCodeEffortLevel({
|
|
3168
3172
|
effortLevel,
|
|
3169
3173
|
env: claudeCodeEnv
|