Skip to content
Open
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
266fa1f
feat(banked-reset): initial commit
huzky-v Jun 17, 2026
5240437
ui adjustments
huzky-v Jun 17, 2026
2bb8041
review
huzky-v Jun 18, 2026
618d5d3
ui adjustments
huzky-v Jun 18, 2026
6d3ffa5
feat(banked-reset): add api for query and redeem the credit (not in c…
huzky-v Jun 19, 2026
46b8eab
fix api to get all redeemable credit
huzky-v Jun 19, 2026
065cb11
ty & ruff
huzky-v Jun 19, 2026
004bdbf
review
huzky-v Jun 19, 2026
98d0c9d
fix(reset-credits): invalidate stale snapshots for ineligible accounts
huzky-v Jun 19, 2026
676efef
fix(reset-credits): critical consume hardening and zero-db migration …
ellentane Jun 21, 2026
3af1157
fix(test): mock timers to prevent input-otp leaks in auth-gate
ellentane Jun 21, 2026
c1e745f
fix(web): add space between datetime and countdown in reset credit di…
ellentane Jun 21, 2026
ead182e
chore(web): remove auto-generated package-lock.json
ellentane Jun 21, 2026
109e607
fix(api): address codex review findings for rate limit reset credits
ellentane Jun 21, 2026
1d6aa58
Align reset-credit eligibility and confirmation-dialog specs with cur…
huzky-v Jun 22, 2026
a84d99a
Disable default retries for reset credit redemption
huzky-v Jun 22, 2026
e00b77d
fix(reset-credits): stop status writes on 401, suppress stale reauth …
huzky-v Jun 22, 2026
93ca7a1
Treat false force-refresh results as failures
huzky-v Jun 22, 2026
b869f07
Fix reset-credit consume audit and refresh cache invalidation
huzky-v Jun 22, 2026
b372211
Clear skipped account snapshots before they can be reused
huzky-v Jun 22, 2026
534b3a2
Invalidate stale reset-credit cache on empty fresh fetch
huzky-v Jun 22, 2026
1b76b6c
ruff & ty
huzky-v Jun 22, 2026
a58fc83
ruff
huzky-v Jun 22, 2026
b40cfc6
Refresh usage after v1 reset-credit redemption
huzky-v Jun 22, 2026
4c41417
Refresh account tokens before redeeming reset credits
huzky-v Jun 22, 2026
9e58483
Handle refresh failures before redeeming reset credits
huzky-v Jun 22, 2026
8225182
Preserve successful reset-credit redemption response
huzky-v Jun 22, 2026
304a5c7
ruff
huzky-v Jun 22, 2026
49a72bd
Gate dashboard redemption on cached snapshot
huzky-v Jun 22, 2026
adb1248
ruff
huzky-v Jun 22, 2026
faed33a
docs: add @ellentane as a contributor
huzky-v Jun 22, 2026
e4beeed
fix reset-credit eligibility and confirm dialog closing
huzky-v Jun 22, 2026
bff2bb5
Keep reset-credit GET cache-only
huzky-v Jun 22, 2026
578326c
Revert " Keep reset-credit GET cache-only"
huzky-v Jun 22, 2026
fa459a2
Serialize reset-credit redemption across replicas
huzky-v Jun 22, 2026
709168d
Re-select credits from the fresh upstream snapshot
huzky-v Jun 23, 2026
882bf4f
Treat null reset-credit details as unavailable
huzky-v Jun 23, 2026
7840049
Preserve skipped reset-credit snapshots and clear stale v1 conflicts
huzky-v Jun 23, 2026
bee8646
feat(dashboard): add reset count bubble on the account list
huzky-v Jun 26, 2026
48b9500
Badge Validate the redeem id before resolving proxy route
huzky-v Jun 26, 2026
705a48d
Keep dashboard detail GET cache-only
huzky-v Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,16 @@
"test"
]
},
{
"login": "ellentane",
"name": "Jonáš Sivek",
"avatar_url": "https://avatars.githubusercontent.com/u/70338266?v=4",
"profile": "https://github.com/ellentane",
"contributions": [
"code",
"test"
]
},
{
"login": "rupebac",
"name": "Rubén Pérez Bachiller",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/e
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3crosis"><img src="https://avatars.githubusercontent.com/u/11072158?v=4?s=100" width="100px;" alt="n3crosis"/><br /><sub><b>n3crosis</b></sub></a><br /><a href="https://github.com/Soju06/codex-lb/commits?author=n3crosis" title="Code">💻</a> <a href="https://github.com/Soju06/codex-lb/commits?author=n3crosis" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/copilot"><img src="https://github.com/copilot.png?s=100" width="100px;" alt="copilot"/><br /><sub><b>copilot</b></sub></a><br /><a href="https://github.com/Soju06/codex-lb/commits?author=copilot" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/geoHeil"><img src="https://avatars.githubusercontent.com/u/1694964?v=4?s=100" width="100px;" alt="geoHeil"/><br /><sub><b>geoHeil</b></sub></a><br /><a href="https://github.com/Soju06/codex-lb/commits?author=geoHeil" title="Code">💻</a> <a href="https://github.com/Soju06/codex-lb/commits?author=geoHeil" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ellentane"><img src="https://avatars.githubusercontent.com/u/70338266?v=4?s=100" width="100px;" alt="Jonáš Sivek"/><br /><sub><b>Jonáš Sivek</b></sub></a><br /><a href="https://github.com/Soju06/codex-lb/commits?author=ellentane" title="Code">💻</a> <a href="https://github.com/Soju06/codex-lb/commits?author=ellentane" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/WangErgouaaaa"><img src="https://avatars.githubusercontent.com/u/117421439?v=4?s=100" width="100px;" alt="Guanwei Chen"/><br /><sub><b>Guanwei Chen</b></sub></a><br /><a href="https://github.com/Soju06/codex-lb/commits?author=WangErgouaaaa" title="Code">💻</a> <a href="https://github.com/Soju06/codex-lb/commits?author=WangErgouaaaa" title="Tests">⚠️</a></td>
</tr>
</tbody>
Expand Down
29 changes: 29 additions & 0 deletions app/core/clients/headers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from __future__ import annotations

from app.core.utils.request_id import get_request_id


def build_chatgpt_auth_headers(
access_token: str,
account_id: str | None,
*,
extra: dict[str, str] | None = None,
) -> dict[str, str]:
"""Build the headers required to call ChatGPT ``backend-api`` endpoints.

Includes the OAuth bearer token and the ``chatgpt-account-id`` header. The
account-id header is omitted when the id is a synthetic ``email_``/``local_``
prefix, matching upstream behavior. An active request id (if any) is attached.
"""
headers: dict[str, str] = {
"Authorization": f"Bearer {access_token}",
"Accept": "application/json",
}
request_id = get_request_id()
if request_id:
headers["x-request-id"] = request_id
if account_id and not account_id.startswith(("email_", "local_")):
headers["chatgpt-account-id"] = account_id
if extra:
headers.update(extra)
return headers
Loading