kolbytn / mindcraft

MIT License
797 stars 133 forks source link

Bug: Intermittent inability to craft despite possessing ingredients, disappearing craft results #197

Open TheInvisibleMage opened 1 week ago

TheInvisibleMage commented 1 week ago

Description

System Info

Logs

parsed command: { commandName: '!inventory', args: [] }
Agent executed: !inventory and got: 
INVENTORY
- stick: 15
- wooden_pickaxe: 2
- oak_planks: 106
- torch: 4
- rabbit_hide: 1
- rabbit: 2
- oak_sapling: 8
- bone_meal: 64
- apple: 17
- coal: 62

selected examples:
You are self-prompting with the goal: 'Get a wooden pickaxe'. Respond:
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
Full response: ""My inventory looks good. I see plenty of sticks, planks, and coal. Maybe I can craft some torches? !craftRecipe('torch', 10)""
stopping self-prompt loop
parsed command: { commandName: '!craftRecipe', args: [ 'torch', 10 ] }
executing code...

crafting...
Code execution triggered catch: Error: Error: missing ingredient
Agent executed: !craftRecipe and got: Code output:
!!Code threw exception!!  Error: Error: Error: missing ingredient
selected examples:
You are self-prompting with the goal: 'Get a wooden pickaxe'. Respond:
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
Full response: ""It seems like I'm missing something to craft a torch. What's the required ingredient? !craftRecipeInfo('torch')""
Agent hallucinated command: !craftRecipeInfo
selected examples:
You are self-prompting with the goal: 'Get a wooden pickaxe'. Respond:
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
SFull response: ""Let me try again. How do I check which ingredients are needed for crafting a torch? !help or !info would probably give me what I need, but since those commands don't seem to be working let me just ask you. What ingredients do I need to craft a torch?""
Agent hallucinated command: !help
selected examples:
You are self-prompting with the goal: 'Get a wooden pickaxe'. Respond:
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
Purely conversational response: How about this then? Can you tell me what I need to craft a torch by listing the required ingredients or telling me how to find that information somehow?
received message from <usernameRemoved> : If you have coal and sticks, you should be able to craft a torch. I'm guessing there is some kind of bug. If you pass me the items, I will craft a torch for you.
selected examples:
bobby: Craft a plank
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
SPurely conversational response: That's really helpful! I think you might be right about it being a bug. If you can craft a torch with just coal and sticks, then that's all I need to do. But since I'm stuck here in code land, could you please manually add the correct number of coal and sticks into my inventory so that I can then tell my code self to make a torch?
executing code...

Mode item_collecting finished executing, code_return: Code output:
Picked up 1 items.

executing code...

Mode item_collecting finished executing, code_return: Code output:
Picked up 1 items.

received message from <usernameRemoved>: Okay, I've given you sticks and coal. Try once to craft a torch, and if that doesn't work, I'll try something else.
selected examples:
bobby: Craft a plank
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
Full response: ""I should be able to craft a torch now! !craftRecipe('torch', 1)""
stopping self-prompt loop
parsed command: { commandName: '!craftRecipe', args: [ 'torch', 1 ] }
executing code...

crafting...
Agent executed: !craftRecipe and got: Code output:
Successfully crafted torch, you now have 8 torch.

selected examples:
bobby: Craft a plank
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
Full response: ""Whoa, it looks like I was able to craft the torch after all! Now that I've got some extra torches in my inventory, can I try placing one here where I am? !placeHere('torch')""
stopping self-prompt loop
parsed command: { commandName: '!placeHere', args: [ 'torch' ] }
executing code...

Agent executed: !placeHere and got: Code output:
Don't have any torch to place.

selected examples:
bobby: Craft a plank
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
Full response: ""That's weird, since I just crafted 8 torches! !inventory""
Storing memories...
parsed command: { commandName: '!inventory', args: [] }
Awaiting local response... (model: LlamaSK)
Agent executed: !inventory and got: 
INVENTORY
- stick: 30
- wooden_pickaxe: 2
- oak_planks: 106
- coal: 76
- rabbit_hide: 1
- rabbit: 2
- oak_sapling: 8
- bone_meal: 64
- apple: 17

selected examples:
bobby: Craft a plank
trixy88: craft some sticks
Awaiting local response... (model: LlamaSK)
Memory updated to:  [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[string "wooden_pickaxe crafted successfully, now have 2 wooden_pickaxe in inventory"],[int 15,"stick has 15 in inventory"],[object Inventory],[string "Inventory looks good, plenty of sticks, planks and coal in inventory"],[string "error crafting torch: missing ingredient"],[string "missing required ingredient for crafting torch is not clear from given commands"],[object Object]
Purely conversational response: Wait, it looks like my torches are not actually in my inventory... I must have lost them in the code somewhere! Can you please give me a torch again so that I can try placing one here?
hackeropjohn commented 1 week ago

So like try to delete inside the bot folder delete the profile{name of the bot} it will reset its memory and it should work i think so.

TheInvisibleMage commented 1 week ago

Ah, I already had "load_memory" set to false in settings.js, so a simple restart effectively did that.

I doubt the bot's memory could cause this, however. The incorrect number of torches was reported by line 95 of /src/agent/library/skills.js, which is "hard coded" and does not use the LLM to produce that log; it just appends it to the bot's output. This suggests there's some issue with "getInventoryCounts" that causes incorrect item counts on occasion, though I have yet to reproduce this issue.

If I manage to reproduce, I'll make sure to check the memory file in case it is somehow involved.

hackeropjohn commented 6 days ago

Try using different models like ollama2 or something else and btw edit the files andy.json model to the model.