tsugite-codex-cli 0.19.1__tar.gz → 0.20.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: tsugite-codex-cli
3
- Version: 0.19.1
3
+ Version: 0.20.0
4
4
  Summary: Tsugite plugin: ChatGPT subscription auth via Codex CLI token store
5
5
  Author: Justyn Shull
6
6
  Requires-Python: >=3.11
7
- Requires-Dist: tsugite-cli==0.19.1
7
+ Requires-Dist: tsugite-cli==0.20.0
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "tsugite-codex-cli"
3
- version = "0.19.1"
3
+ version = "0.20.0"
4
4
  description = "Tsugite plugin: ChatGPT subscription auth via Codex CLI token store"
5
5
  authors = [{ name = "Justyn Shull" }]
6
6
  requires-python = ">=3.11"
7
7
  dependencies = [
8
- "tsugite-cli==0.19.1",
8
+ "tsugite-cli==0.20.0",
9
9
  ]
10
10
 
11
11
  [project.entry-points."tsugite.providers"]
@@ -21,6 +21,9 @@ API_BASE = "https://chatgpt.com/backend-api/codex"
21
21
  _REASONING_LEVELS = ["low", "medium", "high"]
22
22
  # gpt-5.5 added xhigh; older codex models don't accept it.
23
23
  _REASONING_LEVELS_V5_5 = ["low", "medium", "high", "xhigh"]
24
+ # gpt-5.6 added max, and its sol/terra tiers also accept ultra (delegating).
25
+ _REASONING_LEVELS_V5_6 = [*_REASONING_LEVELS_V5_5, "max"]
26
+ _REASONING_LEVELS_V5_6_AGENTIC = [*_REASONING_LEVELS_V5_6, "ultra"]
24
27
 
25
28
 
26
29
  def _codex_model_info(max_input_tokens: int, effort_levels: list[str] = _REASONING_LEVELS) -> ModelInfo:
@@ -36,11 +39,16 @@ def _codex_model_info(max_input_tokens: int, effort_levels: list[str] = _REASONI
36
39
  )
37
40
 
38
41
 
42
+ # Context windows are the `context_window` the backend reports for the
43
+ # subscription path, which is smaller than the same model's API tier. Not
44
+ # `max_context_window`, which some slugs report as 1M.
39
45
  _CODEX_CLI_MODELS: dict[str, ModelInfo] = {
40
- "codex_cli/gpt-5.5": _codex_model_info(1_050_000, effort_levels=_REASONING_LEVELS_V5_5),
41
- "codex_cli/gpt-5.4": _codex_model_info(1_050_000),
46
+ "codex_cli/gpt-5.6-sol": _codex_model_info(272_000, effort_levels=_REASONING_LEVELS_V5_6_AGENTIC),
47
+ "codex_cli/gpt-5.6-terra": _codex_model_info(272_000, effort_levels=_REASONING_LEVELS_V5_6_AGENTIC),
48
+ "codex_cli/gpt-5.6-luna": _codex_model_info(272_000, effort_levels=_REASONING_LEVELS_V5_6),
49
+ "codex_cli/gpt-5.5": _codex_model_info(272_000, effort_levels=_REASONING_LEVELS_V5_5),
50
+ "codex_cli/gpt-5.4": _codex_model_info(272_000),
42
51
  "codex_cli/gpt-5.4-mini": _codex_model_info(272_000),
43
- "codex_cli/gpt-5.4-nano": _codex_model_info(272_000),
44
52
  }
45
53
 
46
54
  # Used when /models is unreachable; kept in sync with the registry above.
@@ -339,7 +347,11 @@ class CodexCliProvider:
339
347
  headers=self._build_headers(access_token, account_id),
340
348
  )
341
349
  resp.raise_for_status()
342
- return [m["id"] for m in resp.json().get("data", [])]
350
+ # The Codex backend answers {"models":[{"slug":...}]}, not the OpenAI
351
+ # {"data":[{"id":...}]} shape. `visibility: hide` marks special-purpose
352
+ # entries (auto-review, watermark variants) the CLI keeps out of its
353
+ # own picker, so they stay out of ours too.
354
+ return [m["slug"] for m in resp.json()["models"] if isinstance(m, dict) and m.get("visibility") != "hide"]
343
355
  except (httpx.HTTPError, KeyError, ValueError, CodexAuthError):
344
356
  return list(_FALLBACK_MODELS)
345
357