workbuddy and workbuddy-ai join retiredBuiltins, as Zed did in c0605abc2
and Qoder in 43cc3171d. @magpie-community/opencode-workbuddy-auth serves
both, moved or not.
Removed (built-in only):
- provider: workbuddy_models.go (the model list); in workbuddy.go the
sign-in, token renewal, usage/credits reading, request signing and the
site's model fetch; the WorkBuddy cases in account.go (Accounts),
logins_on.go, logins.go (list/switch/forget), login_usage.go,
subscription_usage.go and signin.go; WorkBuddyBaseForTest, now unused.
- The built-in tests: workbuddy_test, workbuddy_signin_test,
workbuddy_accounts_test, workbuddy_ai_test, workbuddy_body_test,
workbuddy_enterprise_test, workbuddy_free_test, workbuddy_names_test,
workbuddy_spare_free_test, workbuddy_refused_test (provider), and
gateway/workbuddy_refused_test.
Kept, and why:
- migrate_workbuddy.go (the mover) with what it reads: wbSite, wbCreds,
wbOwn/wbAuthPath (the desktop's file, sent as a marker), wbLogins,
wbTokens (back drops a renewed pair).
- workbuddy_checkin.go: the daily check-in now walks the plugin's
accounts only and sends through the plugin's fetch (a.via); wbCallVia,
wbNum and the site's api() serve it, and plugin_usage's host.
- WBRestricted/WBRestrictedHint: the gateway reads the plugin's 11140 by
them. textOnly: applied to the plugin's lists.
- draw_workbuddy and search_workbuddy in the gateway: they serve the
plugin's provider. The PLUGIN-SERVED notice in workbuddy.go.
- The WorkBuddy agent target (internal/agent) is untouched.
Tests changed in meaning:
- TestFetchNewAccount, TestFetchNewRetriedSoon and
TestFetchingNewOnceStarted used WorkBuddy as the built-in signed in;
they use Codex now (codexSignedIn, codexListedAt), same assertions.
- TestFetchPlanWithoutList uses local models; TestWorkBuddyFetchModels,
TestWorkBuddyAIGLMIsTextOnly and TestOwnStoreSignInAgainDropsTheReading
(WorkBuddy case) are gone with the code.
- Check-in: TestWorkBuddyCheckinSignedIn is gone; the fixture's account
is a plugin account signing through via; PluginUnderItsOwnID became
TestWorkBuddyCheckinPluginAccounts (plugin accounts listed, a built-in
login left out). TestCheckinAccountsListed reads a moved plugin.
- TestWorkBuddyMover seeds the desktop's logins.json row: retired, the
built-in no longer writes it, and an existing user's row is what moves
(red without the row).
- Gateway: the WorkBuddy draw and search tests run through the fake
plugin (besideFake), without the built-in's header checks;
TestWorkBuddySearchesForItsModels folded into
TestWorkBuddyPluginSearches (refusal and search-off checks kept);
TestLoopEndsWorkBuddysReply is the plugin route only;
TestWorkBuddyRestrictedRestsHours lost its built-in translation case.
Run:
- gofmt -l internal: empty
- go vet -tags nogui ./...; GOOS=linux and GOOS=windows the same: clean
- go test -tags nogui -count=1 -timeout 45m -run 'WorkBuddy|workbuddy|Checkin|CheckIn|FetchNew|FetchingNew|FetchPlan|Migrat|migrat|Mover|Moved|Retired|Retire|SignIn|Plugin|Draw|Search|Loop|Redact|Restricted|Images|TextOnly|Qoder|BuiltinsSay|AsksOwn|Loopback' ./internal/provider ./internal/gateway ./internal/cli ./internal/gui ./internal/qoder
first run: gateway, cli, gui ok; provider red on TestWorkBuddyMover
(above); after the fix provider ok (99s).
- Not run: whole packages, the full suite, the GUI node suite.
A model's image input is taken from models.dev and the provider's own list, and a group's from its members: only a model known to be text-only is refused an image — one whose support is unknown still gets it, and Codex, OpenCode and Pi are told which models take images. An image the user attaches for a text-only model answers 400 in the client's own format before the upstream is asked; an image earlier in the chat, or one a tool returned (Claude Code's Read, Codex's view_image, a Chat tool message), becomes a short text note, so a chat that met a picture carries on after a switch to a text-only model. Thanks @herrkaefer.
OpenCode's gateway turns away requests that do not name their conversation
in x-opencode-session ('Request is missing x-opencode-session and cannot be
routed efficiently'), and magpie never sent it. Requests to opencode.ai now
carry the agent's own session id (OpenCode's x-session-affinity, Pi's,
Codex's session_id, Claude Code's) or, when the agent sends none, an id
derived from the conversation's first user message, stable across turns;
the provider test sends one too. OpenCode's docs ask exactly this of
third-party clients, along with their own User-Agent, which magpie already
sends.
A signed-in Claude Code is now offered as a provider (claude/…) like Codex
and Copilot. Anthropic classifies another agent's system prompt as
third-party traffic even over Claude Code's OAuth, so magpie drives the
real local claude binary for every generation: the caller's tools are
bridged in over MCP (magpie claude-mcp-helper), and tool results resume
the same Claude Code turn. Token counting is estimated locally so the
OAuth token takes no side path.
No model list is compiled in any more. The built-in catalog, preset
defaults and Claude Code's alias list are gone; the picker shows the
models.dev catalog (refreshed in the background when stale) layered with
each vendor's own /models answer, and signed-in accounts fetch theirs at
start-up. Whether a model rejects temperature/top_p now comes from
models.dev rather than a name prefix.
The gateway retries a Chat request on the Responses endpoint when the
model is Responses-only, and remembers that. Recent calls keep the first
256 KB of request and response bodies, viewable in the call list. The
Usage tab shows subscription allowances (Claude, Codex, Copilot) as the
vendors report them.