fix(core): preserve logical step across retries (#37316)

This commit is contained in:
Kit Langton 2026-07-16 10:54:51 -04:00 committed by GitHub
commit 4829308f2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 11 deletions

View file

@ -339,8 +339,7 @@ const layer = Layer.effect(
const error = toSessionError(llmFailure)
if (
SessionRunnerRetry.isRetryable(llmFailure) &&
!publisher.hasRetryEvidence() &&
(agentInfo.steps === undefined || currentStep < agentInfo.steps)
!publisher.hasRetryEvidence()
) {
return yield* new SessionRunnerRetry.RetryableFailure({
cause: llmFailure,
@ -457,7 +456,7 @@ const layer = Layer.effect(
Effect.tapError((error) =>
error instanceof SessionRunnerRetry.RetryableFailure
? Effect.sync(() => {
currentStep = error.step + 1
currentStep = error.step
assistantMessageID = error.assistantMessageID
currentPromotion = undefined
})