Skip to content

Commit 30784e7

Browse files
committed
simulate: allow using empty agent name
1 parent b8a5e6c commit 30784e7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cmd/lk/simulate.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var simulateCommand = &cli.Command{
9595
},
9696
&cli.StringFlag{
9797
Name: "agent-name",
98-
Usage: "Run against an already-running agent registered under this `NAME` instead of spawning one locally. Requires --scenarios.",
98+
Usage: "Run against an already-running agent instead of spawning one locally. Pass the registered `NAME`, or \"\" to target the project's default agent (the one that auto-joins every room). Requires --scenarios.",
9999
},
100100
},
101101
}
@@ -271,8 +271,10 @@ func runSimulate(ctx context.Context, cmd *cli.Command) error {
271271
err error
272272
)
273273

274-
if liveAgentName != "" {
275-
// Run against an already-running agent (registered under liveAgentName):
274+
// --agent-name (even empty) means: run against an already-running agent,
275+
// don't spawn one. An empty name targets the project's default agent — the
276+
// one that auto-joins every room (registered with no agent_name).
277+
if cmd.IsSet("agent-name") {
276278
// nothing is spawned, so there's no source to generate scenarios from.
277279
if scenariosPath == "" {
278280
return fmt.Errorf("--agent-name requires --scenarios (no source to generate scenarios from when running against a live agent)")

0 commit comments

Comments
 (0)