Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

checkin: an inactive or ineligible check-in shows the plugin's reason (plugins#304)

yetoneed91aa04ef1f
diff --git a/docs/subsystems/provider-plugins.md b/docs/subsystems/provider-plugins.md
index 650d30b7a..3ca3c3a48 100644
--- a/docs/subsystems/provider-plugins.md
+++ b/docs/subsystems/provider-plugins.md
@@ -42,7 +42,7 @@ The gateway parses the field into `Usage.Deferred` ([`cUsage`](../../internal/ga
A plugin can press its vendor's daily check-in (签到) itself: its `auth` hook gains `checkin(getAuth, provider)`, beside `usage`. The host lists the provider with `checkin: true` (`plugin.Provider.Checkin`) and answers `checkin({provider, account})` (`plugin.AccountCheckin`) by refreshing the account as `usage` does and calling the hook with the account's auth.
-The hook returns `{outcome, credit?, streak?, message?}`. `outcome` is one of `claimed` (checked in now), `done` (already in today), `ineligible`, `inactive` (no check-in event now), `captcha` or `failed`. A throw, or an outcome not in that list, is `failed` with the reason. `captcha` means the vendor wants a captcha: magpie never solves one, and says "check in in its own app" instead. A plugin must not solve captchas either.
+The hook returns `{outcome, credit?, streak?, message?}`. `outcome` is one of `claimed` (checked in now), `done` (already in today), `ineligible`, `inactive` (no check-in event now), `captcha` or `failed`. A throw, or an outcome not in that list, is `failed` with the reason. `captcha` means the vendor wants a captcha: magpie never solves one, and says "check in in its own app" instead. A plugin must not solve captchas either. An `inactive` or `ineligible` result with a `message` shows it beside the fixed label ("No check-in event now · <message>") on the card, where it wraps rather than ends in "…", in Settings' check-in line and in `magpie accounts checkin`; the TUI's narrow cell says `c` says why, and `c`'s flash carries it (plugins#304). Without a message the label reads alone.
[`plugin_checkin.go`](../../internal/provider/plugin_checkin.go) runs these through the same `checkiner` as the built-in check-ins ([`checkin.go`](../../internal/provider/checkin.go)): each signed-in, in-use account once a Beijing day, the first look 2 minutes after start and then every 30 minutes, a `failed` asked again after 30 minutes, every other outcome settled for the day. A `done`, `inactive` or `ineligible` answered before noon Beijing (`checkinSureHour`) for an account magpie hasn't seen claim that Beijing day is provisional (`provisional`, #3326): a vendor whose day turns at UTC midnight (08:00 Beijing) or later still answers yesterday's "already" at 00:00, and magpie took it for today's and never asked again. The loop asks it again 30 minutes after the answer, until a claim or an answer from noon on, so at most 24 more asks a day and none once magpie claims; a press (`soon`) asks it again at once, whatever the hour, since the vendor's answer is what the press is for. A claim stamps `Claimed`, carried over while later answers that day say done, so a done after magpie's own claim is settled. Such a record is sent with `again: true` (`shown`, never kept), and the card, Settings, TUI and CLI say the vendor said already checked in and magpie asks again later, not "Checked in today", and the card keeps *Check in now*. A vendor whose day turns after noon Beijing (a US day) is not covered. The Qoder and Qoder CN plugins are the exception, as magpie's own Qoder check-in is (`recheck`, `pluginRechecks`, #2696): a campaign can open mid-day (Qoder CN's ran 10:00 to 09:59 the next day), so the loop asks again 30 minutes after the last answer whatever it was, and *Check in now* asks at once, and their card keeps *Check in now* for an `inactive` result. Every other plugin keeps the day's result. Results are kept in `plugin-checkin.json` by `provider|<sign-in key>` (`pluginCheckinKey`: the key `plugin-auth.json` keeps the sign-in under, `autoclaw` or `autoclaw#x1y2z3`), never by the display name: two sign-ins can share a name (AutoClaw's default can't be changed), and keyed by it only the first of them was ever checked in, by the loop or *Check in now* (plugins#254). The sign-in key holds over a refresh and over signing in to the same account again (`settle` in `host.js` puts it back under its key); a sign-in made after one was signed out the same day may take the freed key, and with it that day's result. An entry kept by `provider|<display name>` before then is carried over once the plugin's accounts are listed (`adoptLegacyPluginCheckins`): a check-in goes to the first sign-in in use of that name, the one the old key asked, and only to it, so its namesakes are asked and none twice; an `Off` in `settings.CheckinOff` goes to every sign-in of that name, since none of them was checked in while it was off. A `plugin-checkin.json` that can't be read or parsed is left as it is and carried over once it reads; until then no plugin account is checked in, and each says why (`readCheckins`, as for every vendor's check-in file). A failure is recorded as failed and never resets an account, a key or a previous day's result. Each account's Usage card has the check-in row (`checkinBy: "plugin:<provider>"`), and Settings → Usage has a Plugins tab with a Daily check-in switch per provider (`settings.PluginCheckins`, `POST /api/settings/plugin-checkin {provider, on}`; *Check in now* is `POST /api/usage/plugin-checkin {provider}`). The press says what it came to, a count per kind (`checkinPressSaid`, #3326): claimed now with the credits, already checked in today, not available yet (`inactive`, `ineligible`, or an `again` answer), to check in in the vendor's own app, failed; a result is claimed now only when it carries `asked` (`Asked`, sent but never kept), so an account claimed earlier today counts as already. `magpie accounts checkin` and `c` on the TUI's Usage page include them. Every check-in, built-in or a plugin's, also skips an account listed in `settings.CheckinOff` by its file key (#1902): `checkinNow` asks nothing for it, by the loop or a press, `CheckinAccounts()` lists each account with its own `on` for Settings (`checkinAccounts`, a row each under the vendor's switch when it has two or more, `POST /api/settings/checkin-account {key, on}`), and its card carries `checkinOff`.
diff --git a/internal/cli/accounts_cli.go b/internal/cli/accounts_cli.go
index 1974cd709..ee112ad58 100644
--- a/internal/cli/accounts_cli.go
+++ b/internal/cli/accounts_cli.go
@@ -718,10 +718,7 @@ func refreshAccounts(asJSON bool) error {
func checkinWorkBuddy(asJSON bool) error {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
- rs := append(provider.CheckInWorkBuddy(ctx), provider.CheckInTrae(ctx)...)
- rs = append(rs, provider.CheckInMiniMax(ctx)...)
- rs = append(rs, provider.CheckInQoder(ctx)...)
- rs = append(rs, provider.CheckInPlugins(ctx)...)
+ rs := checkinAll(ctx)
if rs == nil {
rs = []provider.WorkBuddyCheckin{}
}
@@ -772,10 +769,12 @@ func checkinWorkBuddy(asJSON bool) error {
line += muted.Render(" · already")
}
fmt.Println(line)
+ // why, in the vendor's or plugin's words, beside the label: a bare
+ // "no check-in event now" left the user guessing (plugins#304)
case provider.CheckinIneligible:
- fmt.Println(muted.Render("·"), r.User, muted.Render("not eligible for the check-in"+later))
+ fmt.Println(muted.Render("·"), r.User, muted.Render("not eligible for the check-in"+checkinWhy(r.Msg)+later))
case provider.CheckinInactive:
- fmt.Println(muted.Render("·"), r.User, muted.Render("no check-in event now"+later))
+ fmt.Println(muted.Render("·"), r.User, muted.Render("no check-in event now"+checkinWhy(r.Msg)+later))
case provider.CheckinCaptcha:
fmt.Println(muted.Render("·"), r.User, muted.Render(strings.TrimSpace("asks for a captcha: check in in its own app "+r.Msg)))
case provider.CheckinOwnApp:
@@ -803,6 +802,24 @@ func checkinWorkBuddy(asJSON bool) error {
return nil
}
+// checkinAll checks in every account that has a daily check-in: the
+// built-ins' and each plugin's; a test's seam.
+var checkinAll = func(ctx context.Context) []provider.WorkBuddyCheckin {
+ rs := append(provider.CheckInWorkBuddy(ctx), provider.CheckInTrae(ctx)...)
+ rs = append(rs, provider.CheckInMiniMax(ctx)...)
+ rs = append(rs, provider.CheckInQoder(ctx)...)
+ return append(rs, provider.CheckInPlugins(ctx)...)
+}
+
+// checkinWhy is why a check-in had nothing to claim, in the vendor's or
+// plugin's own words, set after its label (plugins#304); empty without.
+func checkinWhy(msg string) string {
+ if msg = strings.TrimSpace(msg); msg != "" {
+ return " · " + msg
+ }
+ return ""
+}
+
// accountNamed is the saved account of agent that user names: its name as
// magpie lists it ("[email protected] · Team"), or the email alone when only one of
// the agent's accounts has it.
diff --git a/internal/cli/checkin_why_test.go b/internal/cli/checkin_why_test.go
new file mode 100644
index 000000000..24649fe30
--- /dev/null
+++ b/internal/cli/checkin_why_test.go
@@ -0,0 +1,43 @@
+package cli
+
+import (
+ "context"
+ "strings"
+ "testing"
+
+ "github.com/yetone/magpie/internal/provider"
+)
+
+// plugins#304: an inactive or ineligible check-in says the plugin's (or
+// vendor's) reason beside its label; one without a reason reads as before.
+func TestCheckinSaysWhyNoneWasOffered(t *testing.T) {
+ const why = "Qoder check-in: Qoder offered this device's identity no daily credits campaign right now"
+ old := checkinAll
+ t.Cleanup(func() { checkinAll = old })
+ checkinAll = func(context.Context) []provider.WorkBuddyCheckin {
+ return []provider.WorkBuddyCheckin{
+ {User: "arno", By: "plugin:qoder", Vendor: "Qoder", Outcome: provider.CheckinInactive, Msg: why},
+ {User: "lei", By: "trae", Outcome: provider.CheckinIneligible, Msg: "this device has checked in today"},
+ {User: "ann", By: "plugin:qoder", Vendor: "Qoder", Outcome: provider.CheckinInactive},
+ {User: "bo", By: "plugin:qoder", Vendor: "Qoder", Outcome: provider.CheckinInactive, Msg: why, Again: true},
+ }
+ }
+ out, err := stdoutOf(t, func() error { return checkinWorkBuddy(false) })
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, want := range []string{
+ "Qoder arno no check-in event now · " + why,
+ "Trae CN lei not eligible for the check-in · this device has checked in today",
+ "Qoder bo no check-in event now · " + why + " · magpie asks again later",
+ } {
+ if !strings.Contains(out, want) {
+ t.Errorf("missing %q in\n%s", want, out)
+ }
+ }
+ for _, l := range strings.Split(out, "\n") {
+ if strings.Contains(l, "Qoder ann") && !strings.HasSuffix(strings.TrimSpace(l), "ann no check-in event now") {
+ t.Errorf("no reason, as before: %q", l)
+ }
+ }
+}
diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css
index 9e8f00251..19cca3363 100644
--- a/internal/gui/assets/app.css
+++ b/internal/gui/assets/app.css
@@ -987,11 +987,11 @@ body.window .field.solo { grid-column: auto; }
.wb-checkin { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wb-checkin .ci-say { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.wb-checkin .ci-say > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-/* a failed check-in's reason wraps under it rather than ending in "…" (#821) */
-.wb-checkin[data-state="bad"] { flex-wrap: wrap; align-items: flex-start; }
-.wb-checkin[data-state="bad"] .ci-say { flex: 1 1 180px; align-items: flex-start; }
-.wb-checkin[data-state="bad"] .ci-say > span { white-space: normal; overflow-wrap: anywhere; }
-.wb-checkin[data-state="bad"] .ci-dot { margin-top: 4px; }
+/* a failed check-in's reason, or why none was offered (plugins#304), wraps under it rather than ending in "…" (#821) */
+.wb-checkin[data-state="bad"], .wb-checkin[data-why] { flex-wrap: wrap; align-items: flex-start; }
+.wb-checkin[data-state="bad"] .ci-say, .wb-checkin[data-why] .ci-say { flex: 1 1 180px; align-items: flex-start; }
+.wb-checkin[data-state="bad"] .ci-say > span, .wb-checkin[data-why] .ci-say > span { white-space: normal; overflow-wrap: anywhere; }
+.wb-checkin[data-state="bad"] .ci-dot, .wb-checkin[data-why] .ci-dot { margin-top: 4px; }
.wb-checkin .ci-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.wb-checkin .ci-dot.ok { background: var(--green); }
.wb-checkin .ci-dot.bad { background: var(--red); }
diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js
index 56728b129..17353e81d 100644
--- a/internal/gui/assets/app.js
+++ b/internal/gui/assets/app.js
@@ -17731,10 +17731,9 @@ function checkinRow(q, first, subs) {
text = t("Checked in today") + (r.credit ? " +" + r.credit : "") + (r.streak ? " · " + t("{n}-day streak", { n: r.streak }) : "");
break;
case "ineligible":
- text = t("Not eligible for the daily check-in") + (r.again ? " · " + t("magpie asks again later") : "");
- break;
case "inactive":
- text = t("No check-in event now") + (r.again ? " · " + t("magpie asks again later") : "");
+ text = t(r.outcome === "inactive" ? "No check-in event now" : "Not eligible for the daily check-in") + (r.msg ? " · " + r.msg : "") + (r.again ? " · " + t("magpie asks again later") : "");
+ if (r.msg) row.dataset.why = "";
break;
case "captcha":
// the vendor wants a captcha, which magpie never solves
@@ -23629,9 +23628,8 @@ function wbCheckinLine(r) {
return t("{user} checked in today", { user: r.user }) + (r.credit ? " +" + r.credit : "")
+ (r.streak ? ", " + t("{n}-day streak", { n: r.streak }) : "");
case "ineligible":
- return t("{user} is not eligible", { user: r.user });
case "inactive":
- return t("{user}: no check-in event now", { user: r.user });
+ return t(r.outcome === "inactive" ? "{user}: no check-in event now" : "{user} is not eligible", { user: r.user }) + (r.msg ? " · " + r.msg : "");
case "captcha":
return t("{user} is asked for a captcha; check in in the app", { user: r.user });
case "own-app":
diff --git a/internal/gui/tests/checkin-reason.test.cjs b/internal/gui/tests/checkin-reason.test.cjs
new file mode 100644
index 000000000..1dc8d38bd
--- /dev/null
+++ b/internal/gui/tests/checkin-reason.test.cjs
@@ -0,0 +1,109 @@
+// Run with Node's test runner and Playwright on the module path; see README.md.
+// plugins#304 (ReneXiong): Qoder's plugin read this machine's own device
+// identity, sent it, and was offered no daily credits; it said why in its
+// message, and magpie showed a bare "No check-in event now". An inactive or
+// ineligible check-in now shows the plugin's (or vendor's) message beside
+// the label, on the account's Usage card, wrapped rather than cut off, and
+// in Settings' check-in line; one without a message reads as before.
+// English, Simplified and Traditional Chinese, Japanese and German, the
+// window and the panel's 440px; the API is faked here.
+const assert = require("node:assert/strict");
+const fs = require("node:fs/promises");
+const path = require("node:path");
+const { test } = require("node:test");
+const { chromium, webkit } = require("playwright");
+const { watchSettingsReads, settingsDrawn, reach } = require("./reader.cjs");
+
+const assets = path.resolve(__dirname, "../assets");
+const today = new Date(Date.now() + 8 * 3600e3).toISOString().slice(0, 10);
+const WHY = "Qoder check-in: Qoder offered this device's identity, read from this machine's own Qoder runtime-info, no daily credits campaign right now. Qoder decides per device whether to offer it; if Qoder desktop shows today's credits, claim them there";
+const NOPE = "this device has checked in today";
+const checkins = [
+ { user: "arno", by: "plugin:qoder", vendor: "Qoder", day: today, outcome: "inactive", msg: WHY },
+ { user: "lei", by: "plugin:qoder", vendor: "Qoder", day: today, outcome: "ineligible", msg: NOPE },
+ { user: "ann", by: "plugin:qoder", vendor: "Qoder", day: today, outcome: "inactive" },
+];
+const quotas = () => checkins.map((c) => ({
+ provider: "plugin:qoder", name: "Qoder", plan: "Pro", user: c.user, windows: [{ name: "Credits", used: 1 }],
+ checkins: true, checkinBy: "plugin:qoder", checkin: c,
+}));
+
+function serve(lang) {
+ const settings = { theme: "light", lang, quotaLeft: false, currency: "usd", pluginCheckins: { qoder: true },
+ checkinPlugins: [{ id: "qoder", name: "Qoder", on: true, checkins }] };
+ return async (route) => {
+ const url = new URL(route.request().url());
+ const json = (data) => route.fulfill({ json: data });
+ if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
+ if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
+ if (url.pathname === "/api/state") {
+ const { checkinPlugins, ...saved } = settings;
+ return json({ agents: [], profiles: [], settings: saved });
+ }
+ if (url.pathname === "/api/settings") return json(settings);
+ if (url.pathname === "/api/providers") return json({ providers: [], presets: [], excluded: [], gateway: { running: true, window: true } });
+ if (url.pathname === "/api/usage/quotas") return json(quotas());
+ if (url.pathname === "/api/groups") return json({ groups: [], models: [] });
+ if (url.pathname === "/api/plugins") return json({ plugins: [] });
+ if (url.pathname.startsWith("/api/")) return json({});
+ const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);
+ const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];
+ try { await route.fulfill({ body: await fs.readFile(file), contentType }); } catch { await route.fulfill({ status: 404, body: "" }); }
+ };
+}
+
+const words = {
+ en: { inactive: "No check-in event now", ineligible: "Not eligible for the daily check-in", user: "arno: no check-in event now", nope: "lei is not eligible" },
+ zh: { inactive: "当前没有签到活动", ineligible: "不符合签到条件", user: "arno:当前没有签到活动", nope: "lei 不符合签到条件" },
+ "zh-TW": { inactive: "目前沒有簽到活動", ineligible: "不符合簽到條件", user: "arno:目前沒有簽到活動", nope: "lei 不符合簽到條件" },
+ ja: { inactive: "現在チェックインイベントはありません", ineligible: "毎日のチェックインの対象外です", user: "arno:現在チェックインイベントはありません", nope: "lei は対象外です" },
+ de: { inactive: "Derzeit keine Check-in-Aktion", ineligible: "Nicht berechtigt für den täglichen Check-in", user: "arno: derzeit keine Check-in-Aktion", nope: "lei ist nicht berechtigt" },
+};
+
+for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
+ for (const lang of ["en", "zh", "zh-TW", "ja", "de"]) {
+ const w = words[lang];
+ for (const width of [900, 440]) {
+ test(`${engine} ${lang} ${width}px: an inactive or ineligible check-in says the plugin's reason`, async (t) => {
+ const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
+ t.after(() => browser.close());
+ const page = await (await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: "reduce" })).newPage();
+ page.setDefaultTimeout(5000);
+ const errors = [];
+ page.on("pageerror", (e) => errors.push(e.message));
+ await page.route("**/*", serve(lang));
+ await watchSettingsReads(page);
+ await page.goto("http://magpie.test/?view=usage");
+ await settingsDrawn(page);
+ const of = (user) => page.locator(".wb-checkin").nth(checkins.findIndex((c) => c.user === user));
+ await page.locator(".wb-checkin").nth(2).waitFor();
+ const says = (await page.locator(".wb-checkin .ci-say").allInnerTexts()).map((s) => s.trim());
+ assert.equal(says[0], w.inactive + " · " + WHY, "the plugin's reason beside the label");
+ assert.equal(says[1], w.ineligible + " · " + NOPE);
+ assert.equal(says[2], w.inactive, "no message reads as before");
+ // the reason wraps in the row: cut off with "…" it read as none
+ const span = page.locator(".wb-checkin .ci-say > span").first();
+ const fits = await span.evaluate((e) => e.scrollWidth <= e.clientWidth + 1 && e.getBoundingClientRect().height > 20);
+ assert.ok(fits, "the reason wraps rather than being cut off");
+ assert.equal(await of("arno").getAttribute("data-why"), "");
+ assert.equal(await of("ann").getAttribute("data-why"), null);
+ assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), "no sideways scroll on Usage");
+
+ // Settings' check-in line under the plugin's switch says it too
+ await page.goto("http://magpie.test/?view=settings&tab=usage");
+ await settingsDrawn(page);
+ const tab = page.locator("#warmTab-plugins");
+ await tab.waitFor();
+ await reach(page, tab);
+ await tab.click();
+ const sub = page.locator('#pluginCheckinList .row[data-provider="qoder"] .sub');
+ await sub.waitFor();
+ const text = (await sub.innerText()).replace(/\s+/g, " ");
+ assert.ok(text.includes(w.user + " · " + WHY), text);
+ assert.ok(text.includes(w.nope + " · " + NOPE), text);
+ assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), "no sideways scroll in Settings");
+ assert.deepEqual(errors, []);
+ });
+ }
+ }
+}
diff --git a/internal/provider/migrate_qoder.go b/internal/provider/migrate_qoder.go
index 9d311e033..94f56072d 100644
--- a/internal/provider/migrate_qoder.go
+++ b/internal/provider/migrate_qoder.go
@@ -24,7 +24,7 @@ func init() {
func qoderMover(id string) *mover {
return &mover{
pkg: "@magpie-community/opencode-qoder-auth",
- min: "0.2.31", // 0.2.31: every call of one prompt's tool loop is one Qoder task (one request_set_id, business.id and begin_at; stage start, then processing), as Qoder.app's client sends it, and a harness's session id names the session (plugins #330); 0.2.30: Qoder CN's daily check-in sends Qoder CN's own device identity (its runtime-info, environment 0) when Qoder CN desktop or CLI is installed, and says to install it when nothing is offered without one (#2911, plugins #304); 0.2.28: a request Qoder queues (10605) waits its turn in Qoder's queue, asking its queue status as Qoder's client does, and is sent again, for up to 4 minutes, before the 503 (wallance on Discord); 0.2.27: a check-in on a computer without Qoder's runtime-info helper settles for the day with what to install, instead of retrying all day (plugins #304); 0.2.26: a Codex request marks its prompt for Qoder's cache as Qoder's client does, so the Ultimate model's cache hits are no longer 0% (plugins #290), and the intl check-in finds a machine-wide Windows install's runtime info under Program Files; 0.2.25: the international sign-in sends no redirect_uri, so a Mac with Qoder.app installed finishes in the browser tab instead of being handed to the desktop app (plugins #276); 0.2.24: Qoder's 400 "Error in upstream response" (the model's own vendor failing) is a 502, so magpie asks again or falls back, not the client's fault (SlouchyQuill507 on Discord); 0.2.23: Cosy-Version claims the desktop app's worker runtime, 1.1.69, beside its desktop client type and machine identity (plugins #281); 0.2.22: a tool result whose call lost its id answers that call, not an orphan Qoder refuses (plugins #277, #278); 0.2.21: Qoder CN signs in with a personal access token, and a PAT account gets the daily check-in; 0.2.20: unnamed tool-call fragments stay out of the chat history; 0.2.19: a model list that can't be read is a 502, so a group falls back to its next member (plugins #249); 0.2.18: a 10605 trimmed or wrapped is the model's queue busy, not a lapsed sign-in (plugins #185); 0.2.17: the daily check-in through auth.checkin (plugins #179); 0.2.16: a tool call written into the text that can't be read, or that the stream ends inside, ends the turn as an error (a 502, or the stream's error frame with no finish), never as the answer (plugins #132); 0.2.14: Qoder's 403 code 10605 (the model's queue busy) is a 503 with Retry-After, not a lapsed sign-in; quota and credit codes (110, 112–119, 122) are 429, refusals of the request (406, 416, 430, 80411, 80412, 100400, 100401, 100403) are 400, and only 105 or no code is "sign in again" (plugins #98); 0.2.13: models are listed from Qoder's app scene first, so its new default Fast 0.8× shows (plugins #97); 0.2.12: a chat Qoder refuses keeps Qoder's own reason in the error; 0.2.11: a Qoder CN enterprise VPC account keeps its model list and renewal mark apart from a public account with the same uid (plugins#40); international check-in finds the device identity runtime Qoder CLI caches on macOS and Linux and the Linux desktop installs in /opt/Qoder (ARNO on Discord); sends Qoder's native device identity, without which the daily 100 credits aren't listed (#1268); Qoder CN enterprise VPC (0.2.8); the daily credits claimed through the account's fetch (ARNO on Discord); Qoder CN as "qoder-cn", its device-token chat as the built-in's; each model's credit rate; the sign-in renewed ahead of time through auth.refresh; token usage read; each model's context the largest window Qoder offers it (#722); the window a request is sent holds the reply's max_tokens (#700)
+ min: "0.2.32", // 0.2.32: a check-in asked with this machine's own device identity and offered nothing says so, and that Qoder desktop can claim it, instead of a bare inactive (plugins #304); 0.2.31: every call of one prompt's tool loop is one Qoder task (one request_set_id, business.id and begin_at; stage start, then processing), as Qoder.app's client sends it, and a harness's session id names the session (plugins #330); 0.2.30: Qoder CN's daily check-in sends Qoder CN's own device identity (its runtime-info, environment 0) when Qoder CN desktop or CLI is installed, and says to install it when nothing is offered without one (#2911, plugins #304); 0.2.28: a request Qoder queues (10605) waits its turn in Qoder's queue, asking its queue status as Qoder's client does, and is sent again, for up to 4 minutes, before the 503 (wallance on Discord); 0.2.27: a check-in on a computer without Qoder's runtime-info helper settles for the day with what to install, instead of retrying all day (plugins #304); 0.2.26: a Codex request marks its prompt for Qoder's cache as Qoder's client does, so the Ultimate model's cache hits are no longer 0% (plugins #290), and the intl check-in finds a machine-wide Windows install's runtime info under Program Files; 0.2.25: the international sign-in sends no redirect_uri, so a Mac with Qoder.app installed finishes in the browser tab instead of being handed to the desktop app (plugins #276); 0.2.24: Qoder's 400 "Error in upstream response" (the model's own vendor failing) is a 502, so magpie asks again or falls back, not the client's fault (SlouchyQuill507 on Discord); 0.2.23: Cosy-Version claims the desktop app's worker runtime, 1.1.69, beside its desktop client type and machine identity (plugins #281); 0.2.22: a tool result whose call lost its id answers that call, not an orphan Qoder refuses (plugins #277, #278); 0.2.21: Qoder CN signs in with a personal access token, and a PAT account gets the daily check-in; 0.2.20: unnamed tool-call fragments stay out of the chat history; 0.2.19: a model list that can't be read is a 502, so a group falls back to its next member (plugins #249); 0.2.18: a 10605 trimmed or wrapped is the model's queue busy, not a lapsed sign-in (plugins #185); 0.2.17: the daily check-in through auth.checkin (plugins #179); 0.2.16: a tool call written into the text that can't be read, or that the stream ends inside, ends the turn as an error (a 502, or the stream's error frame with no finish), never as the answer (plugins #132); 0.2.14: Qoder's 403 code 10605 (the model's queue busy) is a 503 with Retry-After, not a lapsed sign-in; quota and credit codes (110, 112–119, 122) are 429, refusals of the request (406, 416, 430, 80411, 80412, 100400, 100401, 100403) are 400, and only 105 or no code is "sign in again" (plugins #98); 0.2.13: models are listed from Qoder's app scene first, so its new default Fast 0.8× shows (plugins #97); 0.2.12: a chat Qoder refuses keeps Qoder's own reason in the error; 0.2.11: a Qoder CN enterprise VPC account keeps its model list and renewal mark apart from a public account with the same uid (plugins#40); international check-in finds the device identity runtime Qoder CLI caches on macOS and Linux and the Linux desktop installs in /opt/Qoder (ARNO on Discord); sends Qoder's native device identity, without which the daily 100 credits aren't listed (#1268); Qoder CN enterprise VPC (0.2.8); the daily credits claimed through the account's fetch (ARNO on Discord); Qoder CN as "qoder-cn", its device-token chat as the built-in's; each model's credit rate; the sign-in renewed ahead of time through auth.refresh; token usage read; each model's context the largest window Qoder offers it (#722); the window a request is sent holds the reply's max_tokens (#700)
agents: []string{id},
out: func() ([]Moving, error) {
// nothing else writes the pairs while they are read
diff --git a/internal/tui/checkin_why_test.go b/internal/tui/checkin_why_test.go
new file mode 100644
index 000000000..3f5e26f8b
--- /dev/null
+++ b/internal/tui/checkin_why_test.go
@@ -0,0 +1,41 @@
+package tui
+
+import (
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/yetone/magpie/internal/provider"
+)
+
+// plugins#304: an inactive or ineligible check-in says the plugin's (or
+// vendor's) reason after c, and its account line points to c for it; one
+// without a reason reads as before.
+func TestCheckinSaysWhyNoneWasOffered(t *testing.T) {
+ const why = "Qoder check-in: Qoder offered this device's identity no daily credits campaign right now"
+ now := time.Date(2026, 10, 24, 15, 0, 0, 0, time.FixedZone("CST", 8*3600))
+ day := provider.CheckinDay(now)
+ r := provider.WorkBuddyCheckin{User: "arno", By: "plugin:qoder", Vendor: "Qoder", Day: day, Outcome: provider.CheckinInactive, Msg: why}
+ if w := checkinWords(r); w != "Qoder arno: no check-in event now · "+why {
+ t.Errorf("inactive: %q", w)
+ }
+ if c := checkinCell(provider.SubscriptionQuota{Checkins: true, Checkin: &r}, now); !strings.Contains(c, "no event now · c says why") {
+ t.Errorf("inactive cell: %q", c)
+ }
+ n := provider.WorkBuddyCheckin{User: "lei", By: "trae", Day: day, Outcome: provider.CheckinIneligible, Msg: "this device has checked in today"}
+ if w := checkinWords(n); w != "Trae CN lei isn't eligible for the check-in · this device has checked in today" {
+ t.Errorf("ineligible: %q", w)
+ }
+ a := r
+ a.Again = true
+ if w := checkinWords(a); !strings.HasSuffix(w, "magpie asks again later · "+why) {
+ t.Errorf("again: %q", w)
+ }
+ r.Msg = ""
+ if w := checkinWords(r); w != "Qoder arno: no check-in event now" {
+ t.Errorf("no reason: %q", w)
+ }
+ if c := checkinCell(provider.SubscriptionQuota{Checkins: true, Checkin: &r}, now); strings.Contains(c, "why") {
+ t.Errorf("no reason cell: %q", c)
+ }
+}
diff --git a/internal/tui/pages.go b/internal/tui/pages.go
index 2ddb0b042..5dbda72ba 100644
--- a/internal/tui/pages.go
+++ b/internal/tui/pages.go
@@ -951,7 +951,7 @@ func checkinWords(r provider.WorkBuddyCheckin) string {
case provider.CheckinDone, provider.CheckinInactive, provider.CheckinIneligible:
if r.Again {
// maybe the vendor's day before (#3326)
- return who + ": " + againWords(r)
+ return who + ": " + againWords(r) + checkinWhy(r)
}
}
switch r.Outcome {
@@ -968,9 +968,9 @@ func checkinWords(r provider.WorkBuddyCheckin) string {
}
return s
case provider.CheckinIneligible:
- return who + " isn't eligible for the check-in"
+ return who + " isn't eligible for the check-in" + checkinWhy(r)
case provider.CheckinInactive:
- return who + ": no check-in event now"
+ return who + ": no check-in event now" + checkinWhy(r)
case provider.CheckinCaptcha:
return who + " asks for a captcha: check in in its own app"
case provider.CheckinOwnApp:
@@ -983,6 +983,19 @@ func checkinWords(r provider.WorkBuddyCheckin) string {
return who + " couldn't check in: " + msg
}
+// checkinWhy is why an inactive or ineligible check-in had nothing to
+// claim, in the vendor's or plugin's own words, set after its label: a
+// bare "no check-in event now" left the user guessing (plugins#304).
+func checkinWhy(r provider.WorkBuddyCheckin) string {
+ switch r.Outcome {
+ case provider.CheckinInactive, provider.CheckinIneligible:
+ if m := strings.TrimSpace(r.Msg); m != "" {
+ return " · " + m
+ }
+ }
+ return ""
+}
+
// againWords is a provisional answer (WorkBuddyCheckin.Again) in words:
// it may be the vendor's day before, so magpie asks again later (#3326).
func againWords(r provider.WorkBuddyCheckin) string {
@@ -1019,6 +1032,15 @@ func ownAppWords(r provider.WorkBuddyCheckin) string {
return name + " only gives check-in credits to its own app; check in in the " + name + " app"
}
+// whyHint points an inactive or ineligible check-in's line to c when its
+// answer says why: c asks again and says the reason.
+func whyHint(r provider.WorkBuddyCheckin) string {
+ if checkinWhy(r) == "" {
+ return ""
+ }
+ return " · c says why"
+}
+
// checkinCell is a WorkBuddy (China) or Trae CN account's check-in on its
// line: today's
// done, with the credits, or not yet; empty for an account without one.
@@ -1044,10 +1066,12 @@ func checkinCell(q provider.SubscriptionQuota, now time.Time) string {
s += sFaint.Render(fmt.Sprintf(" · %d-day streak", r.Streak))
}
return s
+ // the reason is long (plugins#304): the line points to c, whose
+ // answer says it (checkinWords)
case provider.CheckinIneligible:
- return sMuted.Render("签到 not eligible")
+ return sMuted.Render("签到 not eligible" + whyHint(*r))
case provider.CheckinInactive:
- return sMuted.Render("签到 no event now")
+ return sMuted.Render("签到 no event now" + whyHint(*r))
case provider.CheckinCaptcha:
return sMuted.Render("签到 needs a captcha · check in in its app")
case provider.CheckinOwnApp: