# Guard CLI first-run prompt with agents-v2 flag \(\#53839\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/acf5da917270c5cedf083a56bcb4e0fb1a2e6886)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: acf5da917270c5cedf083a56bcb4e0fb1a2e6886

Requested commit: acf5da917270c5cedf083a56bcb4e0fb1a2e6886

Commit: acf5da917270c5cedf083a56bcb4e0fb1a2e6886

Tree: 308cc2b348c0286d252dd689618b8bfd6612d0a1

Author: Eric Holk

Committer: GitHub

## Message

```
Guard CLI first-run prompt with agents-v2 flag (#53839)

Gates the CLI first-run prompt (from #53663) on the `agent-v2` feature
flag, giving us an escape hatch if something goes wrong.

## What this does

**Commit 1: Gate on agent-v2 flag**
- Adds an `AgentV2FeatureFlag` check at the top of the open behavior
resolution. When the flag is off, the prompt is skipped.
- Refactors `maybe_prompt_open_behavior` → `resolve_open_behavior`:
moves the explicit-flags guard (`-n`, `-e`, `--reuse`) to the caller and
drops three parameters from the function signature, since the function
was only inspecting those values to decide whether to bail early.

**Commit 2: Default to new-window when flag is disabled**
- When the flag is off, falls back to the pre-#53254 behavior of opening
projects in a new window, rather than silently adding to the sidebar.

Release Notes:

- N/A
```

## Parents

- [b310904bd95cecc9b2804261701d0bb7110529d9](https://git.cafe/gitcafe/zed/commit/b310904bd95cecc9b2804261701d0bb7110529d9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/acf5da917270c5cedf083a56bcb4e0fb1a2e6886?format=markdown)
