Finish PromptKit repair and execution accounting follow-ups

This commit is contained in:
2026-11-15 01:44:01 +00:00
parent d6413b3996
commit dfdc6cc2c4
6 changed files with 33 additions and 10 deletions

View File

@@ -2,7 +2,6 @@ package runner
import (
"context"
"encoding/json"
"errors"
"fmt"
"path/filepath"
@@ -151,9 +150,6 @@ func repairCandidates(ctx context.Context, input validateSectionCandidatesInput,
completion, callErr := *turn.Response, turn.Err
proposalIndex, attemptNumber := original.ProposalIndex, branch.AttemptCount+1
var response proposal_generation.RepairResponse
if callErr == nil {
_ = json.Unmarshal(completion.Content, &response)
}
operation := outcomes.Operation{
Reference: outcomes.Reference{
@@ -202,7 +198,8 @@ func repairCandidates(ctx context.Context, input validateSectionCandidatesInput,
}
return nil, callErr
}
decoded, err := proposal_generation.DecodeRepairResponse(completion.Content, position+1)
var err error
response, err = proposal_generation.DecodeRepairResponse(completion.Content, position+1)
if err != nil {
operation.FailureReason = outcomes.ReasonInvalidOutput
finishAttempt(err, nil, validateSectionCandidatesResult{})
@@ -211,12 +208,12 @@ func repairCandidates(ctx context.Context, input validateSectionCandidatesInput,
}
operation.Succeeded = true
operation.RecoveryReasons = outcomes.ExecutionRecoveries(operation.Counts)
if decoded.Action == "withdraw" {
if response.Action == "withdraw" {
finishAttempt(nil, nil, validateSectionCandidatesResult{})
branch.Outcome = "withdrawn"
return nil, nil
}
revision := decoded.Correction
revision := response.Correction
localRef = revision.SegmentReference
target := 0
if input.WorkingTranscript != nil && localRef > 0 && localRef <= len(input.WorkingTranscript.Segments) {