Skip to content

Commit 034f0f3

Browse files
shinohara-rinnekomeowww
authored andcommitted
fix(minecraft): fix repl results not feeding to llm
1 parent e9087a3 commit 034f0f3

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

services/minecraft/src/cognitive/conscious/brain.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('brain no-action follow-up', () => {
8484
expect(queuedEvent).toMatchObject({
8585
type: 'system_alert',
8686
source: { type: 'system', id: 'brain:no_action_followup' },
87-
payload: { reason: 'no_actions' },
87+
payload: { reason: 'no_actions', returnValue: '2' },
8888
})
8989
})
9090

services/minecraft/src/cognitive/conscious/brain.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,12 @@ export class Brain {
472472
const actionDefs = new Map(this.deps.taskExecutor.getAvailableActions().map(action => [action.name, action]))
473473
let turnCancellationToken: CancellationToken | undefined
474474

475+
const codeToEvaluate = this.planner.canEvaluateAsExpression(result)
476+
? `return (\n${result}\n)`
477+
: result
478+
475479
const runResult = await this.planner.evaluate(
476-
result,
480+
codeToEvaluate,
477481
this.deps.taskExecutor.getAvailableActions(),
478482
{
479483
event,

0 commit comments

Comments
 (0)