fix(kernel): drop the steer-away hint after its first build, not just its first stage entry (#306)

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HgDL1v3GuQ9RZnYR6fDT95
This commit is contained in:
2026-07-26 23:29:27 +04:00
parent bc5afa51b3
commit f78c7f15ad
@@ -305,6 +305,11 @@ internal suspend fun SessionOrchestrator.executeStage(
} }
emitContextTruncationIfNeeded(sessionId, stageId, contextPack) emitContextTruncationIfNeeded(sessionId, stageId, contextPack)
emitContextAssembled(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 currentContext = contextPack
var inferenceResult = runInference( var inferenceResult = runInference(