This commit is contained in:
Ian Gulliver
2026-10-20 22:08:12 -07:00
parent 5eab2597e4
commit 02fb36e945
4 changed files with 10 additions and 23 deletions
+4 -9
View File
@@ -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,
+3 -7
View File
@@ -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:
-4
View File
@@ -214,7 +214,3 @@ func Starts(def api.WorkflowDefinition) []string {
}
return starts
}
func FromMain(def api.WorkflowDefinition, name string) bool {
return len(After(def, name)) > 1
}