You've already forked agentic-coding-workflow
feat(workspace): session-scoped Caller.Holder + ReleaseByHolder for ACP integration
This commit is contained in:
@@ -58,6 +58,9 @@ type Repository interface {
|
||||
TryStartPrune(ctx context.Context, id uuid.UUID) (*Worktree, error)
|
||||
FinishPruneSuccess(ctx context.Context, id uuid.UUID) error
|
||||
FinishPruneRollback(ctx context.Context, id uuid.UUID) error
|
||||
// ReleaseWorktreesByHolder 一次性释放某 holder 持有的所有活跃 worktree。
|
||||
// 用于 ACP 启动 reaper / supervisor.onExit 不知道具体 wtID 时的清理。
|
||||
ReleaseWorktreesByHolder(ctx context.Context, holder string) ([]*Worktree, error)
|
||||
|
||||
// Workspace fetch (jobs runner)
|
||||
ListFetchTargets(ctx context.Context) ([]FetchTarget, error)
|
||||
@@ -403,6 +406,18 @@ func (r *pgRepo) FinishPruneRollback(ctx context.Context, id uuid.UUID) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *pgRepo) ReleaseWorktreesByHolder(ctx context.Context, holder string) ([]*Worktree, error) {
|
||||
rows, err := r.q.ReleaseWorktreesByHolder(ctx, &holder)
|
||||
if err != nil {
|
||||
return nil, errs.Wrap(err, errs.CodeInternal, "release worktrees by holder")
|
||||
}
|
||||
out := make([]*Worktree, 0, len(rows))
|
||||
for _, row := range rows {
|
||||
out = append(out, rowToWorktree(row))
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ===== Credential =====
|
||||
|
||||
func rowToCredential(r workspacesqlc.GitCredential) *Credential {
|
||||
|
||||
Reference in New Issue
Block a user