feat(worker,data): persist interactive session id so a closed/aborted ConPTY session can be resumed
Generates the claude session id up front (--session-id <guid>) for a fresh interactive task session and persists it to TaskEntity.InteractiveSessionId before launch, so an abort at any point still leaves a resumable id. BuildForTaskAsync now resumes this task's own last interactive session in preference to the latest autonomous run's session, but never across a freshly (re)created worktree.
This commit is contained in:
@@ -402,6 +402,19 @@ public sealed class TaskRepository
|
||||
.SetProperty(t => t.HandlerHeadCommit, headCommit), ct);
|
||||
}
|
||||
|
||||
// Persists the claude session id a fresh embedded ConPTY interactive task session will run
|
||||
// under, written BEFORE launch so a closed/aborted session still leaves a resumable id.
|
||||
public async Task SetInteractiveSessionIdAsync(
|
||||
string taskId,
|
||||
string? sessionId,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
await _context.Tasks
|
||||
.Where(t => t.Id == taskId)
|
||||
.ExecuteUpdateAsync(s => s
|
||||
.SetProperty(t => t.InteractiveSessionId, sessionId), ct);
|
||||
}
|
||||
|
||||
public async Task<TaskEntity?> FindByPlanningTokenAsync(
|
||||
string token,
|
||||
CancellationToken ct = default)
|
||||
|
||||
Reference in New Issue
Block a user