Skip to content

[macOS] Importing local Claude subscription fails with "Claude 订阅令牌已失效,请重新登录 Claude" #25

Description

@chanyatlap

Environment

OpenCodex 1.0.7 (also reproduced on 1.0.5; upgrading did not help)
macOS 26.5.2
Architecture arm64 (Apple Silicon)
Claude Desktop 1.24012.9 — installed, signed in, running throughout
Install method Official DMG

Description

In the subscription panel, the Claude row correctly reports 已检测到 / 本机登录态已发现,尚未导入 ("detected / local login state found, not yet imported"), so local session detection itself works.

Clicking 导入 ("Import") fails immediately with:

Claude 订阅令牌已失效,请重新登录 Claude

The 待应用模型 ("pending models") section stays empty: 尚未添加第三方模型。先保存 API Key,或导入本机订阅。

For reference, the Cursor row shows 未检测到 — correct, since Cursor is not installed on this machine.

Steps to reproduce

  1. Launch Claude Desktop and confirm it is signed in; leave it running.
  2. Open OpenCodex → subscription panel.
  3. The Claude row shows 已检测到.
  4. Click 导入.
  5. Error: Claude 订阅令牌已失效,请重新登录 Claude.

What I already tried

  • Deleted ~/.opencodex/claude_desktop_auth.json, then re-imported — same error.
  • Upgraded 1.0.5 → 1.0.7 — same error.
  • Killed all leftover gateway processes and restarted OpenCodex so only one instance was running — same error.

Claude Desktop was verified to be running and signed in for every one of the attempts above (process confirmed alive via ps for the whole session), so this does not appear to be a "not logged in" case. Detection succeeds and only the token exchange fails, which suggests the problem is in the token step rather than in session discovery.

Expected behaviour

With Claude Desktop signed in, 导入 should store the subscription and list the available Claude models under 待应用模型.

Side finding (possibly a separate bug)

Across repeated launches, the dist/server.js gateway process does not exit with the app. Three instances had accumulated, listening on ports 20517, 24963 and 23328 simultaneously. Killing them all and relaunching leaves a single healthy instance, so this is easy to work around — but the app should probably terminate its gateway child process on quit.

Notes

Happy to provide logs if you can point me at the log file location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions