Skip to content

Fix plan-delegate notify recovery#4299

Merged
asim merged 1 commit into
masterfrom
codex/increment-4298
Jul 8, 2026
Merged

Fix plan-delegate notify recovery#4299
asim merged 1 commit into
masterfrom
codex/increment-4298

Conversation

@asim

@asim asim commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Recover missing plan-delegate notify side effects by retrying through the comms agent that owns notify.
  • Wait for recovered notify side effects to settle before failing the harness step.
  • Add coverage for delayed recovered notify side effects.

Closes #4277
Closes #4298

Testing

  • go build ./...
  • go test ./internal/harness/plan-delegate -run 'TestPlanDelegateExecutionWaitsForInFlightNotifyAfterFlowCompletion|TestPlanDelegateRecoveryWaitsForRecoveredNotifySideEffect|TestPlanDelegateExecutionAcceptsClientTimeoutAfterSideEffects|TestPlanDelegateExecutionClassifiesClientTimeoutBeforeSideEffects|TestPlanDelegateExecutionClassifiesPartialClientTimeout' -count=1\n- go test ./... (fails in this environment: AtlasCloud live stream without usable credentials and loopback targets forbidden for grpc tests)\n- golangci-lint run ./...

@asim asim added the codex label Jul 7, 2026
Copilot AI review requested due to automatic review settings July 7, 2026 23:59
@asim asim merged commit 243d790 into master Jul 8, 2026
10 checks passed
@asim asim deleted the codex/increment-4298 branch July 8, 2026 00:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a reliability gap in the plan-delegate harness where the conductor can finish before the delegated notify side effect is observed, by retrying missing notify work through the comms agent and waiting for recovered side effects to settle.

Changes:

  • Route missing-notify recovery through the comms agent (the owner of notify) instead of re-prompting the conductor.
  • After recovery, wait for the notify side effect to settle before failing the require-notify step.
  • Add a unit test that covers delayed notify delivery after recovery is triggered.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/harness/plan-delegate/main.go Updates recovery behavior to ask comms directly and waits for notify to settle after recovery.
internal/harness/plan-delegate/main_test.go Adds coverage for delayed notify side effects following recovery.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +557 to +560
settled, err = waitForNotifySideEffect(notifySvc, delegatedNotifySettleTimeout)
if err != nil {
return in, err
}
Comment on lines +370 to +389
func TestPlanDelegateRecoveryWaitsForRecoveredNotifySideEffect(t *testing.T) {
taskSvc := new(TaskService)
for _, title := range []string{"Design", "Build", "Ship"} {
var rsp AddResponse
if err := taskSvc.Add(context.Background(), &AddRequest{Title: title}, &rsp); err != nil {
t.Fatalf("Add(%q): %v", title, err)
}
}
notifySvc := new(NotifyService)

recovered := false
_, err := requireDelegatedNotifyStep(taskSvc, notifySvc, func(ctx context.Context) error {
recovered = true
go func() {
time.Sleep(100 * time.Millisecond)
var rsp SendResponse
_ = notifySvc.Send(ctx, &SendRequest{To: "owner@acme.com", Message: "The launch plan is ready"}, &rsp)
}()
return nil
})(context.Background(), flow.State{})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loop: build increment #128 Fix atlascloud plan-delegate notify handoff recovery

3 participants