Skip to content
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6514fc7
feat(banked-reset): initial commit
huzky-v Jun 17, 2026
142514b
ui adjustments
huzky-v Jun 17, 2026
144855d
review
huzky-v Jun 18, 2026
75a8ae5
ui adjustments
huzky-v Jun 18, 2026
77560b6
feat(banked-reset): add api for query and redeem the credit (not in c…
huzky-v Jun 19, 2026
75002fd
fix api to get all redeemable credit
huzky-v Jun 19, 2026
10f685b
ty & ruff
huzky-v Jun 19, 2026
433b956
review
huzky-v Jun 19, 2026
7bf987c
fix(reset-credits): invalidate stale snapshots for ineligible accounts
huzky-v Jun 19, 2026
8973159
fix(reset-credits): critical consume hardening and zero-db migration …
ellentane Jun 21, 2026
cebee84
fix(test): mock timers to prevent input-otp leaks in auth-gate
ellentane Jun 21, 2026
753e45f
fix(web): add space between datetime and countdown in reset credit di…
ellentane Jun 21, 2026
6062e6c
chore(web): remove auto-generated package-lock.json
ellentane Jun 21, 2026
3c37785
fix(api): address codex review findings for rate limit reset credits
ellentane Jun 21, 2026
7746ffc
Align reset-credit eligibility and confirmation-dialog specs with cur…
huzky-v Jun 22, 2026
3219de4
Disable default retries for reset credit redemption
huzky-v Jun 22, 2026
c8c4c2d
fix(reset-credits): stop status writes on 401, suppress stale reauth …
huzky-v Jun 22, 2026
99b9eb5
Treat false force-refresh results as failures
huzky-v Jun 22, 2026
fd02a54
Fix reset-credit consume audit and refresh cache invalidation
huzky-v Jun 22, 2026
f84d3cd
Clear skipped account snapshots before they can be reused
huzky-v Jun 22, 2026
acfa251
Invalidate stale reset-credit cache on empty fresh fetch
huzky-v Jun 22, 2026
a3c79c9
ruff & ty
huzky-v Jun 22, 2026
4d5f43a
ruff
huzky-v Jun 22, 2026
ed5f5de
Refresh usage after v1 reset-credit redemption
huzky-v Jun 22, 2026
dd35115
Refresh account tokens before redeeming reset credits
huzky-v Jun 22, 2026
67b0a32
Handle refresh failures before redeeming reset credits
huzky-v Jun 22, 2026
2bc574a
Preserve successful reset-credit redemption response
huzky-v Jun 22, 2026
80be8a6
ruff
huzky-v Jun 22, 2026
b738dca
Gate dashboard redemption on cached snapshot
huzky-v Jun 22, 2026
5c4722b
ruff
huzky-v Jun 22, 2026
6832cdc
docs: add @ellentane as a contributor
huzky-v Jun 22, 2026
ffd5102
fix reset-credit eligibility and confirm dialog closing
huzky-v Jun 22, 2026
6fd64f4
Keep reset-credit GET cache-only
huzky-v Jun 22, 2026
6bf30df
Revert " Keep reset-credit GET cache-only"
huzky-v Jun 22, 2026
0c6eaa1
Serialize reset-credit redemption across replicas
huzky-v Jun 22, 2026
ec3b169
Re-select credits from the fresh upstream snapshot
huzky-v Jun 23, 2026
16472dc
Treat null reset-credit details as unavailable
huzky-v Jun 23, 2026
888c382
Preserve skipped reset-credit snapshots and clear stale v1 conflicts
huzky-v Jun 23, 2026
47d0757
Fix reset-credit background session reentry deadlocks
huzky-v Jun 23, 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 @@ -766,6 +766,16 @@
"code",
"test"
]
},
{
"login": "ellentane",
"name": "Jonáš Sivek",
"avatar_url": "https://avatars.githubusercontent.com/u/70338266?v=4",
"profile": "https://github.com/ellentane",
"contributions": [
"code",
"test"
]
}
],
"contributorsPerLine": 7,
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,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>
</tr>
</tbody>
</table>
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