Skip to content

Commit a960d2f

Browse files
committed
feat(cli): support user message attachment with /attach
1 parent b3b9792 commit a960d2f

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

pkg/cli/runner.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ type Config struct {
3939
AutoApprove bool
4040
HideToolCalls bool
4141
OutputJSON bool
42+
ExecutionMode string
43+
MaxIterations int
4244
}
4345

4446
// Run executes an agent in non-TUI mode, handling user input and runtime events
@@ -53,7 +55,25 @@ func Run(ctx context.Context, out *Printer, cfg Config, rt runtime.Runtime, sess
5355
ctx = telemetry.WithClient(ctx, telemetryClient)
5456
}
5557

56-
orch := runtime.NewSingleAgentOrchestrator(rt)
58+
var orch runtime.Orchestrator
59+
60+
switch cfg.ExecutionMode {
61+
case "loop":
62+
orch = runtime.NewLoopAgentOrchestrator(
63+
runtime.NewSingleAgentOrchestrator(rt),
64+
cfg.MaxIterations,
65+
func(ctx context.Context, iter int, events []runtime.Event) bool {
66+
// você pode customizar a condição de saída, por agora false (loop até MaxIterations)
67+
return false
68+
},
69+
)
70+
case "sequential":
71+
orch = runtime.NewSequentialAgentOrchestrator(rt)
72+
case "parallel":
73+
orch = runtime.NewParallelAgentOrchestrator(rt)
74+
default:
75+
orch = runtime.NewSingleAgentOrchestrator(rt)
76+
}
5777

5878
sess.Title = "Running agent"
5979
// If the last received event was an error, return it. That way the exit code

0 commit comments

Comments
 (0)