Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 9dfe5bdf230422721f548cffc1a93a654c369cd7 Co-authored-by: napetrov <18015221+napetrov@users.noreply.github.com> Co-authored-by: steipete <58493+steipete@users.noreply.github.com> Reviewed-by: @steipete
28 lines
721 B
TypeScript
28 lines
721 B
TypeScript
import type { ThinkingLevel } from "@mariozechner/pi-agent-core";
|
|
import type { ReasoningLevel, ThinkLevel } from "../../auto-reply/thinking.js";
|
|
|
|
export function mapThinkingLevel(level?: ThinkLevel): ThinkingLevel {
|
|
// pi-agent-core supports "xhigh"; OpenClaw enables it for specific models.
|
|
if (!level) {
|
|
return "off";
|
|
}
|
|
return level;
|
|
}
|
|
|
|
export function describeUnknownError(error: unknown): string {
|
|
if (error instanceof Error) {
|
|
return error.message;
|
|
}
|
|
if (typeof error === "string") {
|
|
return error;
|
|
}
|
|
try {
|
|
const serialized = JSON.stringify(error);
|
|
return serialized ?? "Unknown error";
|
|
} catch {
|
|
return "Unknown error";
|
|
}
|
|
}
|
|
|
|
export type { ReasoningLevel, ThinkLevel };
|