Files
plugins/packages/orcaterm/package.json
T
yetone 1dfdec29dc orcaterm 0.1.4: renew the WeChat token 90 minutes before it expires (#675)
orinsid measured that OrcaTerm drops the OAuth session together with an
expired 2h access token: OAuthRefreshToken then answers SESSION_EXPIRED
for good. The plugin declared no auth.refreshLead, so magpie's host
renewed only when the account was used in the token's last 5 minutes,
and an account idle past that had to scan again. auth.refreshLead is now
90 minutes (what orinsid's local patch ran for 40+ hours with no expiry):
any request or usage read in the last 90 minutes renews it.

Not changed: magpie's host renews only when something uses the account
(host.js fresh(): loader, models, usage, checkin). An account nothing
touches for the whole two hours still expires; that is the host's to fix.

Run at this head, on mote: packages/orcaterm bun test, 113 pass 0 fail
(11 files, renew.test.mjs new); bun scripts/check.mjs exit 0.
Broken by hand: refreshLead commented out, renew.test.mjs goes 2 fail
1 pass (the hourly-use case and the lead-as-said case).
Not tried: a real WeChat sign-in left idle across an expiry.
2026-11-03 20:15:41 +08:00

21 lines
1.4 KiB
JSON

{
"name": "@magpie-community/opencode-orcaterm-auth",
"version": "0.1.4",
"description": "OrcaTerm (Tencent Cloud 遨驰终端) AI quota as an OpenAI-compatible provider for magpie and OpenCode",
"type": "module",
"main": "./opencode.mjs",
"exports": { ".": "./opencode2.mjs" },
"files": ["index.mjs", "opencode.mjs", "opencode2.mjs", "wechat.mjs", "README.md", "LICENSE"],
"keywords": ["opencode", "opencode-plugin", "magpie", "orcaterm", "tencent"],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/orcaterm"
},
"magpie": {
"maxConcurrency": 1,
"icon": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='1' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%231C74C7'/%3E%3Cstop offset='.55' stop-color='%238870FF'/%3E%3Cstop offset='1' stop-color='%23FEAECB'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23a)' d='M56 54c-7-12.5-26.2-13.2-35.5-22.5C14.4 25.2 14 16.4 16.7 11 19.5 5.3 25.9 1 33.1 1c2.7 0 8 1 11 3 14.1 9.4 18 22.7 19.6 28.5 1.6 5.8 1.5 14.5-7.7 21.5z'/%3E%3Cpath fill='url(%23a)' opacity='.85' d='M86.2 58C78.2 75.5 48.2 70.5 33.2 64 20.6 66.3 15.2 72 15.2 81c0 9.5 6.2 17.4 15.5 18.5 9.3 1.1 22.6-5.5 33-14 9-7.4 19.8-17.6 22.5-27.5z'/%3E%3C/svg%3E"
}
}