Repository navigation
lane: WorkBuddy speaks the CN publishment too, and checks in daily (rebased #89) - #93
Merged
Merged
Conversation
… daily The channel could only ever log into workbuddy.ai — wbAccountFromToken refused any other issuer outright, so a codebuddy.cn account could not be added at all. The two publishments now ride a realm table: chat on copilot.tencent.com, the billing meter on www.codebuddy.cn (a different host, which is why the meter 404'd when asked on the chat one), each with its own Origin/X-Domain/UA family. The realm is the login the user opened, unless the token's issuer names one — a silent issuer must not silently downgrade a CN account to intl. CN also earns its daily differently. intl claims it with a tiny conversation; CN has a real endpoint for it, /v2/billing/meter/ daily-checkin, which answers HTTP 400 with code 10001 once the day is claimed — so the day closes on that code too, instead of retrying hourly against a wall. The hourly tick runs whichever daily the account's realm has; the card grows a 版本 picker and a 签到 button for CN. The static free-model catalog is untouched: hy4-preview-f, hy3 and deepseek-v4.1-flash exist on both publishments. go vet ./... and go test ./... are green.
This was referenced Oct 17, 2026
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.
Replays @ghshhf's #89 onto the current master. The original went
mergeable=falseonce #90/#88/#86 landed (they touchworkbuddy_account.go,main.go,admin.go,index.html,client.go— all overlapping), so this rebases it cleanly: 8 files, +521/-47 ignoring whitespace, matching the original's +534/-60.The change itself is unchanged and well-motivated: WorkBuddy previously rejected any issuer not naming
workbuddy.ai, so a codebuddy.cn (CN publishment) account couldn't be added at all. This teaches the lane both realms — and the two publishments are genuinely different hosts (chat oncopilot.tencent.com, meter onwww.codebuddy.cn), which is why the daily CN reward is a real/checkinendpoint rather than the intl activity-conversation, and why a realm config object replaces the old single "base per channel".Conflict resolution done here:
client.go: took master (now carrying the CodeArtscaMu/caAcctfields) and inserted only thewbLoginRealmfield on top.workbuddy_test.go: kept BOTH sides — lane: the daily activity claim rides the chat envelope (#85) #88'sTestWorkBuddyDailyActivityUsesTheChatEnvelopeand this PR's CN realm tests — which is why the file's line count looked large in the raw diff but the whitespace-only diff is the true +159.Verified:
go vet+go test ./...green (all WorkBuddy tests pass, 9 cases). Smoke:/admin/api/workbuddy/statusreports the newrealm/canCheckin/lastCheckinDatefields, an un-logged-in/workbuddy/checkinreturns{ok:true,skipped:true}, dashboard JS passesnode --check.Credit: @ghshhf — rebase + conflict resolution only, the design is theirs.