089f09fa5f
When _api_key_passes_startup_guard() rejects the key (missing, placeholder/too short, or fail-closed unverifiable strength), connect() returned a bare False with no fatal-error info. gateway.run's reconnect watcher treats that as transient and re-queues with backoff forever — each retry re-instantiating the adapter and its ResponseStore sqlite connection. Observed in production (#37011): ~501 leaked connections (1002 fds) over ~2.5 days until EMFILE made the whole gateway unresponsive. Set a non-retryable fatal error (api_server_key_invalid) in connect() when the guard rejects, covering all three rejection branches, so the platform drops from the reconnect queue; recover with `/platform resume api_server` after fixing the key. Same treatment as the port-conflict guard (api_server_port_in_use, #65665 /bda8bd76a8). Tests mirror the port-conflict precedent: each rejection path asserts connect() is False, has_fatal_error True, fatal_error_retryable False, and fatal_error_code api_server_key_invalid, plus a strong-key control. Re-implementation of #38803 by @cifangyiquan against current main — their patch targeted the old inline guard in connect() which was since extracted to _api_key_passes_startup_guard() (and gained the fail-closed branch in683059feb5), so the original diff no longer applies. Their production diagnosis and non-retryable direction preserved. Refs: #38803, #37011
Contributor email → GitHub login mappings
This directory replaces appending entries to AUTHOR_MAP in
scripts/release.py. The old dict caused constant merge conflicts when
several salvage PRs landed at once — every PR edited the same lines of the
same file. Here, each mapping is its own file, and file additions never
conflict.
Adding a mapping
One file per commit-author email, under emails/:
python3 scripts/add_contributor.py <email> <github-login>
# or by hand:
echo "<github-login>" > contributors/emails/<email>
- File name = the exact commit-author email (as shown by
git log --format='%ae'). - File content = the GitHub login on the first non-comment line.
Lines starting with
#are comments (use them for the PR reference).
Example — contributors/emails/jane.doe@example.com:
janedoe
# PR #12345 salvage (gateway: fix session key routing)
Rules
- Do NOT add new entries to
AUTHOR_MAPinscripts/release.py. That dict is frozen legacy data; the release tooling merges it with this directory (directory entries win on duplicates). - GitHub noreply emails (
<id>+<login>@users.noreply.github.comand<login>@users.noreply.github.com) auto-resolve — no file needed. - The
Contributor Attribution CheckCI job fails a PR whose commits carry an unmapped email; the failure message prints the exact command to run.