Improve dev Docker reload, account token/session handling, and Vercel sync#7
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d67b64633b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| def _create_session(token: str) -> dict: | ||
| headers = {**BASE_HEADERS, "authorization": f"Bearer {token}"} | ||
| try: | ||
| session_resp = cffi_requests.post( | ||
| DEEPSEEK_CREATE_SESSION_URL, |
There was a problem hiding this comment.
Import cffi_requests before use in account validation
The new _create_session helper inside validate_single_account calls cffi_requests.post(...), but this function doesn’t import cffi_requests (the only import is inside test_account_api). When /accounts/validate or /accounts/validate-all hits this path, it will raise NameError: name 'cffi_requests' is not defined, breaking admin account validation entirely. You need to import curl_cffi.requests at module scope or inside validate_single_account before using it.
Useful? React with 👍 / 👎.
Motivation
Description
docker-compose.dev.ymlto runuvicornexplicitly with--reload/--reload-dirand change the config mount to writable so local edits toconfig.jsonpersist in the container.routes/admin/accounts.pyto: use a shared_create_sessionhelper that callsDEEPSEEK_CREATE_SESSION_URLand closes responses, detect token-invalid conditions (401/403, specific biz codes, or "token/unauthorized" messages), clear stale tokens, attemptlogin_deepseek_via_accountand re-verify session, and return clearer failure messages; also ensure headers are available for subsequent PoW and completion requests.VercelSynccomponent (webui/src/components/VercelSync.jsx) to send the computedtokenToUse(preconfigured token sentinel) to the backend instead of the rawvercelTokeninput.Testing
Codex Task