fix: suppress spurious --native warning when set via env var (#611)

* fix: suppress spurious --native warning when set via env var

When AGENT_BROWSER_NATIVE=1 is set via environment variable, every
command after the first would warn:

  ⚠ --native ignored: daemon already running.

This is a false positive — the daemon was already spawned in native
mode and inherited the env var. The warning should only fire when
--native is explicitly passed on the CLI to an already-running daemon.

Add cli_native flag (consistent with existing cli_* pattern) to
distinguish CLI origin from env var origin.

* fix: add flag to test cfg

* fix: cli_native should track flag presence, not value

--native false on CLI should still warn when daemon is already
running, since the user is explicitly trying to change the mode.
This commit is contained in:
Li Yang
2026-03-04 00:17:14 -06:00
committed by GitHub
parent 7edc5d596c
commit eaa968e229
3 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -463,7 +463,7 @@ fn main() {
flags.ignore_https_errors.then_some("--ignore-https-errors"),
flags.cli_allow_file_access.then_some("--allow-file-access"),
flags.cli_download_path.then_some("--download-path"),
flags.native.then_some("--native"),
flags.cli_native.then_some("--native"),
]
.into_iter()
.flatten()