2 Commits
Author SHA1 Message Date
tanzhenxin 9534a528a6 perf(cli): keep running in place when env files only hold model credentials (#12680)
* perf(cli): keep running in place when env files only hold model credentials

The env-file relaunch rule from #12602 fires for any value that `.env` files
or `settings.env` inject, including the API key that `/auth` stores and the
keys the docs recommend for `~/.qwen/.env`. Those users always paid the
second boot. Providers read credentials and endpoints per request, never
while a module loads, so `hasLoadedEnvironmentValues()` now ignores the
documented per-auth-type variables and the `envKey` of every configured
model provider. Any other injected value still forces a fresh image, and a
provider entry can never exempt a loader or boot-time key.

The DashScope proxy base URL was the one such variable read at module load;
it is now read at call time.

Reported by @wenshao in the #12622 review (F2).

Claude-Session: https://claude.ai/code/session_01163b7X4Ntw1S2pr9VrtRrs

* feat(scripts): let the startup benchmark load credentials from a file

`--credentials settings|dotenv` moves the stub's key and URL from the shell
into the settings file's `env` block or `~/.qwen/.env`, so the env-file
relaunch rule can be measured. The default stays `shell`.

Claude-Session: https://claude.ai/code/session_01163b7X4Ntw1S2pr9VrtRrs
2026-09-25 10:13:38 +00:00
tanzhenxin 78bc42b4bf feat(scripts): check in the startup benchmark harness (#12674)
Add the harness used to measure the fresh-startup work (#12622), for
manual runs: an interleaved A/B wall-clock benchmark of two builds, and
a strace-based count of the Node processes started and the JavaScript
they load at startup. It encodes the pitfalls that silently skew such
measurements. No CI gate: the interactive counts depend on timer-driven
work before the prompt, so they shift with runner speed.
2026-09-25 06:18:41 +00:00