34edf938da4007b4e2990c7449963a4f5be317dc
34
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4e0cdabbba |
codearts 0.3.22: OfficeAce's first rates read is tried again, and its fallback lists only callable ids (#1197)
yukinomon measured it (#1197): when the billable list's first read after a start failed, the listing fell back to OA_FALLBACK_MODELS, and 7 of its 10 ids are no longer in OfficeAce's catalog while 6 of the 9 callable ids were missing from it. The in-process cache holds no table at start, so one blip put the old list in front of the user until the next listing. - fetchOfficeAceTokenRates reads once more (after 400ms) when it has no table to keep; a network error, a non-2xx, an unparseable or an empty answer each count as a failed read. With a table held it reads once, as before. - OA_FALLBACK_MODELS is the 9 ids the reporter measured as callable (catalog ∩ rates on 2026-11-16). - With no rates table at all, the listing is the account's catalog cut to those known ids, so an id the catalog has dropped is not listed; the static table only when that leaves nothing. Run (mote, HOME=$(mktemp -d)): - bun test packages/codearts/index.test.mjs: 215 pass, 0 fail. - bun scripts/check.mjs codearts: ok. Broken by hand: origin/main's index.mjs with the new tests: 3 fail (the retry, the dropped ids, the catalog-cut fallback). Not tried: a real OfficeAce account (none here); the ids come from the reporter's measurement. |
||
|
|
a60667b570 |
codearts 0.3.21: the credit names iJetLi, who wrote the CodeArts channel (#1147)
The README (English and Chinese) and index.mjs credited the CodeArts channel to Ebony-Vinyl/dsh-our-free-model alone. That repo's own vendor/channel-pack/NOTICE.md (v2.5.7) says the channel is a copy of gitee.com/iJetLi/deepseek-harness-codearts at 345f0a07. The credit now names iJetLi first and OFM as the one that carried it. No code change. Run: bun scripts/check.mjs codearts and bun test in packages/codearts on mica (213 pass, 0 fail); bun scripts/bumped.mjs origin/main. |
||
|
|
9bca17b5d2 |
codearts 0.3.20: a body too large to sign is a 413, not an expired sign-in (#1121)
APIG signs a request body of 12 MB at most. A larger one (apple-small's long chat with 21 images, ~20 MB) came back after ~30s as 401 APIG.0301 "calc ak sk signature fail:body too large". The plugin read every such 401 as a stale credential: it renewed, then answered 401 with X-Magpie-Sign-In: expired, so magpie showed the account signed out and signing in again changed nothing. Now that answer, on chats and other requests, is a 413 saying the size and what to do (new chat, or drop the large images), with no sign-in mark and no renewal. A body over 12 MiB is refused the same way before it is signed or sent, so it doesn't wait the gateway's ~30s first. Not changed: images are not dropped or rewritten; that would change what the user sent. OfficeAce sends Basic auth, no AK/SK body signature, so it is left as is. Run: wsl-run bun test in packages/codearts, 213 pass. Broken by hand: isBodyTooLarge always false -> the 413 test red; no pre-send size check -> the 12 MB test red. scripts/check.mjs codearts ok. Not tried: a real mainland account with a 20 MB chat; the gateway's answer is the reporter's log, used byte for byte in the test. |
||
|
|
c490e2a85e |
codearts 0.3.19: the mainland station gets no stop at all (#1120)
The mainland gateway (snap-access cn-north-4) now answers every non-empty stop with InferHub.001001005.400, a string too: Glueo measured "x", "###", "\n\n", "Observation:", "</block>" and ["x"] on five models, all refused, and the same body without stop answered. 0.3.15's string-only rule (magpie#6342) no longer holds. Claude Code's auto-mode classifier always sends stop_sequences ["</block>"], so every classifier call on a mainland account was refused. normalizeStop now leaves stop out on the mainland; the international station still takes a list (#998), unchanged. Run: wsl-run bun test in packages/codearts, 211 pass. Broken by hand: main's index.mjs under the new test, 1 fail. scripts/check.mjs codearts ok. Not tried: a real mainland account here; the measurement is the reporter's. |
||
|
|
26ea8faf77 |
codearts 0.3.18: claim every daily check-in campaign, not only the first (#1110)
The delivery list holds more than one USER_LOGIN campaign: the ordinary daily check-in (34, 100), a contest's daily check-in (40, 1000, 2026-11-11 to 12-05) and the contest's one-time sign-up gift (42). dailyCampaign took the first, 42; once it was CONFIRMED the check-in answered done and claimed neither daily one. Now every USER_LOGIN campaign whose title is a daily one (签到/每日) is claimed and confirmed in turn, credit is their sum, grants and unconfirmed claims are kept per campaignId, and a campaign the account hasn't joined (not claimable, or refused with 需要先通过触发接口激活/未报名) is ineligible rather than a failed day. By @amqsy (#1110). Reviewed at ab9447b8: - WSL, HOME=$(mktemp -d): bun test in packages/codearts 211 pass; bun scripts/check.mjs codearts ok. - Broken by hand: dailyCampaigns back to the first USER_LOGIN item turns three of the new tests red. - The old single-claim _unconfirmed shape is still read. - Not tried: a real CodeArts account (the author's run on 2026-11-14 00:00 Beijing claimed +1100 on two accounts). |
||
|
|
59d1d107d0 |
codearts 0.3.17: sign in with a Huawei Cloud International account in the browser (#1090)
The browser sign-in always opened the mainland portal (codearts.huaweicloud.com/portal/authorize, locale zh-cn), so an international-station account could not sign in in the browser. A new method, "Sign in with Huawei Cloud (International)", opens auth.huaweicloud.com/authui/login?site=intl&locale=en-us with the international portal's authorize URL (codearts.ap-southeast-1.huaweicloud.com/portal/authorize, same parameters, locale en-us) as `service`. The reporter found that the portal alone sends a signed-out browser to the mainland login. After the callback, the portal's result page is the international one too. The code is exchanged at the same STS endpoint, as the reporter found. The credential is stamped `station: "international"` (the key the IDE import already uses), so chats, usage and signing stay on that station. refreshCredential now carries `station` over, or a renewal would turn the account back into a mainland one. The international sign-in skips the mainland IAM phone read and OfficeAce's MaaS read. The method is listed last, so the mainland browser method and the IDE method keep their places. A mainland credential still carries no station. Run (WSL, magpie-desktop, HOME=$(mktemp -d)): bun test in packages/codearts, 208 pass / 0 fail; bun scripts/check.mjs codearts ok. Broken by hand: with `station` taken out of refreshCredential's copy list and out of the callback, the refresh test and the international sign-in test go red (206 pass / 2 fail). Not tried: a real international account. The URLs are the reporter's, from their own sign-in. Reported-by: AyakaChen1 |
||
|
|
a02d5912d9 |
codearts: stop goes as a list on the international station (#998)
0.3.15 turned every stop into one string, because the mainland gateway refuses a list (magpie#6342). AyakaChen1 found the international station (snap-access.ap-southeast-1) is the other way round: a string is refused and a list works, so the normalisation broke international requests that used to pass. normalizeStop now takes the account's station: mainland still gets the first non-empty string, international gets every non-empty string as a list. Empty or non-string entries are dropped on both. Run: bun test packages/codearts on WSL with a temp HOME, 204 pass. bun scripts/check.mjs codearts ok. Broken by hand: with 0.3.15's index.mjs and the new tests, the stop test and the international station test fail (2 fail). Not tried: a real international account; the list shape comes from the reporter's measurement. Reported-by: AyakaChen1 |
||
|
|
0135b7b0ea |
agy-cli 0.1.32: the first model list after warming has agy's Claude and GPT models (#1064)
On a signed-in agy, `agy models` takes about 4.4s and `agy acp`'s
session/new about 3s. provider.models() needed three calls before
claude-opus-5-5, claude-sonnet-5-5 and gpt-oss-120b showed up, and
OpenCode 2.x calls it once.
What changed:
- packages/agy-cli/index.mjs:
- The offered-model probe now starts in listAgyModels' .then, as soon as
a non-empty list arrives and a caller asked for probeOffered. It no
longer waits for the next models() call. A hung or failed `agy models`
still never spawns the probe.
- probeSignedIn reuses the `agy models` stdout it already has. The same
parser (parseAgyModels, split out of listAgyModels) fills
cachedModelCatalog, and the probe starts. Sign-in waits for the probe
for at most 3s.
- The offer (acpOfferedModels, acpOfferedKey, offeredProbeAt and any
in-flight probe) is forgotten when agyPath changes and after a new
sign-in finishes. A generation counter drops the answer of a probe
that started before the reset.
- provider.warming() returns a promise while a list or probe is still
running, and null when nothing is.
- scripts/opencode2.mjs, copied byte for byte to every
packages/*/opencode2.mjs: after the first background refresh, the
adapter awaits hooks.provider.warming() once, for at most 60s, and then
refreshes once more. It does not loop. Plugins without warming() behave
as before.
- Not done: the issue's on-disk catalog cache (point 3), skipped as asked.
Known gap: agy-cli has no `config` hook, so under OpenCode 2.x the adapter
lists no provider for it. refresh() returns before it calls
provider.models(), so the follow-up refresh can't add agy's models on 2.x
until agy-cli gets a config hook.
Tests: test/testkit.mjs's fake agy takes a sessionNewDelayMs. The new
tests in test/catalog.mjs set 1.5s on both `agy models` and session/new
and wait for state through warming(), with no fixed sleeps:
- On a slow cold start, the first models() after warming lists Claude and
GPT, from one probe spawn.
- authorize() on a signed-in agy fills the catalog, and the next models()
runs no second `agy models`.
- The sign-in wait is bounded: with a 6s session/new, sign-in returns in
about 4.5s.
- Changing agyPath probes again.
The hang test now awaits warming() before it counts acp spawns.
scripts/opencode2.test.mjs: the warming list is read a second time when
warming ends, and only once when nothing is warming.
Run on Linux (a separate test Mac was over its load limit):
- packages/agy-cli bun test: 17 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
- bun scripts/check.mjs (all packages): ok.
- Root bun test in a temp HOME: 8530 pass, 19 skip, 0 fail.
Broken by hand on Linux, each red, then restored green:
- No probe in the .then: the slow cold-start test.
- probeSignedIn drops the list: the authorize and bounded-wait tests.
- agyPath change keeps the old offer: the agyPath test.
- Unbounded sign-in wait: the bounded-wait test (7514ms).
- Probe also on a failed listing: the hang test.
- origin/main's index.mjs with the new tests: all four #1064 tests.
- Adapter reads the list once: the warming adapter test, and the
copy-identity check.
Not tried: a real agy (no Google sign-in, no network). The reset after
login.finish has no unit test of its own.
Reported-by: hiee3
|
||
|
|
507dbcc459 |
codearts 0.3.15: stop goes to the gateway as a string, an empty one not at all (Abandon332 on X, magpie#6342)
Huawei's gateway takes `stop` as a string only. Any array, [] too, came back as HTTP 200 with InferHub.001001005.400 "The request param is invalid", which magpie read as a plain 400 and rested the account for (182 times in the report). prepareChatBody now sends the first non-empty string of a list, and drops an empty or blank one or a value of another kind. Run: bun test packages/codearts (204 pass). Broke it by hand: with the normalizeStop call commented out the new test is red. Not tried: a real CodeArts account (the reporter's table is the evidence). |
||
|
|
4e3a786814 |
codearts 0.3.14: a CodeArts Agent sign-in is kept (#998)
Signing in with "Sign in from CodeArts Agent" said ok, but the account was never stored. A host keeps an OAuth sign-in only when the result has a `refresh` field (OpenCode's CLI and magpie's host.js both test `"refresh" in result`), and the IDE method's success had none. It now has `refresh: ""`. This sign-in has no refresh token: it is renewed by reading the IDE's state file again, and every reader of the refresh token (firstOf) already skips an empty string. The IDE sign-in test now checks the field is there and empty. Ran on mica (Bun, HOME=$(mktemp -d)): bun test packages/codearts 203 pass 0 fail; bun scripts/check.mjs exit 0. Broken by hand: without the refresh line, "signing in from the CodeArts Agent: checked with its station…" goes red (202 pass, 1 fail). Not tried: a real CodeArts Agent sign-in (no account here). Reported-by: AyakaChen1 <AyakaChen1@users.noreply.github.com> |
||
|
|
92c20ffef6 |
Eight auth hooks declare rotating refresh tokens (#1027)
Eight auth hooks declare `rotating: true`: cline, codearts (and OfficeAce), factory, minimax, nous, qoder, sensenova, workbuddy. Each package's own code says the vendor refuses a spent refresh token. magpie then stops carrying these sign-ins to another computer through Sync, a backup or a Restore (internal/provider/signins_carry.go). Trae was dropped: its refresh keeps the old token when the answer has none, and there is no evidence it rotates. Each package's patch version is bumped (cline 0.1.15, codearts 0.3.13, factory 0.1.46, minimax 0.2.9, nous 0.1.3, qoder 0.2.66, sensenova 0.2.3, workbuddy 0.2.30). Each was checked against npm, or against origin/dist for the dist-only packages, before the merge. Fixes #884. Run at cc2f9199 (a fast-forward of origin/main), on mica with a temp HOME: bun test over the eight packages gave 1588 pass, 0 fail, and scripts/check.mjs exited 0. CI's test and on-npm jobs pass. At 45c8fdb4, mote gave 1834 pass with Trae included. Not tried: a real refresh against each vendor. Co-authored-by: yetihan <yetihan@users.noreply.github.com> |
||
|
|
24a327eeb1 |
codearts: test an IDE write-ahead log rewritten in one clock tick (#1012)
Test only. Adds a codearts regression for #1007's fix ( |
||
|
|
029c628ff8 |
codearts 0.3.12: an IDE rewrite in the same mtime tick is read again (#1007)
Cause: ideReader kept the last read of CodeArts Agent's state.vscdb
under a stamp of size:mtimeMs:ino (plus -wal/-journal size and mtime).
An in-place SQLite write keeps the inode and page count, so two writes
within one tick of the file system's clock left the stamp unchanged and
the old credential came back. The test's rewriteIde hit exactly that:
two rewrites a few ms apart, each with mtime Date.now()+5000, so when
both landed in one millisecond the renewal test saw IDEAK2's cached read
and said "hasn't renewed" instead of "another account" (~1 run in 3).
Fix:
- ideReader stamps the inode plus a sha1 of the bytes of the database,
its -wal and its -journal, read in 1MB pieces (no copy, no SQLite
open; it runs only on an IDE sign-in's renewal). A file that can't be
read, or is past IDE_DB_MAX_BYTES, gives no stamp, so it is read again
rather than taken as unchanged.
- rewriteIde gives each rewrite a strictly later mtime (>= 1s after the
previous one).
- New test: the file rewritten at a fixed mtime with the same size and
inode is read again; a removed file is not the last read.
Ran (mote, Bun 1.4.2, HOME=$(mktemp -d), at
|
||
|
|
1e5b1c8317 |
codearts 0.3.11: OfficeAce routes by its total credit, not each bucket (#986)
An OfficeAce account is now routed by one 总积分 window: the total of every unexpired plan bucket (`skus[].quotas`) and activity bonus (`bonus_skus`). Each bucket stays visible as an `aside` detail, so a spent daily check-in bonus (每日签到有礼 0 / 100) no longer pauses an account with thousands of credits left elsewhere (#981). What changed (packages/codearts, 0.3.10 -> 0.3.11) - fetchOfficeAceUsage sums unexpired buckets into 总积分 (amount, limit, two-decimal rounding; sub-half-cent totals keep their raw value). Every per-bucket window is `aside`. - 总积分's `runsOutAt` is the soonest expiry among unexpired buckets that still hold credit, and `runsOut` is what those buckets hold on that Beijing day (soonestLapse, shared with #982), never more than the total's remainder. Trial and spent buckets never choose the expiry. - Overspent buckets are capped at their own total; an empty or unparseable `expired_time` is no expiry instead of Invalid Date. - When every bucket has expired, a used-up 总积分 (0 / total, used 100) stays so the account is paused, not routed without a limit. - README (en, zh) says the same. Rebased onto |
||
|
|
dea9e4e3b3 |
codearts 0.3.10: the international station and signing in from the CodeArts Agent (#998)
What changed - Stations. A STATIONS table (mainland, international) is now where the signing fence comes from: SIGNED_HOSTS is every station's API hosts (https, default port, exact name), and each credential is signed only for its own station's hosts. An international credential reaches only snap-access.ap-southeast-1.myhuaweicloud.com and a mainland one never reaches it. Console hosts are never signed. The plugin's mainland snap URLs (and a config `api` on the mainland snap host) are rewritten to the credential's station at the fetch choke points. A lookalike host is not rewritten, and is refused. - International usage. When `package.is_token_package` is true, statistics/plugin's usageTokenChatMessages is a "Tokens" window: usage_token_num of package_token_amount (e.g. "131 / 5.0M"), resetting at end_date, span start_date to end_date. The plan is package_name_en there (package_name_cn on the mainland). The international station has no opengw, credit batches or daily check-in in the issue's probes, so none of them is asked there; check-in answers "inactive". The loader's baseURL is the station's /api/v2. - Sign in from the CodeArts Agent on this machine. A second method, offered only while the IDE's state.vscdb exists (macOS ~/Library/Application Support, Windows %APPDATA%, Linux $XDG_CONFIG_HOME or ~/.config, then codearts-agent/User/globalStorage/state.vscdb; MAGPIE_CODEARTS_IDE_STATE overrides). Key huaweicloud.codearts-snap, userInfoKey.originData, as in the issue. The file (and its -wal/-journal) is copied to a temp folder and only the copy is opened; its statement is finalized before the close so Windows can remove the copy. A missing, unreadable, half-written or incomplete file, or an unknown stationType, is "unknown": no method, or a failed sign-in saying why, never with a secret. The credential is checked once against current/user on its station. It has no refresh token, so it is renewed by reading the IDE's file again, never through STS; until the IDE has renewed it (or when the IDE is on another account or station) a renewal fails for now only, and the sign-in is kept. The account is the IDE's domainId. - README (en and zh) documents both. The browser method keeps index 0. What ran (this tree; the root suite at base |
||
|
|
4a78bec3b7 |
codearts 0.3.8: a window's runsOut is only credit its own remainder holds (#982)
usageFromStatistics took the bonus window's runsOutAt/runsOut from the soonest check-in batch while remaining/used were the whole bucket, and the total's from every non-basic batch whatever the buckets had left. So an account whose check-in was spent (bonus remaining 0) still had a total runsOut of 82.05 at tonight's midnight, and one with 2344.81 long-lived gift credits said 100 lapse in hours while the vendor's package_credit_expiring_amount was 0. magpie's routing reads a total's RunsOutAt as "what is left is lost then" (Allowance.Renewal), so these accounts were ranked ahead of ones that really lapse sooner. Now: - each bucket's lapse is its own batches' soonest, held to that bucket's package_credit_remain; an empty bucket has none; - the total's lapse is the soonest of the buckets' lapses (same Beijing day summed), never from batches of a bucket with nothing left; - the ledger fallback's batches are marked `estimated` (what was spent of a check-in isn't known): they say when, and how much is the vendor's own expiring amount, so with 0 or none said there is no lapse; the vendor's batch reads (with consumed/expired counts) are used as before; - each window carries the vendor's package_credit_expiring_amount as `expiring` when it is sent; - comments and README say the ledger keeps the date the claim names (a day on for today's check-ins); 30 days is only for a claim with none. Run (wsl-run, magpie-desktop, at this tree rebased on origin/main): bun test packages/codearts: 177 pass, 0 fail; bun scripts/check.mjs: ok. Fixtures are the issue's two accounts as filed (A: bonus 100 used, 0 left, total 82.05 left; B: 4100 / 2344.81 left, ledger grant 100 claimed 2026-11-10T16:01:04.916Z expiring 2026-11-11T16:01:03.812Z, expiring 0), clock held at 2026-11-11T10:00Z. Broken by hand: cap = Infinity in bucketLapse: the three #982 tests red (174 pass, 3 fail). cap = remain (no estimated gate): account B's test red alone (176 pass, 1 fail). Not tried: a real CodeArts account; the vendor's horizon for package_credit_expiring_amount isn't known, so vendor batch reads are not gated on it. A lagging vendor batch counter is bounded by the bucket's remainder only. Reported-by: KiMelody |
||
|
|
34786edadb |
qoder 0.2.65: two tool calls at one index with their own ids are two (#930)
Qoder Ultimate sent two native tool calls at tool_calls[].index 0, each
with its own id and name. events() kept one call per upstream index, so
the second call's arguments were sent as more of the first:
{"key":"A"}{"key":"B"}, which the client refused as unparseable JSON.
A fragment with a non-empty id that differs from the open call's id at
that index now starts a new call with an output index of its own. A
fragment with no id, or the open call's id, still goes on with the open
call (OpenAI's argument fragments, and relays that repeat the id). A call
pushed aside before it got a name still counts as nameless (#579).
After two ids at one index, id-less fragments go to the newer call; the
report suggested failing there instead, but OpenAI streams each call's
fragments right after its start, so the newest is the one open.
Siblings with the same index-keyed fold, fixed the same way:
- zed 0.1.19: chatWhole (a streamed chat reply folded for stream:false).
- codearts 0.3.7: completionFromChunks.
- zen-free 0.1.27: stream.mjs chatAccumulator, and tool-response.mjs's
chat buffer, which gives each call its own index when two collided.
- page-chat 0.1.13: lib/server.mjs folds through toolCallFolder.
Looked at and left: codearts' stream name restorer and kimi-desktop's
Agent hold pass fragments through unchanged and join no arguments;
zed's streaming path passes Zed's chunks through, and magpie's gateway
already starts a new call on a new id (internal/gateway/chat.go).
Run (WSL magpie-desktop, bun 1.4.2, node 22):
- pedh's repro.mjs with his fixture: [0,0] gave one tool event plus an
args event on 0.2.64; now two tool events (index 0 and 1), each with
valid JSON. [0,1] unchanged.
- HOME=$(mktemp -d) bun test packages/qoder packages/zed
packages/codearts packages/zen-free packages/chat: 987 pass, 0 fail,
1 skip (the epub reader's, as before). bun scripts/check.mjs: every
package and registry.json ok.
Broken by hand:
- qoder back to index-only: 3 of the new tests fail (two ids, id-less
after a second id, streaming adapter).
- qoder starting a call on any fragment without the open id: 8 fail,
the id-less continuation test among them.
- qoder treating any id as new: the repeated-id test fails.
- zed, codearts, zen-free (both) on main's code and chat keyed by index
only: each new collision test fails (5 of 5).
Not tried: a real Qoder account (no Qoder Ultimate here), real Zed,
CodeArts or OpenCode Zen replies with a collision, and the chat page
in a browser.
Reported-by: pedh <pedh@users.noreply.github.com>
|
||
|
|
eb3cb370a0 |
codearts 0.3.6: an account with no free channel is sent its plain model (#905)
gateway/config answers an account with no benefit channel with
{"error_code":"4000","error_msg":"invalid channel, group not found"}.
That was read as a failed read, so state.benefit stayed null and the
built-in fallback list sent glm-5.3-flash with maas_type: benefit. The
gateway answers that header on such an account with a 200 whose first
frame is InferHub.APIG.0101.404, mapped to 400, so magpie stopped the
group's fallback.
- gateway/config's "group not found" (any status) is now a list of no
free models; a network failure or another error still keeps the
fallback.
- InferHub.APIG.0101.404 to the benefit header sends the request again
without it and remembers the model has no benefit.
Run on mote: bun test in packages/codearts 173 pass / 0 fail;
scripts/check.mjs ok. Broken by hand: with main's index.mjs the three
new tests fail (both 4000 statuses and the 0101.404 retry).
Not tried: a real account without the free channel; the fixtures are
the reporter's bytes from #905.
Reported-by: hyperp0p
|
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator): - Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all. - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none. - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal. - The body rewrite strips the reasoning fields and sets image detail to auto. - A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key. - Neither browser method is offered when no Chromium-family browser is found (#825). - The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry". - The #826 metadata token read is kept, and its test is back. - The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows. - maxConcurrency is 4. - The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included. Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME: - full bun test: 6853 pass / 0 fail; both checks exit 0 - bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0 - 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed) Not tried: a real InkStone account or sign-in, Windows and Linux runs. |
||
|
|
e7004d9354 |
inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id `intern-inkstone`. Community package by yunwang2442-creator. What it does: - Browser sign-in (Edge/Chrome, its own profile under $XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or %LOCALAPPDATA%\magpie\inkstone-browser). The login window has no debugging port. A headless CDP read takes the uaa-token cookie, and the same read renews it silently later. - Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs. - Chat: a pasted ink-* API key, or one the sign-in creates, named ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An idempotency clash (-15109) retries with a fresh name, up to three times. Pruning is on by default. It only touches this machine's and account's prefix, keeps the newest two and the key this sign-in created, and never deletes manual keys or keys of unknown age. - Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover browsers are matched by --user-data-dir=<escaped profile>, and Windows uses .Contains(). - The login wait comes from an injected waitForLogin in tests. No env hook is left in production code. - Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn, 127.0.0.1 (CDP). Outside the package: scripts/opencode2.mjs lets a prompt with `required: false` stay optional (`p.required !== false`). Every package's copy is synced byte for byte, so all 39 copies in the merged tree are blob |
||
|
|
5f78bb0089 |
codearts 0.3.5: OfficeAce models carry their cost coefficient as rate (#689)
OfficeAce models carry the billable list's cost_coefficient as `rate` (only when it is a finite number; the static signed-out table has none and stays without). package.json 0.3.4 -> 0.3.5. Reviewed head 171e93c6. Read every changed line. The rates table is the existing /v1/model-token-rates read (fixture has the vendor's trailing-newline model_name); a missing or non-numeric coefficient was never in the table, so such a model gets no rate rather than 0. No conflict with #677 (names untouched; -0930 and -1017 stay separate ids with separate rates). Run on mote: bun test packages/codearts 169 pass / 0 fail; bun scripts/check.mjs codearts and registry ok. Broke it by hand (dropped the rate spread in officeAceLiveModels): the models-are-the-billable-list test went red, 168 pass / 1 fail. Not tried: a real OfficeAce account. Note: a coefficient of "" or false would read as 0 in the existing table parse (not changed here). |
||
|
|
1820255222 |
codearts 0.3.4: kimi-k3.1-pro takes medium (#683)
Adds medium to kimi-k3.1-pro's reasoning levels, which #680 left out; version 0.3.3 -> 0.3.4. Reviewed at 52ca4946b7d61f5c10c0394d0813a0fe4f58ceca: a one-line table change plus the version bump. Run at that head on mote: bun test packages/codearts, 169 pass, 0 fail. Not tried: a live CodeArts request at medium; the 405-character reasoning figure is the author's measurement. |
||
|
|
fae4bc2e13 |
codearts: tell the host the reasoning levels, and honour the caller's (#680)
Tells the host a CodeArts model's reasoning levels (model row `variants`, per model, measured 2026-11-04 by Gyl1219) and honours the level a caller names: passed on as is with no injected `thinking: enabled`, a level the model does not take is dropped, none/off/disabled send `thinking: {type: "disabled"}`. Version 0.3.2 -> 0.3.3, README updated.
Run at the reviewed head 95acc1e3 on mote (Mac mini): `bun scripts/check.mjs codearts` exit 0; `bun test packages/codearts` 169 pass / 0 fail. Broken by hand, each one turned a test red: the drop-unknown-level branch made unconditional, the `spoken === ""` condition removed from `injected`, the `thinking: disabled` assignment removed, `variants` left off the model row, a caller's own variants overwritten. Tests use the injected fetch, none reach the network.
Not tried: a real CodeArts account (I took the author's 2026-11-04 measurements on trust). Open question left on the PR: kimi-k3.1-pro is declared without `medium` though the author's table shows it answered.
|
||
|
|
0b8cc01937 |
codearts 0.3.2: a dated model keeps the name CodeArts gives it (#677)
errorcode7 (#677): /v1/model/builtin lists deepseek-v4.1-flash and deepseek-v4.1-flash-1017 side by side, two models with their own description and off-peak rate (0.09x vs 0.12x). The ids were already kept apart, but normalizeModelId cut "-1017" off the display name, so both rows read "DeepSeek-V4.1-Flash". parseModelInfo now takes the vendor's model_name as written (trimmed), and falls back to prettify(id), not the date-stripped id. A model only the agent lists gets the same. normalizeModelId stays for the CONTEXT_WINDOWS lookup and the vision check only. This is the codearts plugin alone: magpie does not fold 4-digit suffixes (catalog/samemodel.go only takes YYYYMMDD or YYMMDD), so no other vendor changes. Run on mote (Bun 1.4.2), at this head: - packages/codearts: bun test, 166 pass / 0 fail - bun scripts/check.mjs: ok Red on the old code: the new tests against origin/main's index.mjs, 163 pass / 3 fail (the two #677 tests and the updated dated-id test). Not tried: a real CodeArts account's model list. |
||
|
|
17e5ef7457 |
all: load on OpenCode 2.x through a default {id, setup} (#657)
nbczw8750 (#657): trae 0.2.26 on OpenCode 2.2.5 fails with "Plugin must export a default definition with an id and an effect or setup function. (cause: SchemaError(Missing key at ["default"]))". 2.x imports a package's exports["."] (a plugin dir and an npm install alike) and has no V1 path at all, so every package here that serves models failed the same way, not only trae. Every one of the 32 model packages now has: - opencode2.mjs, exports["."]: a copy of scripts/opencode2.mjs, an adapter that runs the package's V1 plugins inside 2.x's promise API. Config providers become 2.x providers (package pinned so the aisdk sdk hook runs), V1 auth methods become integration methods (oauth auto/code with forms; api without authorize as a key method), V1 credentials are kept in metadata.v1, the loader's baseURL, apiKey, headers and fetch are applied through the sdk hook, an auth.set renewal is stored per credential, and credential.switched /updated reload the account's own model list. - opencode.mjs, main: re-exports the V1 plugin functions only. OpenCode 1.x and magpie's host.js take main. On 1.x, trae 0.2.26's main exported a non-plugin (_internal) and 1.19.5 refused it ("Plugin export is not a function"); the new main fixes that too. - both files in "files"; patch version bumped. devin already had 2.x and is unchanged. scripts/check.mjs fails a model package whose 2.x entry has no default {id, setup}, whose opencode2.mjs differs from the canonical one, whose entry is missing from files, or whose main exports a non-plugin. Run at this head (mote): - HOME=$(mktemp -d) bun test, as CI runs it: 4900 pass, 0 fail (4914 tests, 374 files). A first run set globalThis.fetch for the whole process from opencode2.test and failed 528 tests in other packages; the block is now set and put back around that file's tests. - bun scripts/check.mjs: every package passes. With the network blocked cloudflare-workers-ai fails on its fetched catalog, the same on origin/main. - Real OpenCode 2.2.5 (npm opencode-ai), sandbox HOME, packed trae 0.2.27: loads with no error; /api/integration lists trae-cn "Trae CN" and trae-global "Trae Global" with their browser sign-ins; `auth login` starts the trae.cn authorization and waits (cancelled there); with a fake credential POSTed to /api/credential, `opencode models` lists trae-cn's six models. - Real 2.2.5 with a fake V1 key plugin through the same adapter against a local fake server: `auth login` with a key, `models`, `opencode run` reached /real/v1/chat/completions with the loader's "Bearer loader-sk-fake" and header, and printed the fake's reply; with @ai-sdk/anthropic it reached /real/v1/messages with x-api-key from the loader. This run found the key method missing after 2.x's second integration transform (a once-only flag outside the transform); fixed, and opencode2.test checks a rebuild. - Real OpenCode 1.19.5, sandbox HOME, trae 0.2.27: `opencode models` lists trae-cn and trae-global models; 0.2.26 failed there. Broken by hand (scratch copy, bun test scripts/ and check.mjs): - trae's exports back to "./index.mjs": the trae 2.x test fails (default.id undefined), check fails trae with "OpenCode 2.x: ./index.mjs has no default {id, setup} (plugins#657)". - zed's opencode2.mjs changed: the copies test fails, check fails zed "differs from scripts/opencode2.mjs". - the key flag back outside the transform: the 1.x plugin test fails on the rebuilt sign-ins (key missing). Not tried: a real sign-in with a real account on 2.x; Windows (the reporter's OS); chat.headers, chat.params, usage and tool hooks, which the adapter doesn't carry to 2.x; the tools/pages packages (calc, goanyapi, layerfs, search1api, aelios, agent-console, chat, fingerprint, nowledge-mem, kimi-desktop), which still load only on 1.x. |
||
|
|
f42a59adf5 |
codearts: an OfficeAce card for the same Huawei Cloud account (#522)
codearts: an OfficeAce card for the same Huawei Cloud account (#522, MYCF711) Adds the OfficeAce (AgentArts) provider to the codearts package, replacing officeace-auth; accounts signed in there keep working. Each card signs in on its own and holds its own record and refresh token, because a Huawei Cloud STS refresh token is spent once. A renewal writes only the record being renewed, so a removed account never comes back. Reviewed over eight rounds; reviewed head f7c2526. r8 is words only plus the writeSharedRecord -> writeProviderRecord rename (every caller and the test updated). Run at f7c2526 on mote: node --test packages/codearts/index.test.mjs 164/164 pass; bun scripts/check.mjs exit 0, codearts ok. Not tried: a real Huawei Cloud sign-in on either card. |
||
|
|
4d8d0310f9 |
codearts 0.2.6: an IAM internal id is never the account's display name (#518)
An account whose IAM phone read yields nothing no longer shows iam::<domain>:user:<name>, the hw... account name, a urn:, a uuid or a bare hex id as its card name. accountIdentityOf() walks the same candidates in the same order and skips any that looks like an id; with none left the name is "" and the host shows the provider's name. id/uid/accountId are unchanged (still the URN, as #483 settled), so no account is renamed. The only reader of .name is usage()'s `user` fallback. Reviewed at d8583da plus the reviewer's version bump (0.2.5 -> 0.2.6) at f77e5bb. Run on mote (macOS, Bun 1.4.2) at f77e5bb, from the repo root: - HOME=$(mktemp -d) bun test: 3763 pass / 0 fail (3771 tests, 298 files) - bun scripts/check.mjs: exit 0 Red on the old code: the PR's tests against main's index.mjs, 125 pass / 2 fail (both new tests). Broken by hand: displayNameOf without the looksLikeIdentifier skip -> "accountIdentityOf never makes an IAM id the account's name" red (126/1). Not tried: a real CodeArts sign-in whose phone read fails. |
||
|
|
b850c9da3d |
codearts 0.2.5: the card names the account by its phone, not by IAM's URN (#483)
The card names a CodeArts account by its masked phone (138****8000), read from IAM once per account (6h cache), while accountId stays the IAM URN, the account's identity. A renewal keeps the phone, reads it once for an account signed in before 0.2.5, never renames a named account, and gives an account stored without an accountId the URN. Reviewed at fa5aaae (round 4). Run on mote (macOS, Node 22, Bun 1.4.2) in a sandbox HOME, at that head: - node --test packages/codearts/index.test.mjs: 125 pass / 0 fail - bun test packages/codearts/index.test.mjs: 125 pass / 0 fail - bun scripts/check.mjs codearts: ok Broken by hand, each red at the test it should hit: - sign-in accountId: identity.id -> identity.name (index.mjs:2746): "a sign-in names the account by its URN while the card shows the phone" red (124/1). - refresh reads no phone (identified = next): "auth.refresh keeps a named account's identity ..." red (124/1). CI (test, on-npm) green at fa5aaae. Version 0.2.4 -> 0.2.5. Not tried: a real Huawei Cloud account. |
||
|
|
c2eb8de4f7 |
codearts 0.2.4: every model is text only, and an image it refuses is a 400
star21321321124 (Discord, magpie 0.1.1818, codearts 0.2.3): DeepSeek V4.1
Flash through a Codex-like agent failed often with "CodeArts: The request
model is not multimodal (InferHub.001001020.406) (502: you can retry your
request)", while CodeArts' own client served it.
Cause: the plugin listed its models with capabilities.input { text: true }
and no image key, and the config hook gave no modalities. magpie's host
reads image as said only when it is a boolean (imageSaid), so every
CodeArts model was "unknown" to magpie: an agent's screenshot or a tool
result's image went upstream as sent, instead of being described by the
Vision model or left out (textOnlyBody). CodeArts then answered
InferHub.001001020.406 inside a 200, which embeddedErrorStatus counted 502,
and magpie told the agent to retry, so it asked again with the same image.
- The config hook declares attachment false and modalities text in, text
out; provider.models says input.image false (and audio, video, pdf) for
every listed model. A kind the user's own config says stands. The -vl
models were already left out of the list.
- InferHub.001001020.406 / "not multimodal" is a 400: inside a 200 (stream
and folded JSON), and with any HTTP status. foldAnswer's own error now
goes through embeddedErrorStatus too, instead of a flat 502.
Run (on mote): packages/codearts HOME=$(mktemp -d) bun test, 117 pass;
the whole repo's bun test, 2985 tests 0 fail; bun scripts/check.mjs ok.
Broken by hand: the new tests against origin/main's index.mjs go red, 3
of 3 (the 400 on every path, the text-only declaration, the status map).
Not tried: a real CodeArts account with an image (none here); the exact
body CodeArts sends is taken from the reporter's message (error_code /
error_msg shape as its other embedded errors).
|
||
|
|
bace91473b |
codearts 0.2.3: a queued request leaves the queue at once when magpie has another candidate
As Qoder's 0.2.40 (axuhere on X: a free model held in a queue while another provider could answer). When magpie says another account, provider or routing group member follows this request (x-magpie-fallback: 1), a 429 with queue-status: queued isn't polled for up to 5 minutes: the trace leaves the queue (DELETE, as giving up does) and the plugin answers 503 with the queue's retry-after, "CodeArts queued the request; try again in 20s", so magpie asks the next. The header is read and dropped before anything is signed or sent. Without it, the wait is as before. Run: packages/codearts `bun test` (115 pass) and `node --test index.test.mjs` (115 pass); `bun scripts/check.mjs` all green. Broken by hand: index.mjs as before: the new test red (it waits in the queue instead). Not tried: a real CodeArts account queued live; the 429 headers are the shape the existing queue tests use. |
||
|
|
b1bc778edf |
codearts 0.2.2: tool names over 64 characters go cut and unique, and come back as the agent's own (#432)
CodeArts turned away ZCode's android emulator MCP tool, mcp__plugin_android-emulator_android-emulator__android_discover_project (71 characters), with "Function name [...] length over limit, maximum is 64 (InferHub.001001017.413)", so every ZCode chat with that MCP on failed. A name over 64 now goes as magpie's FlatName cuts one: its first 55 characters, "_" and 8 hex of its SHA-256 (64 in all). It is cut in every place the body names a tool: tools, functions, tool_choice, function_call, the history's tool_calls and a tool message's name, so the history keeps matching its tool on every turn. A cut that equals another tool's own name, or another cut, is cut again with a salt. The answer gets the agent's names back: in a folded (non-streaming) reply and in the stream, where a name the gateway sends whole, repeated in a later delta, or in pieces (the part past 55 held until the name is whole) is put back. Events that name no cut tool pass byte for byte, and a body whose names all fit is not touched at all. Run: packages/codearts `bun test` (114 pass) and `node --test index.test.mjs` (114 pass); `bun scripts/check.mjs` all green. New tests use the reporter's literal tool name, two names alike for 55 characters, a short tool named exactly like a long one's cut, a stream round trip through the loader's fetch (whole name, name in three pieces across the 55th character, a name that fits), a gateway repeating the name, and a folded reply. Broken by hand: restoreToolNamesInStream returning the stream as it came (stream and repeat tests red); no salt on a collision (collision test red); no shortening in prepareChatBody (4 tests red). Not tried: a real CodeArts account (its refresh token is single-use, so no live sign-in was copied into a sandbox); whether CodeArts ever sends a tool name in pieces (handled, not seen). |
||
|
|
98985a2426 |
codearts: the credit fixture's check-in stays on its sign-up's Beijing day at any hour (#322)
creditFetcher put the check-in 52s after a sign-up taken from the wall clock, so in the last 52s of a Beijing day it fell on the next day and the usage test read runsOut 4000, not 5000. The sign-up is now noon in Beijing of the same day, so the check-in a minute later can't cross midnight. Test only; the plugin is unchanged, so no version bump. Run: bun test packages/codearts under TZ=UTC, Asia/Shanghai and America/Los_Angeles (sandbox HOME): 109 pass. The new guard test (now 30s and 1ms before Beijing midnight, at it, and at noon) is red with the old fixture (1 fail) and green with the new. bun scripts/check.mjs codearts: ok. |
||
|
|
515d94e3a2 |
codearts 0.2.1: signs only for its two hosts and follows no redirect, a callback without a code fails at once, fixes since #284 (#286)
The follow-ups from #284's merge review and fixes since: credentials are
signed only for snap-access.cn-north-4.myhuaweicloud.com and
opengw.developer.huaweicloud.com (one signFor every signed call passes),
and no signed or token request follows a redirect (redirect: "error" set
after the caller's init); a callback without a code fails at once and the
callback path is matched as sent; one renewal per refresh token per
account, and a transient renewal failure keeps the sign-in (503, kept);
the free model's TPM limit inside a 200 is a 429, not an empty reply;
benefit claims across Beijing midnight; Content-Length dropped from a
reshaped body; bounded queue polls that leave the queue after failed
polls; a busy callback port is retried. A check-in re-confirms only a claim
this plugin made and failed to confirm (kept for its Beijing day in the
account's state and the ledger's _unconfirmed key); a claim answering
id: null is never confirmed, as the IDE does.
Earlier review at cb14faf asked for three changes (re-confirm of id:null
claims, redirects carrying the security token, a test for leaving the
queue); 1c04a71 and 2447c5f answer them.
Run at the reviewed head 2447c5f9a118098e05439f96b1ff87a9bedc8d83, on
macOS, bun 1.4.2, node 24:
- packages/codearts: bun test 108 pass, node --test 108 pass.
- Whole repo at the head: 2033 pass, 0 fail; merged onto main
|
||
|
|
6579f0682a |
codearts 0.2.0: Huawei Cloud CodeArts (码道) coding plans, with Huawei Cloud OAuth sign-in (#284)
New package @magpie-community/opencode-codearts-auth 0.2.0 (Sakura-Natsu): Huawei Cloud CodeArts (码道) coding plans, with Huawei Cloud OAuth sign-in, request signing (SDK-HMAC-SHA256), a per-account cap of 3 in-flight sessions, per-account free/regular model lists, and requests signed only for https Huawei Cloud hosts. Reviewed head 31099104 (two rounds; the first asked for changes at a793ca5, all fixed here). Run at the reviewed head, macOS, bun 1.4.2, with a preload that allows only loopback network: - HOME=$(mktemp -d) bun test packages/codearts: 91 pass, 0 fail - HOME=$(mktemp -d) bun test (whole repo): 2011 pass, 0 fail - bun scripts/check.mjs: 21 ok - 10 parallel bun test --rerun-each 40 in packages/codearts: 0 fail - 22 hand breaks (signature, DPoP proof, 403 expired mark, session clamp, host check, per-account lists, callback server, refresh mark); 21 went red. The one green is the callback's prefix-path match (follow-up). Not tried against Huawei's real API (no credentials); sign-in, signature acceptance, session counting and metering rest on the author's use on two accounts. Follow-ups: list the exact Huawei hosts instead of *.myhuaweicloud.com / *.huaweicloud.com; fail at once on a callback with no code; drop the unused ticketId; exact callback path match. This is a new npm name, so its first publish needs an owner. |