fix(workflow): add activity timeouts to prevent BadScheduleActivityAttributes
ci / test (push) Successful in 43s
ci / test (push) Successful in 43s
All ExecuteActivity calls were missing StartToCloseTimeout and ScheduleToCloseTimeout, causing 'BadScheduleActivityAttributes' errors. - Added 10min timeout for git operations (clone, worktree, push, merge) - Added 30min timeout for LLM activities (implementer, which calls Claude) - Git operations use shared ctxWithOptions context - LLM activities get their own implCtx with longer timeout - Added time import
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.temporal.io/sdk/workflow"
|
||||
)
|
||||
@@ -18,8 +19,14 @@ func OrchestratorWorkflow(ctx workflow.Context, in OrchestratorInput) (Orchestra
|
||||
}
|
||||
|
||||
// Step 1: Clone the repository
|
||||
activityOptions := workflow.ActivityOptions{
|
||||
StartToCloseTimeout: 10 * time.Minute,
|
||||
ScheduleToCloseTimeout: 15 * time.Minute,
|
||||
}
|
||||
ctxWithOptions := workflow.WithActivityOptions(ctx, activityOptions)
|
||||
|
||||
cloneErr := workflow.ExecuteActivity(
|
||||
ctx,
|
||||
ctxWithOptions,
|
||||
"CloneRepoActivity",
|
||||
map[string]interface{}{
|
||||
"RemoteURL": in.RemoteURL,
|
||||
@@ -55,7 +62,7 @@ func OrchestratorWorkflow(ctx workflow.Context, in OrchestratorInput) (Orchestra
|
||||
// Add worktree
|
||||
var worktreePath string
|
||||
wtErr := workflow.ExecuteActivity(
|
||||
ctx,
|
||||
ctxWithOptions,
|
||||
"GitWorktreeAddActivity",
|
||||
map[string]interface{}{
|
||||
"RepoPath": in.TargetRepoPath,
|
||||
@@ -67,10 +74,16 @@ func OrchestratorWorkflow(ctx workflow.Context, in OrchestratorInput) (Orchestra
|
||||
continue // Skip this task on error
|
||||
}
|
||||
|
||||
// Call implementer to generate code
|
||||
// Call implementer to generate code (longer timeout for LLM calls)
|
||||
implOptions := workflow.ActivityOptions{
|
||||
StartToCloseTimeout: 30 * time.Minute,
|
||||
ScheduleToCloseTimeout: 35 * time.Minute,
|
||||
}
|
||||
implCtx := workflow.WithActivityOptions(ctx, implOptions)
|
||||
|
||||
var implOutput map[string]interface{}
|
||||
implErr := workflow.ExecuteActivity(
|
||||
ctx,
|
||||
implCtx,
|
||||
"ImplementerActivity",
|
||||
map[string]interface{}{
|
||||
"TaskID": taskID,
|
||||
@@ -91,7 +104,7 @@ func OrchestratorWorkflow(ctx workflow.Context, in OrchestratorInput) (Orchestra
|
||||
|
||||
// Commit changes
|
||||
commitErr := workflow.ExecuteActivity(
|
||||
ctx,
|
||||
ctxWithOptions,
|
||||
"GitCommitActivity",
|
||||
map[string]interface{}{
|
||||
"WorktreePath": worktreePath,
|
||||
@@ -106,7 +119,7 @@ func OrchestratorWorkflow(ctx workflow.Context, in OrchestratorInput) (Orchestra
|
||||
|
||||
// Step 4: Push to remote
|
||||
pushErr := workflow.ExecuteActivity(
|
||||
ctx,
|
||||
ctxWithOptions,
|
||||
"GitPushActivity",
|
||||
map[string]interface{}{
|
||||
"RepoPath": in.TargetRepoPath,
|
||||
@@ -125,7 +138,7 @@ func OrchestratorWorkflow(ctx workflow.Context, in OrchestratorInput) (Orchestra
|
||||
}
|
||||
|
||||
mergeErr := workflow.ExecuteActivity(
|
||||
ctx,
|
||||
ctxWithOptions,
|
||||
"GitSquashMergeActivity",
|
||||
map[string]interface{}{
|
||||
"RepoPath": in.TargetRepoPath,
|
||||
|
||||
Reference in New Issue
Block a user