subs-pool
Copyright 2026 the subs-pool contributors

This product includes software adapted from the LingTai kernel
(`src/lingtai/auth/codex.py` and
`src/lingtai/llm/openai/codex_quota.py`) and the LingTai TUI
(`internal/tui/oauth.go`), licensed under the Apache License, Version 2.0.
The adapted files live at `src/subs_pool/modules/codex/auth_codex.py`,
`src/subs_pool/modules/codex/quota.py`, and
`src/subs_pool/modules/codex/device_login.py`; each carries its own header
pointing back here.

`src/subs_pool/modules/codex/upstream.py`'s Codex cache-affinity request metadata (the
underscored `session_id`/`thread_id` header names and the
`x-codex-turn-metadata` JSON shape) reproduces wire-protocol facts read from
the same LingTai kernel's `src/lingtai/llm/openai/adapter.py`
(`_cache_affinity_headers` / `_codex_metadata_headers`). No source code from
that file was copied; only the documented field names/shapes needed to speak
the same upstream wire protocol were reimplemented independently, with
the Codex module's own honest legacy `codex-pool` client identity (never
LingTai's or the official Codex CLI's). That protocol identity is intentionally
retained during the Python distribution rename to preserve verified behavior.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
