feat(exec): surface AttemptRecord slice on Result for session logging

This commit is contained in:
Mathias Bergqvist
2026-04-22 13:35:38 +02:00
parent 38ada998a2
commit c44eb680b2
2 changed files with 7 additions and 4 deletions

View File

@@ -101,7 +101,9 @@ func main() {
} }
attempts := make([]iexec.AttemptRecord, 0, len(chain)) attempts := make([]iexec.AttemptRecord, 0, len(chain))
orch := iexec.NewOrchestrator(chain, litellmExec.Run, claudeExec.Run, verifier, models.LlamaSwapURL(), &attempts) orch := iexec.NewOrchestrator(chain, litellmExec.Run, claudeExec.Run, verifier, models.LlamaSwapURL(), &attempts)
return orch.Run(ctx, req) result, err := orch.Run(ctx, req)
result.Attempts = attempts // attach orchestration metadata before returning
return result, err
} }
} }

View File

@@ -14,9 +14,10 @@ type Result struct {
Skill string `json:"skill"` // tdd | review | ... Skill string `json:"skill"` // tdd | review | ...
FilePath string `json:"file_path"` // absolute path to generated file FilePath string `json:"file_path"` // absolute path to generated file
RunnerOutput string `json:"runner_output"` // raw stdout+stderr from test runner RunnerOutput string `json:"runner_output"` // raw stdout+stderr from test runner
Verified bool `json:"verified"` // based on exit code, never self-report Verified bool `json:"verified"` // based on exit code, never self-report
ModelUsed string `json:"model_used"` // model name or "self" ModelUsed string `json:"model_used"` // model name or "self"
Message string `json:"message"` // one sentence summary Message string `json:"message"` // one sentence summary
Attempts []AttemptRecord `json:"attempts,omitempty"` // populated by orchestrator, not Claude
} }
var validStatuses = map[string]bool{"pass": true, "fail": true, "error": true} var validStatuses = map[string]bool{"pass": true, "fail": true, "error": true}