Fix plan-delegate notify recovery#4299
Merged
Merged
Conversation
There was a problem hiding this comment.
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
commsagent (the owner ofnotify) instead of re-prompting the conductor. - After recovery, wait for the
notifyside effect to settle before failing therequire-notifystep. - 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{}) |
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #4277
Closes #4298
Testing