Files
DeepTutor/web
Bingxi Zhao (Frank) c600a507a4 fix(tests): stop the partner suite writing to the real account store
`identity` binds `AUTH_DIR = SYSTEM_ROOT / "auth"` at import, so the
partners fixture's `setattr(paths, "SYSTEM_ROOT", tmp)` never reached it:
`save_user` wrote into the developer's own `data/system/auth/users.json`
and read it back. The suite had already deposited an `alice` account
there.

That also made `test_a_linked_sender_gets_their_own_private_history`
depend on who else happened to have an account. The first account in a
store is force-promoted to admin whatever role is asked for, and an
admin's scope *is* the shared pool — so on an empty store alice became
admin and "her private history" and "the shared pool" resolved to one
directory. It passed on a machine with existing accounts and on a full
run, and failed alone and on all four Python versions in CI (v1.5.17's
release commit is red for exactly this).

The fixture now redirects identity's file constants too, and `alice` is
saved after an admin so she is guaranteed non-admin — asserted, so the
precondition cannot rot silently. Product code is unaffected: the
behaviour under test was always correct.

Also collapses the three copies of the api_key reduction into one.
`_primary_api_key` (provider_runtime) is deleted and
`LLMConfig.get_api_key` delegates, both to `keypool.primary_api_key`,
which now treats an empty key as absent in either spelling so its list
and scalar branches agree. Equivalence checked across every configured
shape: "", None, [], [""], ["", "k"], "k", ["k"], ["k1", "k2"].

pytest 5284 passed (was 5276), pre-commit clean, ruff check + format
clean at CI's pinned 0.16.0.
2026-08-25 10:20:26 +08:00
..
2026-08-25 02:24:35 +08:00
2026-08-25 02:24:35 +08:00
2026-08-20 14:15:53 +08:00
2026-01-23 01:42:25 +08:00
2026-07-31 00:25:48 +08:00
2026-08-25 02:24:35 +08:00
2026-08-25 02:24:35 +08:00
2026-06-17 00:56:27 +08:00
2025-12-28 23:45:41 +08:00
2025-12-28 23:45:41 +08:00
2026-08-02 13:07:32 +08:00
2026-05-08 02:36:24 +08:00
2026-08-19 17:34:52 +08:00
2026-08-19 17:34:52 +08:00
2025-12-28 23:45:41 +08:00
2026-08-02 13:07:32 +08:00