Issue: Kernel Panic - decision.plan.join is not a function
Description
The agent crashes during the execution loop when attempting to log the plan. This occurs when the LLM provider (specifically observed with ollama/qwen3.5:27b) returns a decision.plan value that is not an Array (e.g., a String or null), causing the .join(" -> ") call to fail.
Traceback
TypeError: decision.plan.join is not a function. (In 'decision.plan.join(" -> ")', 'decision.plan.join' is undefined)
at runAgent (/mnt/luyuzhou/droidclaw/src/kernel.ts:389:42)
Steps to Reproduce
- Run
bun run src/kernel.ts.
- Provide a goal (e.g., "Open telegram and send hello to Cee").
- Wait for the agent to move to Step 2.
- If the LLM returns a non-array
plan field in its JSON response, the process exits.
Suggested Fix
We should verify that decision.plan is an array before attempting to join it, or cast it to an array if it's a string.
File: src/kernel.ts
Line: 389
// Proposed defensive check
if (decision.plan) {
const planOutput = Array.isArray(decision.plan)
? decision.plan.join(" -> ")
: decision.plan;
console.log(`Plan: ${planOutput}`);
}
Issue: Kernel Panic -
decision.plan.joinis not a functionDescription
The agent crashes during the execution loop when attempting to log the plan. This occurs when the LLM provider (specifically observed with
ollama/qwen3.5:27b) returns adecision.planvalue that is not an Array (e.g., a String or null), causing the.join(" -> ")call to fail.Traceback
Steps to Reproduce
bun run src/kernel.ts.planfield in its JSON response, the process exits.Suggested Fix
We should verify that
decision.planis an array before attempting to join it, or cast it to an array if it's a string.File:
src/kernel.tsLine: 389