Repository navigation
feat(qwenwork): daily free-credit check-in for CN and Global - #376
Merged
caigee-cmd merged 1 commit intoOct 24, 2026
Merged
Conversation
Register QwenWork CN and Global in the shared check-in framework and implement the provider's Checkin: try the desktop growth-card claim API first (/sash/api/v1/me/daily-check-in/status + /claim), then confirm the server-side daily grant when the gateway does not route that prefix. CN reads /api/v1/adapter/user/wallets and reports the granted daily credits (00:00 Asia/Shanghai refresh). Global has no per-day wallet endpoint, so it reports the claim-route gap and the account-context quota instead of a fake success. Manual and scheduled check-ins share the existing per-account and provider-time settings.
caigee-cmd
reviewed
Oct 24, 2026
caigee-cmd
left a comment
Owner
There was a problem hiding this comment.
审核结论:建议合(CI 全绿),带两点备注
架构正确:接入现有 Checkin / CheckinPolicy,无新页面;claim 优先、生产 /sash 404 再走钱包/额度兜底,不伪造成功。测试覆盖和 live 说明都够用。
备注(非阻塞)
- CN 钱包余额为 0 →
skipped:skipped不是error,当天不会再进调度(含 21:00 重试)。若自动签到时间偏早、日额度尚未到账,会整日卡住。现状可接受(与「花光 vs 未到账」不可分有关),建议用户侧默认时间偏后,或后续再考虑「尚未到账」允许同日重试。 - CN
already的RewardCredits:填的是钱包日额度剩余,不是「本次领取量」;控制台若不展示该字段则无感。
Global 长期只能 skipped + 原因文案,符合当前上游;每天记一条 skip 即可,不会刷爆。
未发现安全/密钥泄露问题。未 merge,等维护者点头。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds QwenWork (千问办公) CN and Global to the shared check-in framework: account-card manual check-in, off-by-default automatic check-in, history, and the existing provider-level/account-level schedule settings. No new page, no provider-specific console code.
The provider's
Checkinfirst calls the desktop client's growth-card claim API, then falls back to confirming the server-granted daily credits when that route is absent.What the upstream actually exposes
Facts gathered from the installed desktop bundles, the app's config-service log, and live calls with real accounts:
GET /sash/api/v1/me/daily-check-in/statusandPOST /sash/api/v1/me/daily-check-in/claimout/main/main.jsin both bundles (global 1.0.4, CN 1.4.0):DAILY_CHECK_IN_STATUS_PATH,DAILY_CHECK_IN_CLAIM_PATH, statusesCLAIMABLE/CLAIMED_TODAY/DISABLED/NOT_STARTED/ENDED, resultsCLAIMED/ALREADY_CLAIMEDoperations/announcement:credits-growth-cardcheckinEnabled, IPCoperation:credits-growth-card:claim-checkinDispatch null on initial sync for opt-in registration with no remote value {"namespace":"operations","key":"announcement:credits-growth-card"}/sashpathgateway.qwenwork.aiandgateway.qwenwork.cnwith (a) a valid device bearer, (b) a garbage bearer, (c) a full COSY-signed request: all404, empty bodyGET /api/v1/adapter/user/wallets→daily_credits.total_balance = 100, walletvalid_to = 2026-10-25T00:00:00+08:00; CN client copy:今日已获得 {{credits}} 免费积分 / 每日 0 点刷新GET /api/v1/adapter/user/wallets→ 404 on the global gateway; account-context returns onlyquota.remaining(700 = 500 signup + 200 daily on the test account)So today there is no claimable campaign in either region: the claim route is not deployed, and the credits are issued by the server. The implementation reports what the API can actually prove instead of inventing a success.
Behaviour
CLAIMABLE, claim returnsCLAIMEDsuccesswith+N 积分rewardALREADY_CLAIMEDalreadyCLAIMED_TODAYalready, with streak/reward when reportedDISABLED/NOT_STARTED/ENDEDskippedwith the matching reasonalready+每日免费积分已到账 +N(每日 0 点刷新)and the reward amountskipped+今日每日免费积分尚未到账(每日 0 点刷新)(a spent balance and an unissued balance cannot be told apart)skipped+签到接口未开放(上游 404);每日登录奖励由服务端自动发放,当前剩余额度 Nauthentication failed), so the account surfaces as failed rather than claimedThe per-account
checkinRunningguard,RecordCheckin, local-day short-circuit, and quota refresh are the existing runtime paths, unchanged.Files
internal/providers/qwenwork/checkin.go— claim flow, status mapping, CN wallet fallback, global quota fallback, desktop growth-card headers.internal/providers/qwenwork/credential.go,client.go—Regionon the site record,Checkinon the adapter.internal/providers/registry.go—CheckinPolicy(Asia/Shanghai) on both QwenWork regions.internal/providers/qwenwork/checkin_test.go,registry_test.go,client_test.go— new coverage and the updated adapter-capability assertion.README.md,README_EN.md,changelog/unreleased/qwenwork-daily-checkin.md— user-facing notes.No frontend change, so
internal/webui/staticis untouched andnpm run syncis not needed.Tests
CI-equivalent run on Linux (golang:1.25 container, mounted checkout):
New unit tests cover: claim success,
CLAIMED_TODAYwith and without reward,ALREADY_CLAIMED, the three closed campaign states, CN wallet grant, CN zero balance, global closed-campaign message, authentication failure on status and wallet, claim HTTP error, unexpected claim result, and the registry policy.On Windows the same suite still reports the failures that upstream
mainalready has on that host (internal/api,internal/executor,internal/providers/qoder,internal/runtime,internal/store); I reproduced the identical list on a cleanorigin/mainworktree, andinternal/providers/qwenworkpasses there.Live verification
Isolated instance (separate build,
QODER_DATA_DIR,PORT, read-only copy of the live database trimmed to the two QwenWork accounts). The production container, its volume, and its accounts were not modified.Manual check-in on 2026-10-24 00:15 +08:00, and again through the scheduler at 00:15 with
auto_checkin=1,checkin_time=00:01:already,每日免费积分已到账 +100(每日 0 点刷新); wallet still reportsdaily_credits = 100expiring at the next 00:00.skipped,签到接口未开放(上游 404);每日登录奖励由服务端自动发放,当前剩余额度 700.checkin_recordsrows and refreshed the stored quota (fetched_atmoved with the check-in).Known limitation
The Global daily 200 cannot be confirmed per day through any endpoint I could find: the claim route is not routed and
/api/v1/adapter/user/walletsexists only on CN. The global path therefore records a skip with the reason and the current quota rather than claiming a grant it cannot see. If the campaign is enabled later, the claim branch already implements the desktop protocol and needs no change.No credentials, tokens, host IPs, or account identifiers are included in the diff, tests, or logs above.