fix(minecraft): fix repl results not feeding to llm

This commit is contained in:
Rin
2026-02-18 11:14:38 +08:00
committed by Neko Ayaka
parent e9087a341b
commit 034f0f30af
2 changed files with 6 additions and 2 deletions
@@ -84,7 +84,7 @@ describe('brain no-action follow-up', () => {
expect(queuedEvent).toMatchObject({
type: 'system_alert',
source: { type: 'system', id: 'brain:no_action_followup' },
payload: { reason: 'no_actions' },
payload: { reason: 'no_actions', returnValue: '2' },
})
})
@@ -472,8 +472,12 @@ export class Brain {
const actionDefs = new Map(this.deps.taskExecutor.getAvailableActions().map(action => [action.name, action]))
let turnCancellationToken: CancellationToken | undefined
const codeToEvaluate = this.planner.canEvaluateAsExpression(result)
? `return (\n${result}\n)`
: result
const runResult = await this.planner.evaluate(
result,
codeToEvaluate,
this.deps.taskExecutor.getAvailableActions(),
{
event,