diff --git a/pkg/agentic/commit.go b/pkg/agentic/commit.go index 0f765e8..d45f191 100644 --- a/pkg/agentic/commit.go +++ b/pkg/agentic/commit.go @@ -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), diff --git a/pkg/agentic/events.go b/pkg/agentic/events.go index 2727161..99ee36b 100644 --- a/pkg/agentic/events.go +++ b/pkg/agentic/events.go @@ -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) { diff --git a/pkg/agentic/review_queue.go b/pkg/agentic/review_queue.go index 173aec8..1ce123b 100644 --- a/pkg/agentic/review_queue.go +++ b/pkg/agentic/review_queue.go @@ -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)})