fix(context): emit the manifest on every context rebuild, not just the first (#307)
c742656e emitted ContextAssembledEvent only at the stage's initial
contextPackBuilder.build. But the question that motivated #307 — "did the ACR
steer-away hint fire on 7 consecutive turns?" — is a per-rebuild question:
unconfirmedFixEntries recomputes on every rebuild, which is exactly the #306
bug. With one event per stage the log still couldn't answer it.
Emit at all four build sites, matching emitContextTruncationIfNeeded's existing
placement: pushBack, the tool-round rebuild, and the tools-less clean emission.
./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:
+3
@@ -367,6 +367,7 @@ internal suspend fun SessionOrchestrator.executeStage(
|
|||||||
budget = TokenBudget(limit = stageConfig.tokenBudget),
|
budget = TokenBudget(limit = stageConfig.tokenBudget),
|
||||||
)
|
)
|
||||||
emitContextTruncationIfNeeded(sessionId, stageId, currentContext)
|
emitContextTruncationIfNeeded(sessionId, stageId, currentContext)
|
||||||
|
emitContextAssembled(sessionId, stageId, currentContext)
|
||||||
toolRounds++
|
toolRounds++
|
||||||
return runInference(
|
return runInference(
|
||||||
sessionId, stageId, currentContext, stageConfig, config.stageTimeoutMs, responseFormat, effectives,
|
sessionId, stageId, currentContext, stageConfig, config.stageTimeoutMs, responseFormat, effectives,
|
||||||
@@ -546,6 +547,7 @@ internal suspend fun SessionOrchestrator.executeStage(
|
|||||||
budget = TokenBudget(limit = stageConfig.tokenBudget),
|
budget = TokenBudget(limit = stageConfig.tokenBudget),
|
||||||
)
|
)
|
||||||
emitContextTruncationIfNeeded(sessionId, stageId, currentContext)
|
emitContextTruncationIfNeeded(sessionId, stageId, currentContext)
|
||||||
|
emitContextAssembled(sessionId, stageId, currentContext)
|
||||||
inferenceResult = runInference(
|
inferenceResult = runInference(
|
||||||
sessionId, stageId, currentContext, stageConfig, config.stageTimeoutMs, responseFormat, effectives,
|
sessionId, stageId, currentContext, stageConfig, config.stageTimeoutMs, responseFormat, effectives,
|
||||||
)
|
)
|
||||||
@@ -579,6 +581,7 @@ internal suspend fun SessionOrchestrator.executeStage(
|
|||||||
entries = accumulatedEntries,
|
entries = accumulatedEntries,
|
||||||
budget = TokenBudget(limit = stageConfig.tokenBudget),
|
budget = TokenBudget(limit = stageConfig.tokenBudget),
|
||||||
)
|
)
|
||||||
|
emitContextAssembled(sessionId, stageId, currentContext)
|
||||||
inferenceResult = runInference(
|
inferenceResult = runInference(
|
||||||
sessionId, stageId, currentContext, stageConfig, config.stageTimeoutMs,
|
sessionId, stageId, currentContext, stageConfig, config.stageTimeoutMs,
|
||||||
responseFormat, effectives, withTools = false,
|
responseFormat, effectives, withTools = false,
|
||||||
|
|||||||
Reference in New Issue
Block a user