From f78c7f15add186575cd8ea6de7b37eb936dce08e Mon Sep 17 00:00:00 2001 From: kami Date: Sun, 26 Jul 2026 23:29:27 +0400 Subject: [PATCH] fix(kernel): drop the steer-away hint after its first build, not just its first stage entry (#306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bc5afa51 made unconfirmedFixEntries one-shot per RetryAttemptedEvent by folding prior ContextAssembledEvent manifests. Correct, but it only guards the call site — which runs ONCE per stage entry (SessionOrchestratorExecution.kt:250). The entry it returns is folded into accumulatedEntries, and every pushBack / tool-round rebuild rebuilds from that same list, so the hint rode along into every turn of the stage regardless of the delivery fold. That is the reported symptom: 7 consecutive turns in session d734e1de, one stage entry. Drop sourceType=="unconfirmedFix" from accumulatedEntries once the first pack is built and its delivery recorded. The fold still does the across-entries half. ./gradlew check green. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01HgDL1v3GuQ9RZnYR6fDT95 --- .../kernel/orchestration/SessionOrchestratorExecution.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/kernel/src/main/kotlin/com/correx/core/kernel/orchestration/SessionOrchestratorExecution.kt b/core/kernel/src/main/kotlin/com/correx/core/kernel/orchestration/SessionOrchestratorExecution.kt index fbc0e013..90ba26f2 100644 --- a/core/kernel/src/main/kotlin/com/correx/core/kernel/orchestration/SessionOrchestratorExecution.kt +++ b/core/kernel/src/main/kotlin/com/correx/core/kernel/orchestration/SessionOrchestratorExecution.kt @@ -305,6 +305,11 @@ internal suspend fun SessionOrchestrator.executeStage( } emitContextTruncationIfNeeded(sessionId, stageId, contextPack) emitContextAssembled(sessionId, stageId, contextPack) + // #306, within-stage half: the delivery fold in unconfirmedFixEntries only runs at stage entry, + // so on its own it stops re-injection across ENTRIES, not across the turns of one entry — every + // pushBack rebuild re-uses accumulatedEntries and would carry the steer-away into all of them + // (7 consecutive turns, session d734e1de). It is one-shot by definition: drop it once delivered. + accumulatedEntries = accumulatedEntries.filterNot { it.sourceType == "unconfirmedFix" } var currentContext = contextPack var inferenceResult = runInference(