You've already forked agentic-coding-workflow
bugfix
This commit is contained in:
@@ -42,8 +42,13 @@ type workspaceService struct {
|
||||
clones CloneScheduler
|
||||
dataDir string
|
||||
fetchTimout time.Duration
|
||||
indexHook IndexBuildHook
|
||||
}
|
||||
|
||||
// SetIndexBuildHook injects the code-index enqueue callback (app wiring). On Sync
|
||||
// the workspace marks prior runs stale and enqueues a fresh build at new HEAD.
|
||||
func (s *workspaceService) SetIndexBuildHook(h IndexBuildHook) { s.indexHook = h }
|
||||
|
||||
// NewWorkspaceService 构造 WorkspaceService 实现。
|
||||
func NewWorkspaceService(
|
||||
repo Repository,
|
||||
@@ -281,6 +286,13 @@ func (s *workspaceService) Sync(ctx context.Context, c Caller, wsID uuid.UUID) (
|
||||
return nil, err
|
||||
}
|
||||
s.audit(writeCtx, &c.UserID, "workspace.sync", "workspace", wsID.String(), nil)
|
||||
// Best-effort: re-index the main worktree at the new HEAD. The hook marks
|
||||
// prior runs stale then enqueues a build (coalesced on commit). Never blocks.
|
||||
if s.indexHook != nil {
|
||||
if herr := s.indexHook(writeCtx, wsID, nil, ""); herr != nil {
|
||||
s.audit(writeCtx, &c.UserID, "workspace.index_enqueue_failed", "workspace", wsID.String(), map[string]any{"err": herr.Error()})
|
||||
}
|
||||
}
|
||||
return updated, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user