Skip to content

Commit 0909f2b

Browse files
committed
fix: llm-task tool schema compatibility with llama.cpp + doctor SecretRef crash
Two fixes: 1. llm-task plugin: Type.Unknown() produces JSON Schema without a 'type' field, which llama.cpp rejects during schema-to-grammar conversion. Replace with Type.Unsafe<unknown>({type: 'object', ...}) to emit a concrete type. Fixes #35443. 2. openclaw doctor: resolved?.remote?.apiKey?.trim() crashes when apiKey is a SecretRef object (not a string). Guard with typeof check. Fixes #35444.
1 parent 4bd3469 commit 0909f2b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

extensions/llm-task/src/llm-task-tool.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,17 @@ export function createLlmTaskTool(api: OpenClawPluginApi) {
7474
"Run a generic JSON-only LLM task and return schema-validated JSON. Designed for orchestration from Lobster workflows via openclaw.invoke.",
7575
parameters: Type.Object({
7676
prompt: Type.String({ description: "Task instruction for the LLM." }),
77-
input: Type.Optional(Type.Unknown({ description: "Optional input payload for the task." })),
77+
input: Type.Optional(
78+
Type.Unsafe<unknown>({
79+
type: "object",
80+
description: "Optional input payload for the task.",
81+
}),
82+
),
7883
schema: Type.Optional(
79-
Type.Unknown({ description: "Optional JSON Schema to validate the returned JSON." }),
84+
Type.Unsafe<unknown>({
85+
type: "object",
86+
description: "Optional JSON Schema to validate the returned JSON.",
87+
}),
8088
),
8189
provider: Type.Optional(
8290
Type.String({ description: "Provider override (e.g. openai-codex, anthropic)." }),

src/commands/doctor-memory-search.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export async function noteMemorySearchHealth(
2626
const agentId = resolveDefaultAgentId(cfg);
2727
const agentDir = resolveAgentDir(cfg, agentId);
2828
const resolved = resolveMemorySearchConfig(cfg, agentId);
29-
const hasRemoteApiKey = Boolean(resolved?.remote?.apiKey?.trim());
29+
const rawApiKey = resolved?.remote?.apiKey;
30+
const hasRemoteApiKey = Boolean(
31+
typeof rawApiKey === "string" ? rawApiKey.trim() : rawApiKey,
32+
);
3033

3134
if (!resolved) {
3235
note("Memory search is explicitly disabled (enabled: false).", "Memory search");

0 commit comments

Comments
 (0)