Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

Fix 5 type errors after main merge: addToolResult slot mismatch + updateStep patch + chat-media narrow

wytcb303435aa75
diff --git a/src/core-agent/src/agent/runner.ts b/src/core-agent/src/agent/runner.ts
index cdcd7161..3b6992c5 100644
--- a/src/core-agent/src/agent/runner.ts
+++ b/src/core-agent/src/agent/runner.ts
@@ -726,19 +726,20 @@ export class AgentRunner {
const tool = this.tools.get(call.name);
if (!tool) {
log.warn(`Reflection: unknown tool "${call.name}"`);
- reflectSession.addToolResult(call.id, `Unknown tool: ${call.name}`, true);
+ // addToolResult signature: (id, result, images?, isError?) — pass undefined for images.
+ reflectSession.addToolResult(call.id, `Unknown tool: ${call.name}`, undefined, true);
continue;
}
try {
log.info(`Reflection tool: ${call.name}(${JSON.stringify(call.input).slice(0, 200)})`);
const toolResult = await tool.execute(call.input, toolCtx);
- reflectSession.addToolResult(call.id, toolResult.content, toolResult.isError);
+ reflectSession.addToolResult(call.id, toolResult.content, toolResult.images, toolResult.isError);
if (toolResult.isError) {
log.warn(`Reflection tool ${call.name} returned error: ${toolResult.content.slice(0, 200)}`);
}
} catch (err) {
log.error(`Reflection tool ${call.name} threw: ${formatError(err)}`);
- reflectSession.addToolResult(call.id, `Error: ${formatError(err)}`, true);
+ reflectSession.addToolResult(call.id, `Error: ${formatError(err)}`, undefined, true);
}
}
} catch (err) {
diff --git a/src/main/features/group_chat/bus.ts b/src/main/features/group_chat/bus.ts
index de91865c..946fad45 100644
--- a/src/main/features/group_chat/bus.ts
+++ b/src/main/features/group_chat/bus.ts
@@ -1881,7 +1881,8 @@ async function buildCommanderExtraTools(state: CidState, w: WorkerState): Promis
if (!Number.isFinite(idx) || !['in_progress', 'done', 'failed'].includes(status)) {
return { content: JSON.stringify({ ok: false, error: 'invalid input' }), isError: true };
}
- const updated = await updateStep(uid, cid, idx, status, notes);
+ // updateStep's 5th arg is a `patch` object, not a bare notes string — wrap.
+ const updated = await updateStep(uid, cid, idx, status, notes !== undefined ? { notes } : undefined);
if (!updated) {
return { content: JSON.stringify({ ok: false, error: 'step not found or no plan yet' }), isError: true };
}
diff --git a/src/main/index.ts b/src/main/index.ts
index 0c6d1ac1..349fd46b 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -529,8 +529,12 @@ function registerChatMediaProtocol(): void {
const abs = _pathnameToAbsPath(u.pathname || '');
const resolved = chatAttachments.resolveLocalMediaPath(abs);
if (!resolved.ok) {
- log.warn('chat-media/local: reject', { reqUrl, code: resolved.code, error: resolved.error });
- return new Response(resolved.error, { status: _statusFor(resolved.code) });
+ // Same `(x as {field?: T}).field` access pattern as the cid branch above —
+ // tsc's narrow on `if (!resolved.ok)` doesn't always propagate to the
+ // error-branch fields here, so go through the type-assertion escape hatch.
+ const err = resolved as { code?: string; error?: string };
+ log.warn('chat-media/local: reject', { reqUrl, code: err.code, error: err.error });
+ return new Response(String(err.error || ''), { status: _statusFor(err.code) });
}
const st = fs.statSync(resolved.absPath);
log.info('chat-media/local: serving', { abs: resolved.absPath, kind: resolved.kind, bytes: st.size });