Commit Graph
2 Commits
Author SHA1 Message Date
yetone c47fc516a4 provider: Tencent Cloud's Token Plan is at tokenhub.tencentmaas.com/plan (ysm119)
ysm119 (Discord) showed Tencent's docs: Token Plan's OpenAI base is now
https://tokenhub.tencentmaas.com/plan/v3 and the Anthropic one on
tokenhub.tencentmaas.com is the recommended one, with
api.lkeap.cloud.tencent.com marked as going away.

Tencent's current pages (product/1823/130060 个人版 overview, 130070
Claude Code, 130071 Codex, 130119 quickstart, 136601 CC Switch, all
updated 10-15 to 10-22) give 个人版 the same endpoints as 企业版 China
(130659): chat/responses at https://tokenhub.tencentmaas.com/plan/v3,
messages at https://tokenhub.tencentmaas.com/plan/anthropic, one sk-tp-
key for 通用 and Hy plans.

- The tencent-cloud preset's plan region (and the preset default) are
  at those endpoints, with Responses added (Codex's page uses
  wire_api "responses"). magpie tells regions apart by endpoint, so the
  personal and China enterprise regions, now one address, are one:
  "plan", models the union of both lists. "enterprise" stays an alias
  (regionAliases, RegionID): a key saved on it, an import link with
  region=enterprise and `region=enterprise` on the CLI land on plan.
  Singapore 企业版 (enterprise-intl) is unchanged.
- A Tencent Cloud provider saved at the old lkeap /plan/v3 or
  /plan/anthropic is moved to TokenHub at load (moveEndpoints in
  normalize), and gains the Responses endpoint when it had chat. A
  Responses address the user set stays. A provider of no preset (a
  custom one the user typed lkeap into) keeps its address: that is the
  user's value, and lkeap still answers today.
- An app config still at lkeap (Tencent's OpenClaw page, 130062, still
  gives it) imports as tencent-cloud at the new endpoints.
- Usage: DescribeTokenPlan is 企业版's API (api/1823/132270 lists
  enterprise products only), and Guangzhou's endpoint now serves
  个人版 too, so a Guangzhou provider with no SecretId no longer gets the
  card asking for one (tcSharedRegion); Singapore's still does. The
  editor shows the optional SecretId/SecretKey at the plan region, so a
  personal user sees them too.
- docs/subsystems/providers-accounts.md says all of this.

Run at the pushed head's base f3551387c on mote (rebased onto
d29f02d65, which only touches internal/agent's omp; provider and cli
re-run after the rebase):
- go test -timeout 45m ./...: every package ok except three filed reds
  that touch nothing here: cli TestEveryRouteHasACommandOrIsNamed
  (#4826), gateway TestCodexPoolSaysTheClientsVersion (#4807), gui
  TestMainWindowCorners/macOS_26_SDK on macOS 27 (#3949).
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
  ./...: clean. gofmt -l: nothing.
- GUI tencent-cloud, tencent-access-key, i18n-keys (chromium+webkit,
  en/zh): 24 pass, 4 fail, all "a region clicked right after the strip
  scrolled" (#4321/#4399/#4625; app.js is unchanged here).

Broken by hand, each red then green again:
- normalize without moveEndpoints: TestTencentCloudOldPresetsKeepWorking
  and TestTencentPlanMovedFromLkeap fail.
- the import's movedEndpoints lookup: TestTencentPlanMovedFromLkeap.
- the Guangzhou card skip: TestPlanCardWithoutAccessKey.
- RegionID in ParseImport: TestTencentPlanMovedFromLkeap; in the CLI:
  TestTencentOldRegionAtCLI.

Not tried: no real Tencent key here, so no request reached either host
and no real usage read. Tencent's international personal plan (CodeBuddy
page tencentcloud.com/document/product/1300/81035) is at
tokenhub-intl.tencentcloudmaas.com, a host magpie has no region for; not
added. The 即将下线 label in ysm119's screenshot is not on the pages
fetched, and no retirement date was found (FAQ 130076). The site's
import-link builder still offers "Enterprise plan · China", which now
adds the plan through the alias.
2026-11-02 21:41:56 +08:00
yetone 23e764d0e0 cli: magpie's commands move from the root into internal/cli; the root keeps only main.go
The root held 89 .go files (30 commands, 59 tests). They move as they are
to internal/cli (package cli), with git mv so history follows them. The
only code change is main() becoming cli.Main(version): the root's new
main.go keeps `var version` in package main, so -ldflags "-X
main.version=…" in the Makefile, the Dockerfile and magpie-releases, and
every workflow, work unchanged. go-winres's rsrc_windows_*.syso still land
next to package main in the root.

Tests that read testdata by a root-relative path now go up one level
(../plugin/testdata/fake, ../sessions/testdata). Five subsystem doc links
point at internal/cli/.

Run:
- go build ./..., gofmt -l, go vet on darwin, linux and windows (nogui)
- builds with tags production, dev, "production nogui"; windows
  -H windowsgui; linux CGO_ENABLED=0
- make release-cli TARGETS="darwin/arm64 linux/amd64 windows/amd64
  android/arm64" VERSION=9.9.9-tidy: all four built, binary prints
  "magpie 9.9.9-tidy"
- docker build --build-arg VERSION=7.7.7-tidy: container prints
  "magpie 7.7.7-tidy"
- go test ./internal/cli (default and nogui): 152 tests, the same count
  as the root on main
- go test ./...: all packages pass (agent, gateway, library, provider
  timed out at 10m under other sessions' load and passed rerun alone
  with -timeout 40m; none of them changed)
- the built binary in a sandbox HOME: version, help, ls, providers,
  claude, and an unknown command's error
2026-10-12 20:40:22 +08:00