tsugite-codex-cli 0.21.2__tar.gz → 0.22.1__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
1
  Metadata-Version: 2.5
2
2
  Name: tsugite-codex-cli
3
- Version: 0.21.2
3
+ Version: 0.22.1
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.21.2
7
+ Requires-Dist: tsugite-cli==0.22.1
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "tsugite-codex-cli"
3
- version = "0.21.2"
3
+ version = "0.22.1"
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.21.2",
8
+ "tsugite-cli==0.22.1",
9
9
  ]
10
10
 
11
11
  [project.entry-points."tsugite.providers"]
@@ -6,6 +6,7 @@ import asyncio
6
6
  import base64
7
7
  import json
8
8
  import os
9
+ import threading
9
10
  import time
10
11
  from pathlib import Path
11
12
 
@@ -59,12 +60,11 @@ class CodexAuthStore:
59
60
  self._home = _resolve_home(home)
60
61
  self._auth_path = self._home / "auth.json"
61
62
  self._lock_path = self._home / "auth.json.lock"
62
- self._async_lock = asyncio.Lock()
63
+ self._refresh_lock = threading.Lock()
63
64
 
64
65
  async def get_access_token(self) -> tuple[str, str]:
65
66
  """Return (access_token, account_id), refreshing if near expiry."""
66
- async with self._async_lock:
67
- return await asyncio.to_thread(self._sync_get_or_refresh)
67
+ return await asyncio.to_thread(self._sync_get_or_refresh)
68
68
 
69
69
  def _sync_get_or_refresh(self) -> tuple[str, str]:
70
70
  if not self._auth_path.exists():
@@ -73,7 +73,7 @@ class CodexAuthStore:
73
73
  # Lock the sidecar, not auth.json itself: os.replace unlinks the inode and
74
74
  # any waiter blocked on the original file descriptor would never wake.
75
75
  self._home.mkdir(parents=True, exist_ok=True)
76
- with open(self._lock_path, "a+") as lock_fh:
76
+ with self._refresh_lock, open(self._lock_path, "a+") as lock_fh:
77
77
  portalocker.lock(lock_fh, portalocker.LOCK_EX)
78
78
  try:
79
79
  os.chmod(self._lock_path, 0o600)
@@ -21,7 +21,7 @@ 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).
24
+ # gpt-5.6 added max; its sol/terra tiers and gpt-6-astra also accept ultra (delegating).
25
25
  _REASONING_LEVELS_V5_6 = [*_REASONING_LEVELS_V5_5, "max"]
26
26
  _REASONING_LEVELS_V5_6_AGENTIC = [*_REASONING_LEVELS_V5_6, "ultra"]
27
27
 
@@ -47,8 +47,7 @@ _CODEX_CLI_MODELS: dict[str, ModelInfo] = {
47
47
  "codex_cli/gpt-5.6-terra": _codex_model_info(272_000, effort_levels=_REASONING_LEVELS_V5_6_AGENTIC),
48
48
  "codex_cli/gpt-5.6-luna": _codex_model_info(272_000, effort_levels=_REASONING_LEVELS_V5_6),
49
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),
51
- "codex_cli/gpt-5.4-mini": _codex_model_info(272_000),
50
+ "codex_cli/gpt-6-astra": _codex_model_info(272_000, effort_levels=_REASONING_LEVELS_V5_6_AGENTIC),
52
51
  }
53
52
 
54
53
  # Used when /models is unreachable; kept in sync with the registry above.