Audit of 5eab259
This commit is contained in:
@@ -55,18 +55,13 @@ type claudeProcess struct {
|
||||
func (m *Manager) startClaude(ctx context.Context, sess api.AgentSession, l *live, g string, servers []*mcp.Server, stdio []mcp.Stdio, env []string) (agentProcess, error) {
|
||||
hooks := map[string][]claude.HookMatcher{
|
||||
"UserPromptSubmit": {{Func: remindGuidance(g)}},
|
||||
"Stop": {{Func: m.bounceProseQuestion(l)}},
|
||||
"PostToolUse": {{Func: m.afterTool(l)}},
|
||||
}
|
||||
if l.owner != "" {
|
||||
hooks = map[string][]claude.HookMatcher{
|
||||
"UserPromptSubmit": {{Func: remindGuidance(g)}},
|
||||
"PostToolUse": {{Func: m.afterTool(l)}},
|
||||
if l.reviewID == "" {
|
||||
hooks["PostToolUse"] = []claude.HookMatcher{{Func: m.afterTool(l)}}
|
||||
if l.owner == "" {
|
||||
hooks["Stop"] = []claude.HookMatcher{{Func: m.bounceProseQuestion(l)}}
|
||||
}
|
||||
}
|
||||
if l.reviewID != "" {
|
||||
hooks = map[string][]claude.HookMatcher{"UserPromptSubmit": {{Func: remindGuidance(g)}}}
|
||||
}
|
||||
|
||||
opts := claude.Options{
|
||||
Cwd: l.dir,
|
||||
|
||||
@@ -234,11 +234,7 @@ func (m *Manager) StartWorkflow(ctx context.Context, project api.Project, creato
|
||||
run := store.NewID()
|
||||
tasks := []api.Task{}
|
||||
for _, stage := range workflow.Starts(frozen.Definition) {
|
||||
from := base
|
||||
if workflow.FromMain(frozen.Definition, stage) {
|
||||
from = project.DefaultBranch
|
||||
}
|
||||
task, err := m.startStage(ctx, project, creator, frozen, run, stage, from, todoItem, nil, actor)
|
||||
task, err := m.startStage(ctx, project, creator, frozen, run, stage, base, todoItem, nil, actor)
|
||||
if task.Id != "" {
|
||||
tasks = append(tasks, task)
|
||||
}
|
||||
@@ -312,7 +308,7 @@ func stageMessage(frozen store.FrozenWorkflow, stage string, parents []parentSta
|
||||
}
|
||||
switch {
|
||||
case len(parents) == 0:
|
||||
case workflow.FromMain(frozen.Definition, stage):
|
||||
case len(parents) > 1:
|
||||
fmt.Fprintf(b, "\n\nThis task starts from %s. The branch of each stage above holds that stage's work: `git merge` the ones this stage needs, or read them with `git show` and `git diff`.", defaultBranch)
|
||||
default:
|
||||
fmt.Fprintf(b, "\n\nThis task starts from the commit stage %q finished at, so its work is already in this worktree.", *parents[0].task.WorkflowStage)
|
||||
@@ -485,7 +481,7 @@ func (m *Manager) advanceTo(ctx context.Context, from api.Task, frozen store.Fro
|
||||
|
||||
base := parents[0].commit
|
||||
switch {
|
||||
case !workflow.FromMain(frozen.Definition, stage):
|
||||
case len(parents) == 1:
|
||||
case frozen.Audit != "":
|
||||
base = frozen.Audit
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user