Add game tests reproducing crafting interface single-use bug (issue #188)#190
Closed
Copilot wants to merge 2 commits intomaster-1.21-ltsfrom
Closed
Add game tests reproducing crafting interface single-use bug (issue #188)#190Copilot wants to merge 2 commits intomaster-1.21-ltsfrom
Copilot wants to merge 2 commits intomaster-1.21-ltsfrom
Conversation
Copilot
AI
changed the title
[WIP] Fix crafting interface to allow multiple recipe instances
Add game tests reproducing furnace crafting interface stops after single use (#186)
Mar 4, 2026
Copilot
AI
changed the title
Add game tests reproducing furnace crafting interface stops after single use (#186)
Add game tests reproducing crafting interface single-use bug (issue #188)
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The crafting interface stops processing after the first recipe entry when using a non-crafting-table crafter (e.g. furnace): in blocking mode only the first item is produced and remaining ingredients drop from the interface; in non-blocking mode a second crafting request is silently dropped.
Root cause (identified, not yet fixed)
PendingCraftingJobResultIndexObserveris registered only as aninsertPreConsumer, which fires exclusively when items are explicitly inserted via the network's insert API (e.g. an importer part). Items arriving via hoppers or any mechanism that bypassesIngredientChannelAdapter.insert()never trigger the observer. The crafting job stays permanently stuck inprocessingCraftingJobs, blocking all subsequent requests sinceprocessingJobs >= maxProcessingJobs.Changes
testItemsCraftFurnaceBlockingMultiple,testItemsCraftFurnaceSecondRequest) — cover blocking-mode multi-item sequential processing and second-request re-trigger via crafting writer. These tests use an importer and currently pass (they do not yet reproduce the hopper-path failure).Known gap
Tests do not yet reproduce the actual user-facing failure path (hopper-based output bypassing the insert API). The fix requires
PendingCraftingJobResultIndexObserverto also implementIIngredientComponentStorageObservable.IIndexChangeObserverand register viaaddObserver, so thatonChange(ADDITION)events from the ingredient observer also calladdIngredient(...)— covering items that arrive through observation rather than explicit insert.Original prompt
This section details on the original issue you should resolve
<issue_title>Crafting Interface stops processing after single use</issue_title>
<issue_description>
Issue type:
Short description:
When a crafting plan is initiated for multiple instances of a recipe on a "crafter" that is NOT a crafting table, it stops processing after the first instance of the recipe when the Crafting Interface is in blocking mode or after the first "run" when in non-blocking mode (so that subsequent calls to that recipe do not process.)
Items used in the crafting plan get "stuck" in the Crafting Interface and will drop when the Interface is broken.
Steps to reproduce the problem:
Expected behaviour:
Repeated crafting of the same recipe should process to completion whether crafting multiple items when in Blocking Mode or multiple requests to craft when in non-Blocking Mode. Active crafting plans should display in the Crafting Terminal until they complete.
Versions:
Only Integrated Crafting, Integrated Terminals and their required mods are loaded.
Log file:
</issue_description>
<agent_instructions>Try to reproduce this issue by creating new game tests. Specifically, focus on steps 12 and 13 (storage terminal is not available, so trigger jobs using the crafting writer).
Please make a PR with these new game tests, and they should fail according to how it's described in this issue.
We will look into fixing this issue later, so no need to do it here.
If you can not reproduce the problem, that's fine as well, just make a game test then that closely resembles the issue, so I can take it from there.</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@rubensworks🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.