Skip to content

Improve dev Docker reload, account token/session handling, and Vercel sync#7

Merged
CJackHwang merged 1 commit intomainfrom
codex/review-pr-for-docker-compatibility
Feb 4, 2026
Merged

Improve dev Docker reload, account token/session handling, and Vercel sync#7
CJackHwang merged 1 commit intomainfrom
codex/review-pr-for-docker-compatibility

Conversation

@CJackHwang
Copy link
Owner

Motivation

  • 让本地开发容器支持 uvicorn 热重载并允许在容器中可修改配置文件以便调试与快速迭代。
  • 修复管理员侧账号验证/测试在遇到过期/无效 token 时未正确刷新或重试登录导致的误判与失败。
  • 在 Vercel 同步功能中支持使用预配置的 Vercel token(当页面未输入 token 时使用后端预配置)。

Description

  • Update docker-compose.dev.yml to run uvicorn explicitly with --reload/--reload-dir and change the config mount to writable so local edits to config.json persist in the container.
  • Rework account validation and testing in routes/admin/accounts.py to: use a shared _create_session helper that calls DEEPSEEK_CREATE_SESSION_URL and closes responses, detect token-invalid conditions (401/403, specific biz codes, or "token/unauthorized" messages), clear stale tokens, attempt login_deepseek_via_account and re-verify session, and return clearer failure messages; also ensure headers are available for subsequent PoW and completion requests.
  • Fix the web UI VercelSync component (webui/src/components/VercelSync.jsx) to send the computed tokenToUse (preconfigured token sentinel) to the backend instead of the raw vercelToken input.

Testing

  • No automated tests were run on these changes.

Codex Task

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment Feb 4, 2026 5:26am

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +45 to +49
def _create_session(token: str) -> dict:
headers = {**BASE_HEADERS, "authorization": f"Bearer {token}"}
try:
session_resp = cffi_requests.post(
DEEPSEEK_CREATE_SESSION_URL,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@CJackHwang CJackHwang merged commit 16ea6b7 into main Feb 4, 2026
3 checks passed
@CJackHwang CJackHwang deleted the codex/review-pr-for-docker-compatibility branch February 4, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant