fix(agentic): check append write failures

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-04-17 20:52:37 +01:00
parent 4cea9555d4
commit 2daabf27f7
3 changed files with 13 additions and 3 deletions

View file

@ -104,7 +104,13 @@ func (s *PrepSubsystem) commitWorkspace(ctx context.Context, input CommitInput)
}
return CommitOutput{}, err
}
core.WriteAll(appendHandle.Value, line)
if writeResult := core.WriteAll(appendHandle.Value, line); !writeResult.OK {
err, _ := writeResult.Value.(error)
if err == nil {
err = core.E("commitWorkspace", "failed to append journal entry", nil)
}
return CommitOutput{}, err
}
marker := commitMarker{
Workspace: WorkspaceName(workspaceDir),

View file

@ -34,7 +34,9 @@ func emitEvent(eventType, agent, workspace, status string) {
if !r.OK {
return
}
core.WriteAll(r.Value, line)
if writeResult := core.WriteAll(r.Value, line); !writeResult.OK {
core.Warn("agentic.emitEvent: failed to append event", "path", eventsFile, "reason", writeResult.Value)
}
}
func emitStartEvent(agent, workspace string) {

View file

@ -419,7 +419,9 @@ func (s *PrepSubsystem) storeReviewOutput(repoDir, repo, reviewer, output string
core.Warn("reviewQueue: failed to open review journal", "path", jsonlPath, "reason", r.Value)
return
}
core.WriteAll(r.Value, core.Concat(jsonLine, "\n"))
if writeResult := core.WriteAll(r.Value, core.Concat(jsonLine, "\n")); !writeResult.OK {
core.Warn("reviewQueue: failed to append review journal entry", "path", jsonlPath, "reason", writeResult.Value)
}
}
// s.saveRateLimitState(&RateLimitInfo{Limited: true, RetryAt: time.Now().Add(30 * time.Minute)})