DeepSeek Harness Plugin

dingminhua/dsh-connect-workbuddy

Stars ★ 1467 Downloads (30d) 108,038 Category Models & Providers Added 2026-08-30 npm dsh-connect-workbuddy

Connects locally signed-in WorkBuddy models, CN and international alike, to DSH, reading each model's credit multiplier from the upstream catalog on every refresh, with per-model image input toggles, account switching backed by an auto-failing-over pool, manual daily check-in, and read-only credit overviews shown as compact pills on the card and in the composer.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-connect-workbuddy

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:dingminhua/dsh-connect-workbuddy

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

English | 中文

A DeepSeek Harness (DSH) bundle plugin that connects locally signed-in WorkBuddy models to the DSH model picker — both the CN app and the international WorkBuddy AI app are supported — with an account pool, selectable model management, and a set of read-only capabilities built around credits: every catalog refresh reads each model's credit multiplier from upstream (the x0.79 figure comes entirely from the upstream catalog; the plugin neither hard-codes it nor guesses), image input is toggled per model, multiple accounts can be switched or fail over automatically through the pool, and daily check-in plus read-only credit overviews shown as compact pills on the card and in the composer. The CN and international sides are two parallel providers (workbuddy / workbuddy-global) that can be used at the same time; the settings page separates them with tabs for convenient management. All it needs is a WorkBuddy sign-in on this machine — or one sign-in from the browser.

Icon style

At the bottom of the Capabilities tab in Settings, choose an icon style. The default is this plugin's own icon; the alternative skin follows the theme's text colour. The sidebar, page header and panel update immediately, and the choice is stored in the current browser — other browsers keep their own.

Risk notice

WorkBuddy has begun restricting requests from unofficial clients. This project does not promise that these endpoints will keep working; the day upstream tightens its rules, the plugin may stop working. Read the Disclaimer at the end of this file and judge the account risk for yourself. Using the official WorkBuddy client is always the safest choice.

It is worth stating what this plugin is actually for: saving you the trip back and forth between the WorkBuddy client and DSH. You are already signed in to WorkBuddy on your own machine; the plugin simply connects that existing sign-in to DSH's model picker so you can use it where you write code — it does not supply accounts, share credentials, or bypass billing. Every call spends your own account's quota at the multiplier upstream reports, and the plugin never modifies account state; it carries no privilege escalation or credit-farming capability of any kind.

It depends on the WorkBuddy client's own endpoints (not a public API), so the plugin may need to follow along when upstream changes them — that is normal for a tool of this kind, and it is the reason this notice exists. Judge the account risk yourself before deciding to install.

