mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 21:53:43 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -5,19 +5,27 @@ import type { ExecToolDefaults } from "../bash-tools.js";
|
||||
|
||||
export function mapThinkingLevel(level?: ThinkLevel): ThinkingLevel {
|
||||
// pi-agent-core supports "xhigh"; OpenClaw enables it for specific models.
|
||||
if (!level) return "off";
|
||||
if (!level) {
|
||||
return "off";
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
export function resolveExecToolDefaults(config?: OpenClawConfig): ExecToolDefaults | undefined {
|
||||
const tools = config?.tools;
|
||||
if (!tools?.exec) return undefined;
|
||||
if (!tools?.exec) {
|
||||
return undefined;
|
||||
}
|
||||
return tools.exec;
|
||||
}
|
||||
|
||||
export function describeUnknownError(error: unknown): string {
|
||||
if (error instanceof Error) return error.message;
|
||||
if (typeof error === "string") return error;
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
}
|
||||
if (typeof error === "string") {
|
||||
return error;
|
||||
}
|
||||
try {
|
||||
const serialized = JSON.stringify(error);
|
||||
return serialized ?? "Unknown error";
|
||||
|
||||
Reference in New Issue
Block a user