fix(minecraft): invalid LLM output breaks blackboard

This commit is contained in:
Rin
2026-02-18 11:12:47 +08:00
committed by Neko Ayaka
parent 02c3949a40
commit 260bc37935
@@ -481,11 +481,12 @@ export class Brain {
// 4. Act (Execute Decision)
this.log('INFO', `Brain: Thought: ${decision.thought}`)
// Update Blackboard
// Update Blackboard (with null checks for malformed LLM responses)
const bb = decision.blackboard
this.blackboard.update({
ultimateGoal: decision.blackboard.UltimateGoal || this.blackboard.ultimate_goal,
currentTask: decision.blackboard.CurrentTask || this.blackboard.current_task,
strategy: decision.blackboard.executionStrategy || this.blackboard.strategy,
ultimateGoal: bb?.UltimateGoal || this.blackboard.ultimate_goal,
currentTask: bb?.CurrentTask || this.blackboard.current_task,
strategy: bb?.executionStrategy || this.blackboard.strategy,
})
// Sync Blackboard to Debug