Features

  • Dual parallel providers (CN + international) — the CN side registers as the workbuddy provider (GLM-5.3, DeepSeek-V4-Pro, Kimi-K3, MiniMax-M3, Hy3, etc.), the international side as workbuddy-global (GPT-5.6, Gemini-3.5-Flash, GLM-5.3, Kimi-K3, etc.). A region's models appear in the DSH model picker when that region has an account: with accounts on both sides, both rosters are selectable at once, and different sessions can each pick a side without interfering. A region with no local sign-in lists no models — it cannot serve a single request, so listing them would offer nothing but failures. Sign in once for that region and its models come back on "detect accounts again" or after a restart; the provider itself stays registered either way, because its settings page is how you sign in (re-detection lives in the pool block). Model names carry the upstream credit multiplier (e.g. GLM-5.3 · x0.79), matching WorkBuddy's own model menu.

  • Tabbed settings page — the page's top carries a "Domestic / Global" tab bar; each tab holds its own account pool and model management. Account, directory, selection, and unsaved drafts are fully isolated per tab — switching accounts or refreshing models on one tab never touches the other side's runtime catalog or sessions.

  • Switch either provider off on its own — each tab carries an on/off checkbox (both checked by default). Unchecking one withdraws that provider from DSH's model picker entirely (it is not merely a hidden tab): its adapter route and its "Settings → Models" directory entry are both pulled, and startup no longer sends pointless requests for it. Account, credits, directory, and selection are all kept, and re-checking restores everything. The typical use is "I have no use for the international side" — switch it off and keep the picker clean. Note: a session that had already selected a model from the switched-off provider will report NO_ADAPTER on its next call; the card states this plainly on the switched-off tab instead of failing silently.

  • Model management — refresh the full catalog from upstream and enable or disable each model individually; your ticks are a draft that only takes effect on save, but the directory and its prices are not (issue #214). A refresh records what it just read and applies it immediately, because a price is not an edit — the upstream changes those rates whenever it likes, and hiding a new one in a draft is what made the card show a stale figure while /models/refresh reported the fresh one (the reporter measured glm-5.3 arriving as 0.69 from the refresh while the card still drew 0.79). Your selection, context budgets, image ticks and default reasoning tiers are still committed only by Save; a refresh never writes unsaved edits of those for you. Upstream also reports credit multiplier, context/output limits, and reasoning efforts; every model row carries a "default reasoning" picker (issue #179): which tier that model uses when a request names none — new conversations, compaction summaries and session titles are all such requests. The options are exactly the tiers that model declares (across one roster deepseek/glm-5.3 say low/high/max, glm-5.2 says high/xhigh, space-bunny has five), so this can only be chosen per model and not once for the route, and the first option names the tier that will actually be used — the level WorkBuddy declares for that model, or (when it declares none) that model’s own middle tier, never its weakest one, so an unset choice cannot quietly turn thinking down. This picker also replaces the old read-only "Reasoning: …" line — it already lists every tier, so saying it twice adds nothing. "Turn thinking off" is not here: that stays the job of the off checkbox below. image input is decided by a verified table: a refresh pre-checks only models the table records as natively multimodal, leaves documented text-only models unchecked, and treats any id without a source as unverified and unchecked rather than guessing. The table carries two evidence tiers — vendor documentation (13 entries) and the upstream catalog's own description (2 entries: space-bunny and minimax-m3.1-flash, whose descriptions say “native multimodal”) — while a NEW id still needs a vendor source; see the “Image input” section of docs/DESIGN.md. Upstream's supportsImages is a platform declaration, not the model's capability, so it does not drive that decision at all. You can still tick any box by hand, and your selection is kept locally. Every model row also carries a “Can disable” (off) checkbox: it decides whether that model gets the “turn thinking off entirely” level. The default comes from a reviewed built-in table (the 9 models that claim the capability but answer HTTP 400 for it start unticked), and you can change it per model — untick for a model you do not need the level on. The 9 tabled models cannot be ticked at all (their row is marked "refuses off" with an explanatory tooltip): the level is not merely an extra option — pi-ai uses it as the DEFAULT for every request that names no tier, and a compaction summary is exactly such a request, so one tick made every /compact for that model fail with HTTP 400 / code 11133 (issue #83). Models outside the table are still decided entirely by your selection and their own declaration; your ticks are saved on first save and recomputed no further.

  • Campaign badges on model rows — the upstream model catalog carries campaign information (free trials, night discounts, limited-time free use, subscription-only tiers, and the like). The plugin adds no extra request (it reuses the catalog configuration it already fetches when refreshing models) and draws a pill badge right on the model row: the upstream supplies both the colour and the wording, and hovering shows the upstream's campaign text, its start/end dates, and its daily window (e.g. “night 23:00–7:50”). A badge is a function of the current moment: it shows only inside the window the upstream declares and disappears on its own when that window closes; a window that crosses midnight is judged in the timezone the upstream declared; when several campaigns hit the same model, only the highest-priority one is drawn. A benefit marker without an end date (such as “subscription only”) stays until upstream withdraws it. The multiplier shown is the price you actually pay: while a “night discount” is running, the card and the picker both show the discounted x0.06 instead of the catalog figure, and both go back on their own when the window closes — no restart needed (issue #120). A badge is a hint, not behaviour — it reports the campaign and discount upstream currently advertises, and makes no choice for you. The same badge now appears in the DSH model picker: every menu row draws the identical pill after the model name and before the load icon — menu rows use the upstream's short wording ("night", "free"), the composer trigger beside the input uses the full one ("night discount", "exclusive free"); judged from the same data at the same clock, because the screen where the model is chosen is exactly where "is it free right now" matters most. (Both regions' catalogs ship the campaign fields: read as the app, the CN /v3/config carries 8 promotions + 1 tier badge and the global one carries 5 + 1; the evidence and the decision rules are written up in docs/PROMO_BADGE.md.)

  • Model load on model rows (CN only) — the upstream answers "how busy is this model right now" from a separate read-only probe (POST /v2/chat/busy, up to 50 ids per call, free, no account state touched). The plugin asks it once per catalog refresh and draws the level as a small figure beside the model name: the number of people = how many are queueing (healthy normal = one yellow figure, busy = two orange ones, congested = three red ones), while idle is a green rocket (nobody is queueing = full speed ahead) — idle is deliberately not drawn as "one green person", because at 12px "nobody is waiting" and "one person is waiting" have to be distinguishable at a glance; unavailable is a crossed-out figure. The probe's own unknown draws nothing: "we were told nothing" is never reported as "all good". Colours follow the theme and the title tooltip ("极度拥堵") is still there. The level is not persisted: the catalog is a fact that survives a restart, a load level is a fact about that minute, so it is stamped onto the runtime catalog only and dies with the process; a failed probe logs one warning and never blocks the refresh. Measured on the CN gateway: the probe answers byte-identically under the CLI and the app identity, the 50-id ceiling is real (62 ids → HTTP 400), and 19 models come back in 186 ms. The international region shows no load badge, because the international gateway simply does not have this endpoint — measured, www.workbuddy.ai answers 404 for /v2/chat/busy (and for the neighbouring /v3/chat/busy, /v2/models/busy and friends), while the very same credential reads its /v3/config fine (28 models) and that document carries no load or queue field at all. This is not something the plugin left unimplemented, and it is not a configuration or permission problem: upstream has never published this data for the international region. So the international region shows the model name and campaign badges only; the failed probe degrades quietly to "no badge", never blocking the model list, and the plugin never guesses a load level from latency or credits.

  • Queueing tells you your position — upstream expresses a queue with three business codes (6020 waiting, 6021 queue full, 6022 this user already at the maximum). Instead of passing along a raw upstream error, the plugin says "模型排队中:你排在第 8777 位,队列共 9021 个请求;约 7 秒后自动重试". A queue does not trigger failover: the line is shared platform-wide and bound to the model, so another account is handed the same position — no account-pool rotation, no extra requests burned. (The upstream's /v2/chat/queue/status returns an i18n KEY rather than a sentence, so the plugin never relays its message and always uses its own wording.) The "resend once it is your turn" half is not implemented — that needs the queue answer's real envelope on the OpenAI-compatible channel, and writing it unmeasured would mean code that never runs.

  • Tabbed settings page (accounts / models / capabilities / diagnostics) — the page used to be a single 3,500-pixel column that mixed two things with completely different commit semantics: operating accounts (who is serving, how much is left, switch order, check-in log) and editing the catalog (ticking models, context budgets, reasoning tiers, turning thinking off). An account change takes effect on the click; a catalog change is a draft that needs Save — so the Save button often sat three screens away from the thing it saves. Now each tab does one thing, and switching tabs neither refetches nor drops an unsaved draft (inactive panels stay mounted and are merely hidden, so they also leave the accessibility tree). The third tab, Capabilities, holds the grants: let the plugin drive the local CodeBuddy CLI, let the model buy an image on its own, where the credit readout is drawn. Each takes effect on the click and never passes through Save, and each is expected to grow sub-options of its own (a working directory for the CLI route, a size or price cap for the image tool) — which is why they no longer share one thin strip above the account table. The fourth tab, Diagnostics, is a read-only fact table: current region, upstream host, the account actually serving (by NAME, never by id), sign-in validity, how many models the catalog holds, how many are enabled, the pool switch, and the raw text of the upstream's most recent error (quoted, never translated or summarised) — its only reason to exist is to be pasted into a bug report, so it contains no control that changes a setting.

  • Optional: a sidebar entry (sidebarPanel, OFF by default) — adds a WorkBuddy row to the DSH sidebar that opens this card as a full page (with a "back to conversation" link in the top left). Squeezed into tabs inside the settings panel's 800 px, the account table, model catalog and diagnostics text each get half a screen; the full page gives them the whole column. Off by default: that row occupies a global sidebar slot shared by every installed plugin, and Settings → WorkBuddy already opens the same page — an upgrade should not take that seat on the user's behalf. The switch lives on the Capabilities tab and takes effect on the click — no Save — like every other grant there.

    • Turning it off unregisters, it does not render an empty component. A sidebar nav row is assembled from the slot entry's metadata (label plus icon), so a component that returns null yields a blank but still clickable button. The decision therefore belongs in apply (src/client/panel-switch.ts is the seam between card and entry), and switching off means dispose.
    • The first-screen state asks the host, not the browser's settings mirror. That mirror is stale on some 0.1.7 builds and whileServed fires on the namespace edge only, never on a value change — a stale false would hide the row for the whole session with no event ever correcting it. So the seed reads the host's own answer (the sidebarPanelEnabled field of the usage document).
    • Switching it off while the page is open returns you to the conversation by itself (ui-layout drops an activePanelId whose key no longer exists), so the plugin never navigates. The macOS run is recorded in docs/MAC-VERIFY-PR188-REPORT.md; the checklist is docs/MAC-VERIFY-PR188.md.
  • Model availability testing, including cooldown recovery times — working out when a limited model frees up used to mean guessing through repeated failures. Now every model row has a Test button that gives you a direct answer for whether the model works right now and, if not, when it comes back. It sends a real-volume request (about 25k input tokens), rather than "ping it and see if it answers" — because the upstream throttles on request SIZE (measured: about 20k tokens pass, about 30k are refused), so a small request looks fine while every request in a long conversation may be refused. That is exactly where "the test passes but I am limited" came from. Where the recovery time comes from: the upstream's 429 carries no Retry-After header (and no X-RateLimit-*), but it writes the reset time into the response body — {"code":6004,"msg":"…将在 2026-09-30 02:30:30 UTC+8 重置…"}. The plugin parses that time and converts it using the UTC offset the message states, so the result does not depend on your machine's timezone; the card then shows “✗ Rate limited · usable again after 2026/9/30 02:30:30”. When none of the sources states a time, the plugin never invents a countdown and says plainly that no time was given. A rate limit deliberately does not borrow the monthly refresh time, which would tell you to wait weeks for a limit that clears in seconds. A success never has a cooldown: this gateway also attaches Retry-After to a 200, and its value is the account's monthly quota reset (measured: 2026-11-01 00:00 +08:00) — not a wait. So a successful row shows “✓ Usable” and never appends “usable again after”, and records written by older builds with that stray time are healed on read. Probes run in the Host, so the credential never reaches the page, and results are not written to settings — your saved selection is untouched.

  • Image generation tool workbuddy_draw_image (CN and international, OFF by default, granted per region) — hands WorkBuddy's text-to-image capability to the agent: say "draw me a cat sunning itself on a windowsill" in the conversation and the model calls the tool itself, then posts the image back. It is off by default, because it is the one capability here where the MODEL decides to spend: about 5.71 credits an image on the CN gateway and about 0.03 on the international one, and the host offers no per-call confirmation. Tick 「Let the model draw images」 on that region's Capabilities tab to enable it; while it is off the tool is not registered at all, so the model never sees it and cannot attempt a call that would fail. Both gateways work, but through two different models: CN hunyuan-image-alpha and international hy-image-3.5 (the latter measured on 2026-10-25). The two credit pools are independent, so 5.71 and 0.03 are not a cross-region price difference for the same image — they are two different models on two different gateways, and neither number converts into the other. The grant is per region: ticking the box on one tab authorises only that gateway's accounts, and with both ticked the CN gateway wins (the only order that keeps the old behaviour). Endpoint and request body are copied from the official CLI's ImageService (POST /v2/images/generations), and the product is a 24-hour COS signed URL the plugin tells you to download in time. The same tool edits images: pass image (a local path, file://, http(s), a data URL, or bare base64, up to 8 MB) and it switches to POST /v2/images/edits with the model carrying the image-to-image tag (CN hunyuan-image-alpha-edit, international hy-image-3.5); omit it and you get text-to-image — the mode is decided solely by whether there is an input image, there is no mode parameter. Input images are only normalised into the data URL the gateway accepts: no rescaling, cropping or format conversion. An unreadable, malformed or oversized image fails before any request is sent, so it is not a paid failure. Sizes are not limited to squares, and the ceiling is about 4.19 megapixels (measured tier by tier on 2026-10-25: 1024x1536, 2048x2048, 2048x1536, 2560x1440 and 2560x1600 all succeed and come back at exactly the requested width and height, not silently downscaled; 2560x2560 and anything larger is refused outright). So the usual answers are 2560x1440 for a 16:9 desktop, 2048x2048 for a large square and 2048x1536 for a wide one; for portrait, put the long edge in the same range — beyond that you need super-resolution, the parameter itself is maxed out. It really costs money: about 5.71 credits per image on CN and 0.03 on the international gateway (both measured), so the tool description gives both magnitudes and says to trust the credit each response returns, a failure carries a 30-second cooldown (while a bad parameter, a missing sign-in or an unknown model costs nothing and does not cool down), and there is no "draw four at once" parameter that could spend uncontrollably. The definition is hand-written raw JSON Schema, adding no dependency. See docs/IMAGE_GEN.md for the evidence, protocol and live run.

    Two things to know. ① It really does spend credits — one measured probe reported credit 0.02 (a refused one 429s and costs almost nothing). So testing is manual and per-model only: there is deliberately no “Test selected” batch button, because sweeping the whole list from one click is an uncontrolled spend — and the Host enforces the same rule, accepting a single model only and refusing multi-model requests. ② The upstream advertises a 1M context yet throttles far below it, and the plugin advertises each model's native window to DSH (no longer clamped to 200K as of 3.5.0), so DSH compacts very late — hitting the throttle in a long session follows directly from that. To make DSH compact sooner, set a “DSH context budget” cap on the model's row (200K / 500K / the model's native window). Which of the three reads as current is decided by the window the backend actually derives (issue #215): with no cap set, the selected tier is the model's native window, because that is what DSH is told. The native tier means no cap — choosing it deletes the model's budget entry rather than storing a number that happens to equal the window, so it keeps following the model if the upstream ever raises it.

  • Local account switching — discovers the multiple sign-in credentials WorkBuddy's desktop app leaves behind and lets you switch per region. Tokens are never written to DSH settings.

  • Credit readout in the composer toolbar (follows the selected model, per region) — a clickable readout sits at the left of the composer toolbar (e.g. WB CN · 1,072) and switches region automatically with the model this session is using: pick a WB CN model and it shows the domestic balance, pick a WB AI model and it shows the international one; with any other provider's model it does not appear at all. It refreshes every 5 minutes and can also be refreshed by hand. Clicking it opens a panel: a table of balances per account, where clicking a row switches to that account (the same setting the card's account picker writes), and an account that cannot serve right now is labelled in its row (e.g. rate-limited, out of credits) using the same wording as the account-pool table. The per-account figures are fetched only while the panel is open, so the 5-minute background refresh never multiplies by the account count. To turn a side off, untick “Show credits in the composer toolbar” under that region's tab on the card; while a region's provider is switched off, the readout disappears and its switch is disabled. The same block carries a “Position” line: by default the readout sits in the composer toolbar (the row with the model picker); choosing “below the input box” moves it to the turn/step/token stats row instead — useful when another plugin has taken the toolbar seat.

  • Account pool: batch actions across several accounts, plus automatic failover — tick the accounts you want into a pool and you get one-click check-in for every account, one-click testing of every account against a model you choose (defaulting to the region's zero-multiplier free model), and with Enable the account pool switched on, automatic failover: a request that fails upstream is retried against the pool's other usable accounts, in order, until one serves it or none is left. Membership starts empty and is an explicit opt-in: "signed in on this machine" is not the same as "spend this account's credits and claim its rewards". The pool's ranking decides who serves every request (usable first, then expiring-credits-first, higher credits, freshest credential), and on a failure the next usable member is tried. It never writes back your saved selection — switch the pool off and your own account applies again immediately. The switch only decides whether the PLUGIN chooses — with it off, the plugin stops picking and switching accounts for you, but check-in and testing stay available (they are manual actions). Testing reuses the model rows' real-volume probe, so it does cost real credits; automatic check-in is deliberately not offered — a check-in claims real rewards, so it only ever runs when you press the button. See Account pool.

  • Enterprise / education accounts: check-in and Claim do not apply — a seat carrying an enterpriseId shows no check-in column, no benefit campaigns, and no Claim request in the pool (5.8.0, issue #129): upstream refuses the personal-entitlement write endpoints for such members (measured 10001), while its read endpoint still lists the campaigns as unclaimed — so "the read said available" can never be the reason to write. Their credits live in a different book too (enterprise usage = limit − used), and the personal credit table simply returns an empty list. The flag now reaches the pool rows (localPoolMembers, poolMembersOf, otherAccounts) and the web account rows, and it is attached the moment an account enters the pool rather than after a click discovers it is unsupported. It is deliberately not on the usage page's top-level account object (that one was fixed for the display name only, via preferredAccountName) and not on the composer pill, which renders neither button.

  • Optional: make the usage page record these calls like the official client's (5.8.0, issue #132, OFF by default) — with usageIdentity on, chat requests carry X-IDE-Name: WorkBuddy (plus X-IDE-Type: CLI and a version taken from the existing product UA, not a second hard-coded number), so the usage page's client column is no longer blank, and the conversation-identity triple becomes the official 32-character lower-case hex UUIDv7 with X-Request-ID alongside it — the gateway echoes that id as the SSE id and writes it into the usage page, so hyphenated v4 ids made one account's rows look like two different clients — while "fresh per request, all distinct" has not been relaxed. User-Agent is untouched under either setting: billing and rate limits recognise the CLI channel. The image endpoint does not follow this switch; it keeps the shape measured on 2026-10-21. It is off by default because the shape fixes nothing on its own (the three 11128 doors read message openings, a missing conversation id, and whether the first message is a system prompt — no header moves any of them) and the only measurement is a reporter's on an older build, so a purely cosmetic alignment does not get to put every account at risk first. There is also an opt-in keepPromptLast (off by default): the usage page takes the request text from the LAST user message, and the host appends its time samples, runtime context and <system-reminder> blocks AFTER what you actually typed, so that column recorded injected text; when enabled it moves those injected blocks above the real prompt — order only, except that the recorded prompt's own leading <acp …>mNNNNN</acp> marker is stripped (leave it and that column still opens with a marker, i.e. nothing was fixed); earlier messages keep theirs, because the model cites history by those ids and the only id that can never matter is the message being answered now. It stays off by default because the order is something the upstream counts and a few leading characters are removed from the real prompt. The move matches only the host's own injected prefixes, and a conversation with no injected tail is untouched byte for byte — marker included — pinned by tests written for both.

  • Optional: move each new session's title request onto the hidden lightweight model (issue #133, OFF by default) — the DSH host fires one title-generation request per new session through the same provider as the conversation, so it is billed at the main paid model's rate. With sessionTitle.enabled on, a request the plugin recognises as a title (its only user message opens with the host's template Generate the session title from this JSON array of human messages:) is re-pointed at sessionTitle.model (default wb-lite). The reporter measured 0 credits for those calls, with three caveats: it is still a real upstream request and counts toward request volume; the measurement is the reporter's account, not reproduced here; detection is fail-closed — if the host rewords the template the rewrite silently stops and billing reverts, and ordinary conversations are never touched. If the upstream rejects the model, only that session's title fails once; the conversation is unaffected. Like usageIdentity / keepPromptLast / extraInjectedPrefixes in the bullets above, sessionTitle is read once when the plugin mounts: after editing cordis.patch.yml, reload the plugin or restart DSH for the change to take effect — hot edits do not apply.

  • Benefits: a marker for what is unclaimed, plus a per-account Claim button — the card marks, account by account, anything in the upstream's benefit campaigns (compensation / gifts) that has not been claimed yet. The data comes from the upstream's own two status endpoints; in the marking stage the plugin is read-only and never calls the two write endpoints. Three display rules all follow the upstream's state: active && !claimed shows the row, claimed removes it entirely, and an expired campaign (upstream flips active to false) disappears by itself — the plugin never compares end_time against the local clock, so a skewed machine cannot argue with the server; end_time only drives the "three days left" highlight. active alone is not enough to decide: an already-claimed account still reports active: true, and reading it alone would leave a claimed campaign hanging there forever. The read reuses the check-in pipeline (once per account, cached for 30 minutes, no request while the account pool is off), and a failing endpoint counts as "unread" rather than caching "nobody has benefits". Each row ends in a solid amber Claim pill, and one click claims one campaign of one account: there is no "claim everything", because a click spends one irrevocable real entitlement — and the write route requires accountId, so the request itself cannot batch. Before writing it re-reads the status and decides again; anything already claimed or expired returns 409 without touching upstream. After a successful claim it answers with the upstream's fresh reading and refreshes the card, with no optimistic update — even a silent upstream failure cannot leave a false "claimed" behind — and it also drops that account's cached benefit state, so the pill cannot linger on a stale status.

  • Optional: a LAST-RESORT 「继续」 when the gateway refuses the request (OFF by default, 1 send by default) — when the upstream rejects with 400 and business code 11128 the turn simply ends: the plugin does not retry inside that request (its three-rung ladder already ran), it does not swap accounts (the gate matches message contents, and every account sends the same ones), and the host does not retry. This is not a fix for 11128. Fixed system fingerprints (the identity / Web GUI / @-path paragraph from #163) are byte-identical every turn, so resending only pays for the same 400 again; since 5.13.1 prepareChatBody rewrites known phrases sentence by sentence (5.14.0 adds the Web-GUI paragraph's second sentence, see #167). Only content that happens to change between turns can be helped by a new turn. Turning on the card's Capabilities switch makes the engine wait 300 ms and send 继续 through agent.followup (source.kind is workbuddy-continue, not user). The cap counts CONSECUTIVE sends (channelRejectContinue.maxConsecutive, default 1; the old default of 3 is disproven — if one cannot help, three cannot): one successful turn, or one message you type yourself, resets it; the plugin's own message does not. Subagent sessions are never touched, and neither is a session already running or with something queued. Every send spends a real request, hence OFF by default; it is also the only upstream-shaped switch whose change takes effect immediately. It can be set directly in cordis.patch.yml:

    channelRejectContinue:
      enabled: true
      maxConsecutive: 1
      text: 继续
    
  • Actionable advice when a credential is refused — when the upstream rejects the selected account's token, the plugin actually probes the other local sign-ins: if one still answers, it tells you to switch to it (with a one-click switch) instead of vaguely asking you to sign in again — re-authenticating fixes nothing while you are pinned to a revoked backup. Only when there is genuinely no other local account does it ask you to sign in again.

  • Add accounts by QR sign-in, import/export them in bulk, test or delete them one by one — the WorkBuddy desktop app is no longer a prerequisite: the card's Sign in with QR code button (labelled Sign in on the web for the international build — that region uses a browser login page, there is no QR; it sits just above More settings and acts immediately, with nothing to save) opens a dialog and takes you straight to the authorization page in your browser; if the browser blocks that, the dialog's link, copy and Open page again are the fallback. Every credential lands in the plugin's own vault ($DSH_HOME/workbuddy-vault/<region>/<accountId>.json, one file per account), and the desktop app's auth files stay read-only and are never modified. Each row of the account table gains Test and Remove: a row test reuses the same probe as the batch run, so the two are comparable; removing deletes only the copy the plugin stored and hides the account: it disappears at once and the automatic poll cannot bring it back, while Detect accounts again restores it (signing in or importing the same account clears the hide too). The desktop app's sign-in is never touched — removing means "this plugin no longer lists it", not "sign out of the app". Export / import accounts moves credentials to another machine: pick accounts to export a JSON file → choose a file and read a redacted preview (field names and whether a token is present; the token itself never enters the preview) → tick what to import. An import overwrites per account rather than duplicating, and only a record positively identified as belonging to that region is stored — a domain the plugin cannot classify is skipped and counted as skipped. See Account pool.

  • Credits live in the account pool — the member table shows each account's remaining credits and nearest expiry, and credits are the ranking's second key (more credits serves first). The queries are read-only and consume no credits.

  • Multi-candidate credential paths — probes the platform defaults for macOS / Windows / Linux in turn, overridable by environment variable or directly in the card. When nothing is found, the card lists which paths were probed and why each one failed: five distinct reasons (absent / unreadable / no usable token / encrypted with no key available / belongs to the other region), so the easiest case to misdiagnose — signed in, but the desktop app is not present — says the app must be there instead of telling you to sign in again. The belongs to the other region reason is different in kind: that sign-in is real and usable, it is simply filed under the other tab, so the card states the fix outright — switch tabs, no need to sign in again. The list says it once: the paragraph states the conclusion, the collapsed list supplies the per-path detail, and the two never repeat each other.

  • Secure loopback shim — one random port + in-process random secret per region; the real WorkBuddy token is never handed to pi-ai.

  • Command-line diagnostics — status / doctor / logout, reporting sign-in and credits per region, without a browser.

  • CLI route (optional, off by default) — Disguising requests as a CodeBuddy client to pass the channel check is an arms race, and it has already produced account-level restrictions (issue #98, code 11140). A second route skips that disguise: let the locally signed-in CodeBuddy CLI run the task itself — it reads files, runs git, edits code. Turn on cliBridge.enabled and the plugin gains a codebuddy_ask tool and a /codebuddy command, with the result injected back into the session model. While it is off, the plugin behaves exactly as before. It bypasses the client-fingerprint layer, not the account layer: it uses the same accounts from this plugin's vault, so it is not a get-out-of-jail card after a block. See CLI route.

How it works

DSH PiAiAdapter (one stack per provider)
  -> secure loopback shim (one random port + in-process random secret per region)
  -> WorkBuddyUpstreamClient
  -> CN: https://copilot.tencent.com/v2/chat/completions
  -> Global: https://www.workbuddy.ai/v2/chat/completions
  -> WorkBuddy SSE
  -> DSH executes local tools and returns their results

The CN and international sides each own a complete runtime stack — credential store, model catalog, loopback shim, adapter — with visibility filtered by credential domain (workbuddy.ai / codebuddy.ai → international, anything else → CN), so both regions' accounts can be signed in and used by different sessions at the same time. The international product has two brand domains: the desktop app signs in at workbuddy.ai, while the CodeBuddy CLI signs in at codebuddy.ai — both are international.

The model catalog comes from each region's correct source, and both read the same /v3/config document the WorkBuddy app itself consumes, as the app's own client identity (WorkBuddy/<app> WorkBuddy/<app> CLI/<cli>, the header the desktop's buildVlmGatewayHeaders builds). That is required, not cosmetic: /v3/config serves a different product configuration per client channel, and the CLI channel's answer is a strict subset of the app channel's that publishes neither modelPromotions nor modelTiers — reading as the CLI is what left the CN badge empty. Chat and the availability probe still send as the CLI agent (the conversation-identity triple is bound to the chat channel); only the catalog read uses the app identity. If CN cannot read /v3/config, it falls back to the legacy /v2/enterprises/personal/models and logs a line, so that path is used only while degraded. The credits overview comes from https://www.codebuddy.cn/v2/billing/meter/get-user-resource (international accounts auto-route to the global gateway their credential belongs to, workbuddy.ai or codebuddy.ai — tokens are not interchangeable across the two brand domains); all are read-only.

Credentials are read (read-only) from the WorkBuddy desktop app's own auth file. Refreshed tokens are kept per region in $DSH_HOME/.workbuddy-auth.cn.json and $DSH_HOME/.workbuddy-auth.global.json (two simultaneously signed-in accounts never overwrite each other; the legacy single file .workbuddy-auth.json is still read as a migration source); the desktop app's file is never written.

Encrypted credential fields: newer desktop builds (Windows first) replace the auth file's accessToken / refreshToken strings with an AES-256-GCM envelope ({"$wbEncrypted":1,"envelope":"…"}), and the account's display name (nickname) is encrypted the same way — left unopened it degrades to a bare uin number. The envelope is sealed with a field key compiled into the app itself, not a user secret — so the plugin ships no key copy. When it meets an encrypted document it runs the installed app with ELECTRON_RUN_AS_NODE and calls that app's own native binding (electron_browser_workbuddy_storage.loggerGet()) to fetch the same payload and derive the key locally: it asks the very build that wrote the file. The key is cached in process memory only — never on disk, never in logs. Plain-string documents (macOS, older Windows builds) take the original path and never spawn a child process. account.phoneNumber is encrypted there too, and the plugin deliberately neither reads nor displays it. If the app lives somewhere unusual, point WORKBUDDY_APP_EXECUTABLE at its executable.

Every model times out on a corporate network?

If every model times out while the WorkBuddy desktop app works fine on the same machine, the likely cause is a gateway blocked by TLS SNI: copilot.tencent.com is reset before any HTTP is sent (fails in milliseconds), while the app itself also uses wb.tencentbuddy.com.

Open Settings → WorkBuddy → Capabilities and set CN gateway host to https://wb.tencentbuddy.com. Leave it empty for the built-in gateway. Chat, the model catalog, check-in, credits and image generation all follow it — a chat-only fix is worse than none.

Only https is accepted, on a subdomain of copilot.tencent.com, tencentbuddy.com, workbuddy.cn or codebuddy.cn. That is not pedantry: the value is prefixed onto every request carrying Authorization: Bearer, so accepting an arbitrary URL would mean accepting an arbitrary destination for your token. The international region is unaffected — its tokens are brand-bound, and a different host only ever 401s. Measurements and design notes: docs/CN_GATEWAY_FALLBACK.md.

doctor runs in its own process and cannot see plugin settings, so that path uses an environment variable: WORKBUDDY_CN_BASE=https://wb.tencentbuddy.com dsh plugin --profile desktop exec dsh-connect-workbuddy doctor

Account pool

A machine usually carries more than one WorkBuddy sign-in. The account pool turns that into a single click: tick the accounts you want into the pool, then press Check in selected or Test selected; switch on Enable the account pool and the plugin will carry on through a failure by itself.

Each region (domestic / international) has its own independent pool — membership and target model never affect the other side, because the two sides' accounts belong to different upstream stacks.

In a narrow column this table becomes stacked cards. The configuration page lives inside the Settings panel, whose content column is 564px (800px panel minus a 188px nav rail) — five columns do not fit, so when the TABLE itself is narrower than 700px (a container query, not the viewport) each row turns into three lines: the account and its actions get a full line each, and the three facts between them share one. Measured in that column: 96px per row (was 157px, with the account name clipped to "用户75"), and the name no longer truncates. The wide layout is unchanged.

The two batch actions

  • Check in selected — signs in account by account. It reads today's status first, so an account that is already checked in is marked as such and receives no write request at all (idempotent — no duplicate claims); a single account failing marks only that row and never aborts the batch.
  • Test selected — sends one real-volume probe per member (about 25k input tokens; the same probeModel the model rows use, so it inherits both measured facts: throttling is triggered by request size, and the reset time is written into the response body rather than a header), reporting whether that account can serve that model right now.

Which model is tested: by default the zero-multiplier free model in that region's catalog (measured: the domestic catalog currently has exactly one, hy3; the name is deliberately not hard-coded, because the upstream changes multipliers — deepseek-v4.1-flash has already moved from 0 to 0.11), or a specific model you pick in the dropdown. If the model you named has left the catalog, the manual action refuses outright (target-model-stale) instead of quietly substituting another one — you asked to test that model, and swapping it answers a question you did not ask.

Cost and boundaries: testing is a real request. Pointed at the free model (multiplier 0) it costs virtually nothing, but it is not a free no-op; check-in claims that day's real reward. Both actions run only when you press the button — the plugin does not offer automatic check-in, and the card does not show a switch that can never be flipped.

Membership is an explicit opt-in, empty by default

"signed in on this machine" is not "spend this account's credits and claim its rewards". Membership starts empty and must be ticked one by one (or with Select all); an empty pool never degrades into "all accounts" — with nothing tick

…

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.