Tape of Episodes from the end: consecutive frames with a non-zero actionImageId form a tail suffix. If its length is ≥ EpisodicMemory_chainPriorityMinFrames (default 2), stimuli from these frames receive priority in OR and in the main FO loop.
Tail: three consecutive reaction frames make the chain longer than the minimum; the priority set includes stimulusImageId and non-zero responseStimulusImageId of those frames.
actionImageId is not enough: otherwise any single reaction episode would get priority without the meaningful “scenario link”. Two or more consecutive frames at the end indicate a stable chain of actions and replies.
findMostActualStimulus): for the priority candidate from the chain’s priority set, hysteresis is not subtracted relative to the previous winner; relevance is amplified (in code: scaling and shifting) so the EM scenario continuation does not lose to “random” active stimuli.
stimuls_consciousness): for chain-priority stimuli, lowering multipliers are not applied (topic/situation mismatch, ImportantProblem); the interruption threshold for the current thinking matches “equal relevance” (coefficient 1.0). The OR winner is marked in context separately and is not cut off by the “thought silence” threshold.