fix(builder): separate build output from error to preserve timeout messages
When a build timed out, the timeout error was silently replaced by truncated stderr output. Split into separate Error and Output fields on BuildHostResult so the cause (e.g. "build timed out after 30m0s") is always visible in logs and CLI output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -269,10 +269,12 @@ func (b *Builder) handleBuildRequest(subject string, data []byte) {
|
||||
DurationSeconds: hostDuration,
|
||||
}
|
||||
if !result.Success {
|
||||
hostResult.Error = truncateOutput(result.Stderr, 50)
|
||||
if hostResult.Error == "" && result.Error != nil {
|
||||
if result.Error != nil {
|
||||
hostResult.Error = result.Error.Error()
|
||||
}
|
||||
if result.Stderr != "" {
|
||||
hostResult.Output = truncateOutput(result.Stderr, 50)
|
||||
}
|
||||
}
|
||||
results = append(results, hostResult)
|
||||
|
||||
@@ -284,7 +286,7 @@ func (b *Builder) handleBuildRequest(subject string, data []byte) {
|
||||
}
|
||||
} else {
|
||||
failed++
|
||||
b.logger.Error("host build failed", "host", host, "error", hostResult.Error)
|
||||
b.logger.Error("host build failed", "host", host, "error", hostResult.Error, "output", hostResult.Output)
|
||||
if b.metrics != nil {
|
||||
b.metrics.RecordHostBuildFailure(req.Repo, host, hostDuration)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user