fix(worker): harden review re-run, timestamps, and queue affordance
- Clear ReviewFeedback only after a successful re-run so a failed/cancelled run keeps it for a manual retry. - Clear stale StartedAt/FinishedAt when rejecting a task back to the queue. - Only non-planning standalone tasks gate on review (guard PlanningPhase). - Hide "send to queue" for WaitingForReview tasks so review isn't bypassed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -156,13 +156,24 @@ public sealed class QueueServiceTests : IDisposable
|
||||
await service.StartAsync(cts.Token);
|
||||
_waker.Wake();
|
||||
await done.Task.WaitAsync(TimeSpan.FromSeconds(5));
|
||||
cts.Cancel();
|
||||
|
||||
Assert.Contains("--resume sess-1", capturedArgs);
|
||||
Assert.Equal("fix the bug", capturedPrompt);
|
||||
|
||||
var reloaded = await _taskRepo.GetByIdAsync(task.Id);
|
||||
Assert.Null(reloaded!.ReviewFeedback);
|
||||
// Feedback is cleared after the run reaches a successful terminal state (post-run),
|
||||
// so poll rather than asserting on the handler-fired instant.
|
||||
var deadline = DateTime.UtcNow.AddSeconds(5);
|
||||
TaskEntity? reloaded;
|
||||
do
|
||||
{
|
||||
reloaded = await new TaskRepository(_db.CreateContext()).GetByIdAsync(task.Id);
|
||||
if (reloaded?.ReviewFeedback is null) break;
|
||||
await Task.Delay(25);
|
||||
} while (DateTime.UtcNow < deadline);
|
||||
cts.Cancel();
|
||||
|
||||
Assert.Equal(TaskStatus.WaitingForReview, reloaded!.Status);
|
||||
Assert.Null(reloaded.ReviewFeedback);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user