claude-multiacc 2.0.35 → 2.0.37
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.
- package/README.md +31 -0
- package/bin/claude +68 -1
- package/bin/claude-accounts +163 -10
- package/bin/codex-accounts +23 -1
- package/lib/__pycache__/audit.cpython-312.pyc +0 -0
- package/lib/__pycache__/claude_reset.cpython-312.pyc +0 -0
- package/lib/__pycache__/codex_config_edit.cpython-312.pyc +0 -0
- package/lib/__pycache__/codex_python.cpython-312.pyc +0 -0
- package/lib/__pycache__/keychain.cpython-312.pyc +0 -0
- package/lib/__pycache__/selector_policy.cpython-312.pyc +0 -0
- package/lib/__pycache__/selector_primitives.cpython-312.pyc +0 -0
- package/lib/__pycache__/shim_path.cpython-312.pyc +0 -0
- package/lib/claude_reset.py +673 -0
- package/lib/common.sh +3 -1
- package/lib/report.py +18 -0
- package/package.json +1 -1
- package/tests/__pycache__/packaged_command_support.cpython-312.pyc +0 -0
- package/tests/__pycache__/test_claude_reset.cpython-312.pyc +0 -0
- package/tests/__pycache__/test_codex_reset.cpython-312.pyc +0 -0
- package/tests/__pycache__/test_codex_reset_polling.cpython-312.pyc +0 -0
- package/tests/__pycache__/test_codex_reset_reporting.cpython-312.pyc +0 -0
- package/tests/__pycache__/test_codex_reset_windows.cpython-312.pyc +0 -0
- package/tests/run-tests.sh +108 -0
- package/tests/test_claude_reset.py +643 -0
- package/tests/test_codex_reset.py +35 -0
|
@@ -174,6 +174,41 @@ class CodexResetIntegrationTest(CodexPoolSandbox, unittest.TestCase):
|
|
|
174
174
|
self.assertEqual(self.server.state["credit_gets"], 4)
|
|
175
175
|
|
|
176
176
|
|
|
177
|
+
class CodexResetWatermarkTest(CodexPoolSandbox, unittest.TestCase):
|
|
178
|
+
"""A redemption answers every rejection before it: bin/codex's rollout scan must not
|
|
179
|
+
re-create a park from one, whether or not a marker existed (review, 2026-09-22)."""
|
|
180
|
+
|
|
181
|
+
run_limits = CodexResetIntegrationTest.run_limits
|
|
182
|
+
|
|
183
|
+
def test_redemption_writes_the_watermark_even_without_a_marker(self) -> None:
|
|
184
|
+
now = int(time.time())
|
|
185
|
+
account = self.pool / "acct-01"
|
|
186
|
+
self.assertFalse((account / ".limited").exists())
|
|
187
|
+
(account / ".client-limit-cleared").write_text("5\n", encoding="utf-8")
|
|
188
|
+
self.server.state["usage"] = {"plan_type": "pro", "rate_limit": {"allowed": True,
|
|
189
|
+
"primary_window": {"used_percent": 96, "limit_window_seconds": 604800,
|
|
190
|
+
"reset_at": now + 86400}}}
|
|
191
|
+
self.server.state["credits"] = {"available_count": 1, "credits": [
|
|
192
|
+
{"id": "c1", "status": "available", "expires_at": "2099-01-01T00:00:00Z"}]}
|
|
193
|
+
self.server.state["responses"] = [(200, {"code": "reset", "windows_reset": 1})]
|
|
194
|
+
self.assertEqual(self.run_limits().returncode, 0)
|
|
195
|
+
mark = int((account / ".client-limit-cleared").read_text().split()[0])
|
|
196
|
+
self.assertGreaterEqual(mark, now)
|
|
197
|
+
|
|
198
|
+
def test_the_watermark_never_moves_backwards(self) -> None:
|
|
199
|
+
now = int(time.time())
|
|
200
|
+
account = self.pool / "acct-01"
|
|
201
|
+
future = now + 7200
|
|
202
|
+
(account / ".client-limit-cleared").write_text(f"{future}\n", encoding="utf-8")
|
|
203
|
+
self.server.state["usage"] = {"plan_type": "pro", "rate_limit": {"allowed": True,
|
|
204
|
+
"primary_window": {"used_percent": 96, "limit_window_seconds": 604800,
|
|
205
|
+
"reset_at": now + 86400}}}
|
|
206
|
+
self.server.state["credits"] = {"available_count": 1, "credits": []}
|
|
207
|
+
self.server.state["responses"] = [(200, {"code": "reset", "windows_reset": 1})]
|
|
208
|
+
self.assertEqual(self.run_limits().returncode, 0)
|
|
209
|
+
self.assertEqual(int((account / ".client-limit-cleared").read_text().split()[0]), future)
|
|
210
|
+
|
|
211
|
+
|
|
177
212
|
class CodexMarkerNamesOneBucketTest(CodexPoolSandbox, unittest.TestCase):
|
|
178
213
|
"""The marker's epoch is the reset of the bucket its detail line NAMES.
|
|
179
214
|
|