ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2f726b1f95 |
gateway: a request its vendor's risk control refused isn't sent on to the provider's other accounts (_teamtaylor_)
_teamtaylor_ on Discord: WorkBuddy's risk control spreads across accounts that send the same request, and magpie sent one request on from account to account until its tries ran out, so each account was restricted in turn. The gateway already read the refusal (WorkBuddy's 403 11140 as the plugin words it, provider.WBRestrictedHint; ZCode's 3012, ZCodeRestrictedHint) as failRestricted and rested the account 2h, but the candidate loop then went on to the next candidate, which is usually a sibling account. Now such a refusal (riskRefused: failRestricted and not a remote magpie's) walls the provider off for the rest of the request: its other accounts are dropped from the candidates (elsewhere), from busyNow's replan rounds and from roomy's left-out list (elsewhereWeighed). A group's other provider is still asked; with none left the agent gets the refusal. The last candidate's restricted refusal now rests the account too (before, only a non-last one did). Generic: any plugin ending its error in either hint gets it. The workbuddy plugin needs no change (it does no cross-account retry of its own). Run (on mote, through mote-run): - go test -count=1 -timeout 45m ./internal/gateway: ok (727s), before the rebase onto origin/main |
||
|
|
3dc25a6168 |
tests: a plugin fake's vendor counts only its own test's requests (#3357)
Run 39913278700 at |
||
|
|
b7ceb53fe4 |
provider: WorkBuddy's built-in is retired; its plugin serves it
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. |
||
|
|
091593f7d3 |
gateway, gui: a WorkBuddy account the vendor restricted (403 11140) rests 2 hours as restricted, and Routing names the appeal as the way back (#1849)
WorkBuddy answers an account it restricted for unusual activity with
403 {"code":11140,"msg":"request illegal","displayMsg":{"en":"Your
account has been restricted due to unusual activity",...}}. failure()
read it as an unknown failure, so the account rested 1-10 minutes and
was asked again, refused, all day.
What changed:
- provider: WBRestricted knows the refusal by code 11140 (top level,
data or error; number or string; whole, so 111400 isn't it) or by its
displayMsg words. wbExplain ends the built-in's error with
WBRestrictedHint.
- gateway: a new failRestricted ("restricted") rests restrictedRest, 2h:
one refused request per account per 2h, and a lifted restriction (or a
misread refusal) comes back the same afternoon; Unrest lifts it at
once. It is read from the hint in the error (restrictedSaid; both the
built-in and the plugin translate the vendor's body before failure()
sees it, so the raw JSON never reaches it in a chat try), or from the
raw body only for a WorkBuddy candidate (restrictedRefused,
isWorkBuddy), since another vendor's 11140 is its own. Bare "request
illegal" is not matched. 11128 stays promptRefused and rests nobody.
The stale-allowance shortcut skips it, as it does model refusals.
drawsWorkBuddy now uses isWorkBuddy.
- plugin: @magpie-community/opencode-workbuddy-auth 0.1.17 (plugins
caf3908) ends the error with the same hint; the mover's min is 0.1.17
so keepMovedCurrent brings moved users to it.
- gui: Routing labels the try "account restricted by the vendor", says it
rests because only the vendor lifting it brings it back and to appeal,
shows the hint translated, and the account's row has "The restriction
is lifted — try it again" (POST /api/gateway/unrest). en, zh, zh-TW, ja,
de.
- docs/subsystems/gateway-routing.md says the above.
Run: gofmt -l (clean); go vet darwin, GOOS=linux -tags nogui, GOOS=windows
on gateway, provider, gui; go test ./internal/gateway ./internal/provider
./internal/gui (ok). New Go tests use the reporter's literal body through
the vendor's shape, the built-in's and the plugin's, a string code and the
words alone; another vendor's 11140, a non-WorkBuddy account with the same
body, 11128/14018/111400 not restricted; an e2e through the fake plugin
host where the restricted account is skipped by the next request.
Broken by hand, each went red: rest case removed, restrictedSaid removed,
the match unscoped, the raw match removed, the provider hint removed.
GUI: routing-wb-restricted (chromium and webkit x en/zh/zh-TW/ja/de x
1100/420px, 20 pass), routing-wb-refused, i18n-keys; after the rebase
every GUI test of the Routing page (107 files, both engines): 103 green.
The 4 red ones fail the same in WebKit on origin/main
|