Fix: some Reactive stuff
This commit is contained in:
@@ -774,6 +774,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
|||||||
{
|
{
|
||||||
if (_interactiveLaunchSpec is null)
|
if (_interactiveLaunchSpec is null)
|
||||||
throw new InvalidOperationException("Interactive launch spec service is not configured.");
|
throw new InvalidOperationException("Interactive launch spec service is not configured.");
|
||||||
|
_broadcaster.WorktreeUpdated(taskId);
|
||||||
return _interactiveLaunchSpec.BuildForTaskAsync(taskId, Context.ConnectionAborted);
|
return _interactiveLaunchSpec.BuildForTaskAsync(taskId, Context.ConnectionAborted);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using ClaudeDo.Data;
|
|||||||
using ClaudeDo.Data.Git;
|
using ClaudeDo.Data.Git;
|
||||||
using ClaudeDo.Data.Models;
|
using ClaudeDo.Data.Models;
|
||||||
using ClaudeDo.Data.Repositories;
|
using ClaudeDo.Data.Repositories;
|
||||||
|
using ClaudeDo.Worker.Hub;
|
||||||
using ClaudeDo.Worker.Runner;
|
using ClaudeDo.Worker.Runner;
|
||||||
using ClaudeDo.Worker.State;
|
using ClaudeDo.Worker.State;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@@ -20,17 +21,20 @@ public sealed class InteractiveReviewSubmissionService
|
|||||||
private readonly GitService _git;
|
private readonly GitService _git;
|
||||||
private readonly ITaskStateService _state;
|
private readonly ITaskStateService _state;
|
||||||
private readonly WorktreeManager? _worktreeManager;
|
private readonly WorktreeManager? _worktreeManager;
|
||||||
|
private readonly HubBroadcaster? _broadcaster;
|
||||||
|
|
||||||
public InteractiveReviewSubmissionService(
|
public InteractiveReviewSubmissionService(
|
||||||
IDbContextFactory<ClaudeDoDbContext> dbFactory,
|
IDbContextFactory<ClaudeDoDbContext> dbFactory,
|
||||||
GitService git,
|
GitService git,
|
||||||
ITaskStateService state,
|
ITaskStateService state,
|
||||||
WorktreeManager? worktreeManager = null)
|
WorktreeManager? worktreeManager = null,
|
||||||
|
HubBroadcaster? broadcaster = null)
|
||||||
{
|
{
|
||||||
_dbFactory = dbFactory;
|
_dbFactory = dbFactory;
|
||||||
_git = git;
|
_git = git;
|
||||||
_state = state;
|
_state = state;
|
||||||
_worktreeManager = worktreeManager;
|
_worktreeManager = worktreeManager;
|
||||||
|
_broadcaster = broadcaster;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task SubmitAsync(string taskId, CancellationToken ct)
|
public async Task SubmitAsync(string taskId, CancellationToken ct)
|
||||||
@@ -86,5 +90,14 @@ public sealed class InteractiveReviewSubmissionService
|
|||||||
var result = await _state.SubmitInteractiveForReviewAsync(taskId, DateTime.UtcNow, ct);
|
var result = await _state.SubmitInteractiveForReviewAsync(taskId, DateTime.UtcNow, ct);
|
||||||
if (!result.Ok)
|
if (!result.Ok)
|
||||||
throw new InvalidOperationException(result.Reason ?? "Could not submit for review.");
|
throw new InvalidOperationException(result.Reason ?? "Could not submit for review.");
|
||||||
|
|
||||||
|
// The transition itself only broadcasts TaskUpdated, and the detail pane answers that by
|
||||||
|
// refreshing the task row alone -- its whole REVIEW/MERGE block (Open diff, branch picker,
|
||||||
|
// change summary) is gated on the worktree it last read, refreshed only on WorktreeUpdated.
|
||||||
|
// An interactive session creates its worktree at launch and gets it committed HERE, both
|
||||||
|
// outside the autonomous pipeline that would normally announce it, so without this the task
|
||||||
|
// arrives in WaitingForReview with the diff button missing until it is re-selected.
|
||||||
|
if (_broadcaster is not null)
|
||||||
|
await _broadcaster.WorktreeUpdated(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user