ac4af582301a4e8a29245dbba767eba31334ddf9
7089
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6b4a6dcd41 |
claudetui: the Bypass Permissions disclaimer is answered as the trust question is (#5042, luzhuang)
A claude magpie spawns runs --dangerously-skip-permissions: the flag is
on the bridge's own arguments, a user's claude may be a wrapper that
adds it, and an account's default mode may be Bypass Permissions. Where
no settings source the run reads has skipDangerousModePermissionPrompt,
Claude Code 2.1.295 blocks on its disclaimer — "❯ No, exit / Yes, I
accept, Enter to confirm" — and no one was there to answer it: each run
sat on the dialog for 45s (ReadyWait), ended, and the next run asked
again, so interactive requests failed in a loop (502 or a hung restart)
until magpie fell back to claude -p.
- the helper tells the disclaimer yes where TrustEnv says so, with the
same ↓-until-"Yes"-then-Enter the trust question gets (its "No, exit"
pairs the same, and a key sent as it is first drawn is lost the same
way); Claude Code records the acceptance itself, and the next run is
shown none of it.
- where TrustEnv isn't set — the account Claude Code is signed in to, in
a caller's folder — the disclaimer is the user's to answer: the run
ends at once saying so, not after 45s.
- a disclaimer left unanswered at a run's deadline is named as such
("asked to accept running in Bypass Permissions mode, not answered"),
never "showed no prompt".
Generated-by: GLM-5.3-Flash (ZCode)
Reviewed and ported, narrowed: as written, the shim accepted the
disclaimer wherever TrustEnv was set, and the bridge sets TrustEnv for
magpie's own folder in the account Claude Code is signed in to
(configDir ""), as do the warmup and /usage runs. Accepting there makes
Claude Code write skipDangerousModePermissionPrompt into the user's own
~/.claude/settings.json, a consent for every run after that is the
user's to give. Now a separate claudetui.BypassEnv says yes, set only by
claudeBypassEnv for a tui run in an account folder of magpie's
(configDir != ""), at the bridge and both warmup sites; TrustEnv alone
ends the run at once with the "asks to accept" message. The subject's
"as the trust question is" holds for the keys sent, not for where.
On mote, with tui.go at the parent: TestShimAcceptsBypassDisclaimer FAIL
("the shim wrote 0 lines of 3 in 30s"), TestShimNeverPrints' bypass
cases FAIL ("neither answered nor ended in 30s"),
TestShimEndsAtItsCallersDeadline/bypass_disclaimer_unanswered FAIL
("showed no prompt"); green with the patch. Broken by hand: the gate
back on TrustEnv turns TestShimNeverPrints/bypass_disclaimer_with_the_
folder_trusted red, and claudeBypassEnv ignoring configDir turns
TestClaudeBypassOnlyInMagpiesAccountFolder red ("user's own account: got
[MAGPIE_CLAUDE_TUI_BYPASS=1]"). go test -timeout 45m ./internal/gateway
and ./internal/claudetui ok; GOOS=linux/windows/darwin go vet ok. Not
tried: a real Claude Code 2.1.295 showing the disclaimer under a saved
account (needs a wrapper adding the flag).
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
|
||
|
|
72abde0e0d |
steady: a served write reaps the stale temps earlier writes left beside the file (#4938)
What changed: steady.WriteFile, on a write that went through, removes the temp files a crashed or failed write of the same file left beside it - its own .<file>.<digits> shape and edit.WriteAtomic's .<file>.<digits>.tmp alike, both old enough (10 minutes) to belong to no write still going on, and only ones whose remainder is digits, so another file's temps (.models.yml.bak.1.tmp is models.yml.bak's) stand. edit.WriteAtomic reaps through the same function: one reaper, both shapes, every folder magpie writes its own files in. Nothing reaped a steady temp before - edit reaped only its own .tmp shape - so a multi-instance start-up exiting mid-write (the reaping exists beside each write, and nothing swept) left hundreds beside magpie's own files over a run, and every O_EVTONLY descriptor the directory watcher holds per file with them (#4938 Bug 1: 758 temps, 839 descriptors). A write younger than the ten minutes stays, as another write may still be on it; a stalled write that loses its temp here fails its rename and leaves the file as it was. Bug 2 beside this one is yetone's |
||
|
|
38c3ba846f |
library: an edit made in the shared copy of a skill is taken into the library (#4958)
What changed: takeEdits reads the shared copy too - ~/.agents/skills
where no link could be made (Windows without the right to), the entry a
marked copy - as it reads an agent's copy: anything newer than the
copy's mark is an edit, the newest one taken unless the library changed
after it, losers kept aside. An agent whose own folder ~/.agents/skills
is has its copy read as it was; the shared scan only runs where no
target already covered that folder. syncShared, which sets a stale copy
aside before copying again, runs after, so the edit is in the library
and every other agent's copy first.
Run:
- go test ./internal/library -run TestEditInSharedCopyTaken -count=1
RED before: the edit wasn't taken (the library's skill has no
notes.md) and the shared entry lost it; green after.
- go test ./internal/library -count=1: ok (66s).
- gofmt, go vet -tags nogui (darwin/linux/windows), builds
(darwin/linux/windows), the new test with -race: clean.
Generated-by: GLM-5.3-Flash (ZCode)
Reviewed and ported: differs from
|
||
|
|
db9d6a6107 |
gateway: a working-directory line a turn quotes is no caller's word, and a --bare run's CWD: is read (#4940)
What changed: workPlace reads the folder in two layers, as
clientNamedWorkPlace does. The caller's own layer - its instructions and
its {role: "system"} messages - is read whole: Claude Code's
" - Primary working directory:", a --bare run's "CWD: /x", pi 1.1's
"Current working directory:", Codex's and pi's <cwd>, OpenCode's <env>.
A turn of the conversation is read only for the forms a caller states in
one - <cwd>, <env>, and Claude Code's <system-reminder>, which says a
folder it moved to; a line a user message quotes ("Primary working
directory: /x" alone on its line, WardLu's P3) no longer names the
folder for a group's rule by folder, nor goes to a plugin's provider as
its WorkDirHeader. The last said still goes, wherever it sits: an agent
that moved says so after. The forms are workdir.go's own, wrapper-scoped
as the routing face pinned them; the bridge's clientNamedWorkPlace is
untouched.
Run:
- go test ./internal/gateway -run 'TestWorkDirTurnQuote|TestWorkDirBareCWD|TestWorkDirMoveReminder|TestTellWorkPlaceTurnQuote' -count=1
RED before (the quoted line named the folder; CWD: named none), green after.
- TestWorkDirOfEachAgent, TestWorkDirOpenCode, TestWorkDirLastSaidAndOnlyByTheAgent,
TestRuleByFolder unchanged and green - the agents' own shapes and the
move reminder keep working.
- gofmt, go vet -tags nogui (darwin/linux/windows), go build -tags nogui
(darwin/linux/windows), the new tests with -race: clean.
Generated-by: GLM-5.3-Flash (ZCode)
Reviewed and ported: not superseded by
|
||
|
|
e7948e2484 |
agent: a routing group with a Claude member tells Pi its cache keeps five minutes (#5037)
Pi's cacheWarming weighs a model by its promptCache and stops with
"cache lifetime unavailable" without one. magpie declared it only where
piPromptCache saw the entry's own api — anthropic-messages for a Claude,
openai-responses for a GPT — and a routing group has no api of its own
(a Messages-only group stays on Chat, allResponses), so auto/claude-*
went out with none and Pi never warmed the group's cache, while the
cache itself was there: on the Chat path the gateway marks its own
translation to a Claude member ephemeral for five minutes (addedMark).
So the group now derives the field from its members: one asked on
Anthropic's Messages by its own provider, and the entry declares the
five minutes the gateway's own marks keep. long stays out — the gateway
marks an hour only where a session's turns are often far apart, so it
isn't always true — and a subscription's Claude (asked through Claude
Code, which caches on its own) still declares none, as before. An
all-Responses group keeps what it had: its entry's own api answers.
Reviewed and ported: every line read against origin/main
|
||
|
|
0d14aa4d08 |
gateway: a model the vendor lists after the codex picks were saved still reaches the desktop catalog (#5062)
What changed
- CodexNativePicked built its keep-set from p.Models, the account list
frozen at the moment the user last picked - so a model the vendor
began listing afterwards (gpt-6.1-terra, the reporter's case) was
excluded from the desktop catalog the gateway writes for Codex
Desktop's model_catalog_json, and the picker could not see it even
though the gateway's own /v1/models served it. The keep-set now comes
from p.Picks(): the picked ids stay picked, and anything the vendor
lists since is kept beside them.
Run
- TestCodexDesktopCatalogKeepsNewlyListedBesidePicks on a3768cdd1-era
product (reverted, tests kept): FAIL - the newly listed model was
dropped from the catalog; with the fix: ok. gofmt clean; vet -tags
nogui (provider+gateway) clean.
Reviewed and ported: every line read against origin/main
|
||
|
|
8d94e3a38f |
codex: Ultra on GPT-6.1 Terra wherever it is served (#4909)
Codex's catalog (models-manager/models.json, as this machine's Codex kept
it in models_cache.json) now lists ultra on gpt-6.1-terra, alongside the
Sols, Astra and GPT-5.6 Terra; the Lunas still stop at max. magpie's list
of the models that offer it (#656) had no GPT-6.1 Terra, so one served by
another vendor (Copilot's, a key's, a relay's) was listed up to max only,
and Codex had no Ultra to pick on it — a thread pointed straight at the
vendor (CC Switch's config) sends its own effort and keeps Ultra, a
magpie-routed one was offered none. Now GPT-6.1 Terra is in the list: an
entry for it that reaches max gains ultra, in Codex's catalog and
/v1/models, and says multi_agent_version v2; a request's ultra still goes
to the model as max (fitEffort), as before.
TestUltraOnModelsThatOfferIt extends its table with gpt-6.1-terra (by the
id a vendor serves: relay/… too) and an entry for Copilot's, and fails on
the old code with OffersUltra("gpt-6.1-terra") = false and the entry left
at [none low medium high xhigh max] v2=false. go vet, builds (darwin,
GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 on the touched
packages pass.
Fixes #4909
Reviewed and ported: every line read against origin/main
|
||
|
|
8daab00a2e |
gateway: a completion call Antigravity's model wrote into its text goes out of the history, the answer it repeated staying (#5091)
What changed
- buildCodeAssistSent (internal/gateway/codeassist.go) hands an Antigravity
request's history through dropPseudoCalls (internal/gateway/textcalls.go).
- dropPseudoCalls rewrites a model turn only when nothing structured is in
it, a whole call written out in its text is there — of a tool the request
offers, its arguments readable by the readers Chat replies already go
through (<tool_call>'s JSON and pairs, an invoke with its parameters),
closed — and the text after it says the call's result again, up to
punctuation, spacing and case. The turn then goes upstream as that text
without the call. msgs is not changed: a fallback builds from the same
request.
Why
- #5091 (Phoenix12580): gemini-4-argon deep in a long session wrote the
completion call it meant into its reply's text — the report's two-sided
SSE capture shows every part Google returned is text, none a
functionCall — so the client ran nothing and read the call's arguments
as the answer's lead. The turn came back in the history as that text,
and every later turn read its own wrapper back and wrote the next one
the same way; clearing such turns from the history restored normal
calls in the report's own controlled try.
Not changed
- A reply that carries its call as text still streams as it came: the
report asks for no call read out of a live reply, and none is made.
- The gemini and vertex requests keep their histories as they came; the
report is the Antigravity route.
- A wrapper the readers can't read — a call:default_api: whose arguments
textArgs refuses, a shape with none of the marks, a call example inside
a code fence — stays in the history; the report's conditions are kept
to what can be checked.
- No receive-side counter is added: the reply's decoder has no logger of
its own, and the shapes it reads are the report's own open question.
Run
- TestAntigravityPseudoCallOutOfHistory
(internal/gateway/textcalls_pseudo_test.go): red before the change, the
wrapper, the split-block and the invoke cases each failing with the call
still in the turn, green after, and red again with the ag wiring taken
back out of buildCodeAssistSent
- go test -tags nogui -count=1 -run 'TestAntigravityPseudoCallOutOfHistory|TestCodeAssist|TestTextCall|TestTextWritten' ./internal/gateway/: ok 5.016s
- go test -race -tags nogui -count=1 -run 'TestAntigravityPseudoCall|TestCodeAssistTextCalls|TestTextWrittenCall|TestTextCalls' ./internal/gateway/: ok 2.952s
- go test -tags nogui -count=1 -timeout 25m ./internal/gateway/: ok 600.353s
- gofmt -l internal/gateway/codeassist.go internal/gateway/textcalls.go
internal/gateway/textcalls_pseudo_test.go: empty
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./...: clean
- go build, GOOS=linux go build -tags nogui, GOOS=windows go build: ok
Reviewed and ported (on origin/main
|
||
|
|
72e09cc019 |
catalog: a list's sora ids are video models, made at its OpenAI-shaped videos API (#4954)
What changed: a fetched model list keeps an id naming a video model the way it keeps one that draws (FilmsID: sora-2, sora-2-pro). OpenAI's list marks no kind, and textModel counts sora out of the chat models, so a Sora model was never listed at all: the provider editor could not mark it a video model, and startVideo answered 400 "can't make videos". A sora id now reaches the list as Films - a video model of the provider, asked at its OpenAI-shaped videos API, which the gateway already speaks - and is still no chat model. The other video families keep the faces their own APIs are asked on: Ark's Seedance at its tasks, a MiniMax key's H3, and a model the user says makes videos (#1399). Run: - go test ./internal/gateway -run TestOpenAIKeySoraMakesVideos -count=1 RED before (videomakers [] - the list carried no sora model), green after: sora-2 and sora-2-pro are the provider's video models, a video is started, polled and fetched at its /v1/videos, and neither id is among the chat models. - TestCustomProviderMakesVideos, TestCustomProviderVideoNeedsTheListsWord, TestCustomProviderVideoTheUserMarks green, the last two with the fixture's unmarked model renamed to agnes-video-2.5-flash (#1399's own case): a name alone still makes no video model, even one with "video" in it. - go test ./internal/catalog, the video family with -race, gofmt, go vet -tags nogui, builds (darwin, linux, windows): clean. Reviewed and ported (on origin/main |
||
|
|
cfadcde168 |
provider: a model list OpenCode's key is refused is asked again bare, so the picker says what the vendor serves (#4900)
What changed: OpenCode's model lists are public - the vendor answers its
/models without a key. When a provider's keyed ask of the list is
refused (an expired or wrong key), the same list is asked once more
without credentials, and what the vendor serves is saved as the
provider's list. The picker then shows the vendor's word instead of
falling back to the models.dev catalog, which files free rows under
opencode-go that Go doesn't serve (cat-jam-free, minimax-m3.1-flash-free,
step-5-preview-free, longcat-2.5-preview-free) while missing the free
rows it does (beam-free). The retry is kept to OpenCode's own hosts
(IsOpenCode): no other vendor's list is known to answer bare, and a
partial public list would stand in for the keyed one. Multi-key
providers, account (sign-in) lists and the add form's List are not
covered.
Reviewed and ported (on origin/main
|
||
|
|
c2dd693dac |
gateway: a 451 censorship_blocked refusal asks the group's next member (#5089)
StepFun's safety filter refuses a request with HTTP 451 and an error
object saying {"type":"censorship_blocked"}. filterReasons, the map of
the words a vendor says its filter stopped the reply with, didn't know
the type, so policyRefusal didn't read the 451 as a refusal and
retryable has no 451 of its own: the status went to the agent as it
came, the group's next member unasked, and the try stood as a plain
failure of the account.
The same refusal said in a 200 stream's finish_reason would have been
one, as content_filter is. Now the type is in the map, and the refusal
goes to the next member the way any refusal the vendor names does:
nobody rests, as the filter refusing is about the request, not the
account.
Reviewed and ported: one filterReasons entry, vendor-neutral, and
nobody rests as before. On mote, -run 'Censorship': with the map entry
reverted, red: "TestCensorshipBlocked451FailsOver ... whole: 451" and
"TestCensorshipBlockedIsAPolicyRefusal ... policyRefusal: "", false";
green with it. Whole package: ok (906.6s). Not tried: a real 451 from
StepFun.
Generated-by: GLM-5.3-Flash (ZCode)
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
|
||
|
|
2027bb5a6d |
gateway: a filter's finish code after the reply began asks the group's next member (#5075)
A vendor that answers with a canned refusal line as the content and has its finish_reason "content_filter" follow (#5075: CodeArts's deepseek-v4.1-flash, 10/10 on the same body, 47 tokens out, the line byte-identical) was a try that stood as a success: the line had gone out as content, so the scan's refusal paths were past, only refusedAfter was marked, the group's next member was never asked, and a client that reads finish reasons — Pi's and DeepSeek Harness's mapStopReason, Claude Code — failed the whole turn on it. Another member of the same group answered 620 tokens. refusalAfter now hands the try over (handOffAfter) when the refusal is the vendor's own finish code (eventRefusal), the reply is passing, a candidate stands behind it reading Chat chunks, and no call of the reply has gone by: what of the write went by before the code goes out with the reply, the code, its usage and [DONE] do not, and the next member's chunks follow in the same stream, as a refusal after reasoning is (handOver). The member isn't set aside: the request was refused, not the account (#248). A refusal still held goes through the scan's own paths (flow, handOver) as before; an error event mid-reply stays as it came (#733); an Anthropic or Responses client's stream is numbered and what of it has gone by is untracked, so its refusal keeps going as it came. TestRefusalAfterThinkingAndTextStays becomes TestRefusalAfterThinkingAndTextFailsOver: a Chat client is handed over now, where it ended on the vendor's finish code before. Fixes #5075 Reviewed and ported: composes with #2972 (passthrough holds the end, the hold writer sees the error event). The hand-off is held to Chat streams that sent no tool call (handsOff checks h.calls); that guard had no test, so TestFilterFinishAfterACallStays is added here: a content_filter finish after a tool_call stays with the first member and the call reaches the client. On mote, -run 'Refusal|CannedRefusal|FilterFinish': with the non-test part reverted, red: "TestCannedRefusalFinishFailsOver ... chat: 200" and "TestRefusalAfterThinkingAndTextFailsOver ... 200 (a 1, b 0)"; with the calls guard removed by hand, TestFilterFinishAfterACallStays red; green with the patch. Whole package: ok (906.6s). Not tried: a real vendor's canned refusal (CodeArts, qoder). The refusal text already streamed stays in the client's stream before the next member's answer. Generated-by: GLM-5.3-Flash (ZCode) Co-authored-by: ggbdpq <ggbdpq@gmail.com> |
||
|
|
d45e74d89f |
gateway: a length cut that said nothing is not a completed reply (#2972)
What changed: a Chat reply cut at its length having said nothing — no
text and no call, only thinking, or nothing at all — fails at once, on
the translated paths and on the passthrough Chat→Chat relay, asked
again nowhere: the error in the client's own protocol, a group's next
member asked, nobody rested, and the same one not asked again after a
moment (the void fails the same every ask, as one that didn't stream
does). It fails only past a short probe's worth: a reply that spent no
more than cutVoidTokens, of a request capped at no more, is a probe's
answer — a title's cut is wanted, the response.incomplete it was
(#1466) — and goes as it came. A length cut that said something is
still the truncation it always was.
Why: qoder/dfmodel ended four replies of one dsh turn with 48,000
output tokens each, every one of them reasoning — out == reasoning
exactly each time, 192,000 tokens and 919 seconds for nothing — and dsh
speaks openai-completions while the qoder plugin serves Chat, so all
four were relayed as they came. The relay reads its end now: a stream's
tail is held from the chunk that says why it ended while nothing has
been said in it, and a void fails with the error event in its place, no
finish_reason the agent reads as "continue" having gone out. A reply
asked whole is written once it has ended, for the same verdict. On the
translated paths the check sits beside answersNothing (cutVoidAt,
cutVoid), and holds the end events as the empty reply's already are. The
verdict sits at the reply's end, so a streamed one costs no second read.
What the review asked, and where each landed:
- the reporter's own route: the passthrough Chat→Chat relay fails the
void too, streamed (the error event and [DONE] instead of the finish)
and whole (the error with the status)
- no in-place re-ask: the void's branch is the empty reply's error
without the emptyRetries, and the same-one retries and the patience's
rounds pass it by (cutVoidWords beside didNotStream in passing and
busy), so the upstream is asked once — every test here holds the fix
to that
- a deliberately small max_tokens is no void: the gate is spent past
cutVoidTokens, or the request hadn't capped its reply small
(probeTranslated asks 16, a title less than that)
The repo's own recorded ClinePass stream (16 tokens, all reasoning,
testdata/clinepass_stream.sse) is relayed as it was, on the relay and
translated alike.
Run:
- go test -tags nogui ./internal/gateway/... -count=1: ok
- go test -race -tags nogui ./internal/gateway/ -count=1 (the stream
relays and holds among it): ok
- the five tests of chat_length_nothing_test.go red on the branch's
parent, green here; TestClinePassUpstreamRecorded green before and
after
- gofmt -l clean; go vet clean on darwin, linux, windows
- builds: darwin and windows ok; linux ok for internal/... but the wails
v3 beta 24 module's own linux files (pre-existing, untouched here)
Fixes #2972
Reviewed and ported: rebased on
|
||
|
|
ae3c2ec4e9 |
fix(netproxy): the health check pings a silent connection after 10s, not 20 (#4936)
What changed The HTTP/2 health check is the only probe of a connection whose path has died silently, so a turn in flight on such a connection waits for the next one: with PingAfter at 20s a first try read EOF came ~20.5s after it was written (Antigravity through a local proxy whose tunnel a NAT or a relay had dropped, yetone/magpie#4936), and magpie's own retry served at once on a new connection. PingAfter is 10s now: finding a dead path costs at most half of what it did, and the margin a body under uploadBytes needs on a slow uplink — the budget PingAfter+PingWait, a ping queued behind the body and answered only after its last byte (#3909) — still covers 64KB at about 3KB/s. Run go test -tags nogui -count=1 ./internal/netproxy (a new test walks a turn onto a connection whose path dies under it and watches it fail at the health check, then a retry serve on a connection of its own; a second locks the sizing) go test -tags nogui -count=1 ./internal/... — TestMothX, TestProxyCheckSaysAProxyPassedBy and TestHostToldTheGatewayAddress are red alone on the parent commit too; TestCodexPoolSaysTheClientsVersion is a known full-suite flake, green alone go vet, gofmt, GOOS=linux GOARCH=amd64 go build, GOOS=windows GOARCH=amd64 go build, go build on darwin. Reviewed and ported: every line read against origin/main |
||
|
|
f76b48ea09 |
gateway: a Chat finish of tool_calls with no call in the stream ends stop (#4944)
What changed: Hermes through magpie (stream=true, tools, deep
reasoning): a reply of text alone ended, on the reporter's upstream, on
a frame saying finish_reason "tool_calls" that no delta ever carried a
call for - the shape the reporter's bare call of the model ends its
real calls with ("delta":{"reasoning_content":null},
"finish_reason":"tool_calls","matched_stop":1); its text-only turns end
there too, and the client took every such turn for one whose calls were
dropped and re-prompted, three times a reply. The other gateway on the
same upstream said stop.
chatTidy's mend that ends a finish of tool_calls with no call left stop
(#1475) only ran for a choice some delta had carried a tool_calls key
for: the case "tool_calls" sat inside the t.called[choice] guard the
case "stop" needs, and a reply whose stream never carried the key
passed the misleading finish on. The switch now runs for every choice's
finish: a finish of tool_calls with no readable call ends stop whether
or not a delta carried the key, and the stop of a choice that made
calls still ends tool_calls. A legacy function_call a client may still
be reading (#4659) keeps a finish that says the turn ended in a call,
and a "function_call": null is still the contract's own nothing.
Whole replies are untouched: #1475's review narrowed chatWhole to a
finish whose call was dropped and pinned a whole reply that came with
no tool_calls at all as going as it came
(TestToolCallsFinishWithNoCallsStaysWhole); no report covers them.
Run: go test -tags nogui -count=1 ./internal/gateway: one red,
TestCodexPoolSaysTheClientsVersion, green on its own - the known
pre-existing red of this machine; the two new tests and the family
guards among the rest, ok. go test -tags nogui -count=1 -timeout 45m
./internal/...: 74 packages ok; the four failures are all red at the
parent
|
||
|
|
2f59545d29 |
gateway: a key not given a group listing alone is listed the members it may use (luckymanjc)
luckymanjc on Discord (#general, 11-05): on a second computer, through
Remote magpie, his three Codex accounts offered GPT-6-Luna alone, with
the key his Remote magpie uses held to "Codex 的全部模型" (codex/*),
GPT-6-Luna and the accounts. His screenshot of that key's picker, on the
host, offered GPT-6-Luna alone under Codex too.
Cause: a routing group listing alone (Group.Unlists, "the group alone")
keeps its members out of Catalog(), so out of /v1/models and the key
picker (/api/caller-keys/models), as the group stands in for them there.
Since
|
||
|
|
51bdc985bc |
provider: a cap set on a window a plugin later sets aside still holds; WorkBuddy min 0.2.24 (ferock on Discord)
WorkBuddy 0.2.24 stops an account by a new "Total credits" window (the
plan's credits and the extra ones together) and sets "Credits" and
"Extra credits" aside, so the Routing page reads every account the same,
its plan's credits spent or not. Routing skipped every window set aside,
caps included, so a cap the user had set on "Credits" would have stopped
holding the account: magpie's change overriding the user's value.
Now a window set aside, not a pool's or one model's, rides in each
limit's pool (allowanceOf), as a pool's windows do, and holds the
account at a cap set on that window itself (WindowCaps.own), never at the
account's cap or a Codex credits hold, which never reached it before.
WithCapped marks such a window Capped with OwnCap, so the GUI shows the
mark and the "at its cap" note for it, counts no account cap on it
(windowCapOf), and offers its meter as a button only while it has a cap
of its own, to change or lift it; no new cap on a window set aside.
app.js grows 48 bytes, inside the core budget (no raise).
Run (mote): go test ./internal/provider (ok) and ./internal/gui
(TestCoreScriptBudget ok); window-cap, window-cap-pool and account-cap
GUI tests, both engines, 420/1100, five languages: 136 pass.
internal/gui's TestMainWindowCorners/macOS_26_SDK (#3949) and
i18n-keys "a plugin's words are its own" (#5327, #5332) are red the same
on origin/main
|
||
|
|
a9b1877cfc |
routing: a session's name stays when a later poll answers without it (#5365)
refreshOtherNames deleted a name the page had whenever a poll of /api/gateway/session-titles came back without it, so a read that failed or ran late (ZCode's database busy or slow, Flandern1211's report) put the card back to its folder until a later poll named it again. An answer without a name is unknown, not a session that lost its name: the page now only takes new names in. 226fc8ea3 makes ZCode's poll fast; this is the "names that vanish" half of #5365, which that commit leaves alone. Co-authored-by: Flandern1211 <163982805+Flandern1211@users.noreply.github.com> Run (mote, via mote-run): - node --test internal/gui/tests/routing-session-name-kept.test.cjs (new; Chromium and WebKit, all five languages, 1100 and 420): 20 pass. With client.js at origin/main: red, the card reads "Claude Code · work/zc" after a poll without the name. - go test ./internal/gui (budgets, i18n guards): ok but TestMainWindowCorners/macOS_26_SDK, #3949. - node --test on the 8 GUI files that fake session-titles (claude-subagent-tag, routing-by-key, -credits, -moved-why, -request-metrics, -session-folder, -session-title, -sessions) and i18n-keys: 185 pass, 1 fail, i18n-keys "a plugin's words are its own" on two words in files untouched here (#5332, #5327). Not tried: the whole GUI suite (one routing file changed by four lines, no new strings, no new API call). |
||
|
|
52563d1cdf |
sessions: a ZCode name poll reads its sessions' messages for their stamp, as the listing does (#5365)
226fc8ea3 lists ZCode's sessions for Titles from their rows alone, with
size 0 and the row's time_updated as the file's stamp. Two things followed
from that stamp:
- ZCode writes a message without touching its session's row, so a session
still under its default title, first read before its prompt was in, was
never named by that prompt while only the Routing page polled.
- The cache kept size 0 and the row's time, where the Sessions page's
listing (zcodeFiles) keeps the message count and the last message's
time, so each read the session whole again after the other.
zcodeTitleStamps gives the sessions a poll asks for (their key wanted,
subagents under it too) the same count and last activity, from a
COUNT/MAX over each one's own messages by session_id, not the join over
every session's. A session whose messages can't be read keeps its row's
stamp, as before.
Co-authored-by: Flandern1211 <163982805+Flandern1211@users.noreply.github.com>
Run (mote, via mote-run):
- go test ./internal/sessions -run TestZCode -count=1 at 226fc8ea3 alone:
TestZCodeTitlesSeeNewMessages red (after the prompt: "") and
TestZCodeTitlesKeepTheListingsStamp red (kept size 0 mod
1790496000000000000, listing has size 3 mod 1790496030000000000). With
this change both green. On origin/main
|
||
|
|
24e1a21095 |
sessions: list ZCode's rows, not its messages, for a title poll
Titles listed every agent's files, and zcodeFiles joins the message table to give each session its size and last activity. On a ZCode database of 1,022 sessions and about 1 GB of messages that join took ~20 s, while the Routing page asks again every 15 s: its cards showed the folder for a while, and a poll that came back empty dropped a name it had. Titles now lists ZCode's sessions from their own rows (zcodeTitleFiles: id, parent, time_updated) and names them through the same assembleListed/parseOpenCode path as before. A ZCode subagent, which ocRoots files under its parent's key, is named from its own file's cached row when the key asked for matches no group. Run: - go test ./internal/sessions -run 'TestZCodeTitlesByRequestID|TestZCodeSubagentTitlesByRequestID|TestZCodeTitlesWithoutMessageTable|TestZCodeDefaultTitleFallsBackToFirstPrompt|TestSessionTitles|TestZCodeCalls' -count=1: ok. - go test ./internal/gui -run TestSessionTitlesNameOtherAgents -count=1: ok. - Broken by hand: with zcodeFiles (the message join) in place, TestZCodeTitlesWithoutMessageTable fails with an empty title; with the subagent fallback removed, TestZCodeSubagentTitlesByRequestID fails; with the sess_ alias removed, TestZCodeTitlesByRequestID fails. - Real ZCode database on Windows: Titles for three live sessions went from 20.4 s to 780 ms cold and 74 ms warm; a ZCode and dsh poll took 80-160 ms. - go build ./...: ok. The full sessions package has the same three Windows-only failures as before this change (TestAgySessions, TestAgyRowOnly, TestCCListingKeepsItsNames). |
||
|
|
d3a0be6dda |
provider: Google's verify link is the one Gemini CLI opens, read whole from any body (pppuuu)
pppuuu (Discord) tested an Antigravity model, got Google's 403 "Verify your account to continue." with a link, and opening the link gave Google's own "400. That's an error. The server cannot process the request because it is malformed." What magpie showed was checked first, and it was Google's validation_url whole: a realistic VALIDATION_REQUIRED body (ErrorInfo metadata with validation_url, validation_error_message, validation_url_link_text, a google.rpc.Help detail, & written raw and as &) sent through the Antigravity model test (TestAntigravityModelTest) and through the gateway to an agent (TestVerifyLinkWhole) shows the URL with every parameter on the old code too. Google's own Antigravity flow gives the same 400 to many accounts (discuss.ai.google.dev 119780: cleared google.com cookies, Chrome, or removing Antigravity from third-party access fixed it). What differed from Google's own client, and is fixed here: - Gemini CLI (classifyValidationRequiredError) opens the google.rpc.Help detail's link first, past a "Learn more" one, then the ErrorInfo's validation_link, then validation_url. magpie took validation_url first and never read validation_link. It now takes them in Gemini CLI's order. - Metadata was read as map[string]string, so one non-string value made the whole body unreadable and the link was lost; values are read one by one. - A message magpie already put the link in, passed on again as a JSON error body (a Remote magpie's, the gateway's), has & as &; the raw read stopped at the \ and found no link. It is read from the decoded words now. Tests: TestVerificationLinkWhole and TestVerificationLinkAsGeminiCLI (provider), TestVerifyLinkWhole and a verify case in TestAntigravityModelTest (gateway). Run on mote: go test -run 'TestVerification|TestAPIError' ./internal/provider ok; go test -run 'TestAntigravityModelTest|TestVerify|Restricted' ./internal/gateway ok; go vet (darwin, linux, windows) of internal/provider and go vet internal/gateway ok; go test ./internal/provider: ok (178s). Broken by hand: with the old test.go, TestVerificationLinkWhole (escaped read-back) and TestVerificationLinkAsGeminiCLI (Help link) are red; the gateway cases pass on the old code too, which is the evidence the shown link was already whole. Not tried: a real account Google wants verified (none here), and pppuuu's exact body and link, which aren't known; whether Google's Help link and validation_url ever differ is not known. |
||
|
|
1b0340fdbc |
provider: WorkBuddy's mover min is 0.2.23, which hides DeepSeek Harness's name
plugins 4912c608 (npm 0.2.23, checked --prefer-online): a "Hide DeepSeek Harness's name" switch, on by default, takes dsh's identity lines out of what goes to WorkBuddy (NancyTom18 on X, an account banned after use from dsh). keepMovedCurrent brings moved users up to it. Run: go test ./internal/provider on mote at this tree, ok (219s); gofmt -l clean. Not tried: a real WorkBuddy account. |
||
|
|
6d9fb7ef0f |
routing: a dsh request names the dsh session its first prompt was read from
changqiu4890 on Discord: Routing -> Requests showed dsh's requests with no session id. dsh 0.2.1's pi-ai routes (openai-completions, anthropic), which magpie configures, send no session header (pi-ai's session affinity is withheld by dsh's compat gate), so a route had only its Conv, the hash of its first user message. The Context page already found dsh's session by that hash (dshConvs); the Routing page grouped by header session only. pricedRoutes now gives a dsh route with no session of its own the dsh session whose Convs hold its Conv (convOwners, shared with the Context page's joinConvs), from an index rebuilt at most every 2s when a conv is missing and every minute otherwise. Grouping and titles (dsh:<id>) follow. A route with its own session, another agent's route, and a conv two sessions share stay as they were. Run (mote-run, this tree): - go test -tags nogui ./internal/gui/ ./internal/sessions/: ok, ok - TestRoutingDshRoutesNameTheirSession and TestContext*: ok - GUI routing-sessions, routing-session-folder, routing-by-key, ctx-route, routing-day-window: Chromium 160/0, WebKit 80/0 - go vet darwin, linux (nogui), windows ./internal/gui; go build all three - gofmt -l clean Broken by hand: `r.Session = owners[k]` -> `_ = owners[k]`; the new test's dsh chat and messages routes went red. Not tried: a real dsh through magpie. A brand-new session's first request shows no session until dsh writes its session file and the index refreshes. The in-flight list (Active, concurrency endpoint) is unchanged. |
||
|
|
4f624241f7 |
codex: the ChatGPT app left on "hit a snag" after an app-server restart is reopened when idle (#4550)
ysm119 on Discord: each Restart of Codex in magpie left the ChatGPT desktop app on "ChatGPT 遇到了问题 / 请重试" till it was quit and opened again. magpie ends the app's own app-server cleanly (code 0); a signed-in ChatGPT 26.1021 then fails "Hosted AppServerManager identity is not ready" on the one it starts, logs fatal_error_broadcasted and shows the page. That is the app's bug; magpie now follows it up. - provider/codex_app_crash.go: for 60s after every end magpie makes (the watcher's step, RestartCodexApp, RestartSwitchedCodexApp) the app's logs are read for a whole fatal_error_broadcasted line stamped after the end. On one, with no request through magpie since or in flight and no Codex turn opened since, the app is quit and opened once. Otherwise it is left as it is and logged. Where it can't be reopened (Linux, an app that didn't quit) the Agents row says "The Codex app hit an error · quit it and open it again" (appSnag) until the app-servers seen then are gone or the app is closed. Unreadable logs reopen nothing. - agent/codex_app_crash.go: the logs as the app's file logger writes them (macOS ~/Library/Logs/com.openai.codex, Windows %LOCALAPPDATA%\Codex\Logs and the Store package's LocalCache, Linux $XDG_STATE_HOME/codex/logs; YYYY/MM/DD folders, tail-read, half lines dropped). The relaunch is the Agents row's: on macOS ChatGPT.app found by its bundle id, quit as ⌘Q does and opened once it has ended, never forced; on Windows codexAppReopen. - GUI line in en, zh, zh-TW, ja, de; docs/subsystems/agent-wiring.md. Run on mote (macOS) at this head on origin/main |
||
|
|
08982805eb |
gui: spinners stand still under reduced motion instead of flickering
_yukirock on X (0.1.3036, macOS 27.3): spinners ran far too fast. The
reduced-motion rule cut every animation to .01ms but left endless ones
endless, so a spinner restarted every few microseconds and each frame
caught it at a random angle (seen frame by frame in the reporter's
video: the arc jumps 90-180 degrees per 60fps frame). It hits anyone
with the system's Reduce Motion, or magpie's own (Settings > General).
The rule now also sets animation-iteration-count: 1, so an endless
animation runs once, ends at once and shows its base style, as the
spinners that declare `animation: none` there already did (ag-up,
quota-refresh, saving). routing.css's busy spinner asked for a 2s turn
under reduced motion; the global !important rule always overrode it, and
it now stands still with the rest.
reduce-motion.test.cjs puts a sign-in spinner in the page and waits up to
1s for its animations to finish: they do while motion is reduced, and
never otherwise. (Counting running animations two frames on was red in
Chromium at the rebased head: a compositor animation can take longer to
start.)
Run on mote (Chromium and WebKit):
- reduce-motion plus every GUI file that reads animations under reduced
motion (33 files, 1034 tests): 1011 pass, 23 fail. The failing four
files (context-map, found-skill-pick-remove, mobile-web,
tray-cell-click) fail the same on origin/main
|
||
|
|
965ae78e1e |
gateway: a routing group draws on its own image member, Codex's tool too
changqiu4890 on Discord: the group smart-split has three Codex CPA chat models, DeepSeek-V4.1-Flash and Codex CPA's gpt-image-2.5, and dsh, Codex and Pi are set to it. Image requests went to other providers' image models. Two causes in magpie: - drawingTries tried every member of a group named for a drawing in the order chat routing plans them, so the chat members came first. group/smart-split drew on cpa/gpt-6-astra, which was asked as a chat for an image, before it reached the group's image member. A group with members that make the kind (drawsModel, or servesKind for video) is now tried on those members alone. The fallback between them stays as it was. - Codex's image tool drew on the provider that served the turn, else on Settings' pick. A group's image member was never used: a turn on DeepSeek, or on the relay, drew with Settings' model or with the relay's other GPT Image. codexDrawingProvider now also returns the routing group the turn asked for. When that group draws (GroupDraws), the drawing goes to its image member through resolveDrawing, which keeps the member's provider. The reporter's Routing screenshot also shows explicit requests from a client magpie names "Mozilla": x0-15/gpt-image-2.5, codex/gpt-image-2.5, and bare gpt-image-1 and gpt-image-1.5. magpie routes a request that names a provider to that provider, and a bare id to the first provider whose Drawers list it. Nothing in such a request links it to the agent's group, so this commit leaves those requests alone. Tests: - TestMixedGroupDrawsOnItsImageMemberOnly (new): the reporter's group shape on fake upstreams, with another relay listing gpt-image-2.5 first. Red before the fix (drew on cpa/gpt-6-astra), green after. - TestCodexDrawingTakesItsGroupsImageMember (new): red with the group branch turned off by hand (drew on chat/gpt-image-2), green with it. - TestMixedGroupMakesVideoOnItsVideoMemberOnly (new): a guard for the video sibling. It passes with the filter turned off as well, because video's mediaMembers already keeps only video members (KindGroup). Run on mote (mote-run) at this tree: - gofmt -l - go vet ./internal/gateway on darwin, GOOS=linux -tags nogui and GOOS=windows - go test -count=1 -run 'Group|Draw|Image|Video|Media' ./internal/gateway - go test -count=1 -timeout 45m ./internal/gateway ./internal/provider Not tried: - a real Codex CPA relay or a real dsh session - the image MCP's default for a non-Codex agent set to a group: the MCP call carries no link to the agent's chat route, so it still uses Settings' pick - chat routing to a group's image member when the member's provider has no picks: the member's provider is still the pinned one, and this commit doesn't change it |
||
|
|
331f201faf |
plugin: a cross-signed root copy in Windows' ROOT store no longer shadows Bun's own root (youyo.p_10001)
youyo.p_10001 (Discord #feedback, magpie 0.1.2993 windows/amd64, Bun 1.4.4, Clash Verge on 127.0.0.1:7897): every MiniMax plugin request to agent.minimaxi.com failed "unable to get issuer certificate", while the same chain verified outside the plugin host. Cause: magpie hands Bun the user's Windows ROOT store as NODE_EXTRA_CA_CERTS. Bun (BoringSSL) builds the chain up through the first trusted certificate with the subject it wants, the extra file's ahead of its own bundle, and stops when that one's issuer is missing. A ROOT store holding USERTrust RSA's copy cross-signed by AAA Certificate Services (agent.minimaxi.com's chain goes leaf, WoTrus DV, USERTrust RSA) gave Bun that copy ahead of the self-signed root it ships, and AAA is in neither. Node, curl and Schannel go on to the self-signed one, so outside magpie it worked. Fix: rootsFirst writes the self-signed roots first and keeps another certificate only when its issuer is in the file too. Bun never ends a chain on one that isn't self-signed (no partial chains), so one left out could only stand in front of a root. NODE_USE_SYSTEM_CA=1 stays: the system store Bun reads itself comes after its bundle and shadows nothing (tried, below). Also, for the next report like it: - the host logs its network settings when it starts, and when the proxy (or the gateway's address) moves, old to new: the proxy without user and password (netproxy.Redact), NO_PROXY, NODE_EXTRA_CA_CERTS, NODE_USE_SYSTEM_CA, SSL_CERT_FILE/DIR (netLine); - a fetch Bun refuses for the certificate keeps Bun's words and its code and cause, and adds "(UNABLE_TO_GET_ISSUER_CERT: the plugin host's TLS didn't verify agent.minimaxi.com's certificate chain against the roots it trusts)", so it doesn't read as the vendor's fault (throwTLS in host.js). The plugin side, a China-site account call that can't reach agent.minimaxi.com going once to agent.minimax.cn, is opencode-minimax-auth 0.2.3 (magpie-community/plugins#757). Run: - Reproduced on xiaomi-gpu (Windows 11, Bun 1.4.2) with the real host and the real ROOT store: the real cross-signed USERTrust RSA (valid to 2028) imported into LocalMachine\Root, then a scratch test through bunCommand (NODE_USE_SYSTEM_CA=1 included) fetching https://agent.minimaxi.com/: the file as before -> UNABLE_TO_GET_ISSUER_CERT, rootsFirst's -> 200. Certificate removed after (checked); without it both 200. Also as NODE_EXTRA_CA_CERTS alone: cross copy -> UNABLE_TO_GET_ISSUER_CERT; self-signed then cross -> 200; cross then self-signed -> UNABLE_TO_GET_ISSUER_CERT; cross with AAA either order -> 200. The cross copy in CurrentUser\CA with NODE_USE_SYSTEM_CA=1 -> 200 (no shadowing from the system store). - New tests: TestRootsFirstPutsTheSelfSignedCopyAhead, TestBunGetsPastACrossSignedRootCopy (a synthetic cross chain through Bun), TestPluginTLSRefusalSaysWhose (through the fake plugin's fetch; Bun's message there is the reporter's "unable to get issuer certificate"), TestNetLineSaysNoSecret. Green on mote (macOS, Bun 1.4.2) and on xiaomi-gpu via win-run, with the systemca tests beside them. - Broken by hand on mote: rootsFile without rootsFirst -> TestBunGetsPastACrossSignedRootCopy/the_cross-signed_copy_first red; throwTLS rethrowing as is -> TestPluginTLSRefusalSaysWhose red ("err = unable to get issuer certificate"). - mote, at this tree: gofmt -l clean; go vet, GOOS=linux go vet -tags nogui, GOOS=windows go vet of internal/plugin ok; go test ./internal/plugin ok (111.7s). xiaomi-gpu: go test -run 'Proxy|CA|TLS|Roots|NetLine|LAN|Network' ./internal/plugin ok. Not tried: the reporter's own machine and store (what put the cross copy in their ROOT store is a guess from the error; the host's new log line will show NODE_EXTRA_CA_CERTS, and the file is in the cache's bun folder); Bun 1.4.4 (the reporter's; 1.4.2 here); macOS keychain copies (rootsFirst applies to systemRoots there too, untried with a real cross copy); Linux takes the distribution's bundle as it is, unchanged. |
||
|
|
97ccb90e88 |
routing: a group with no rule shows only the example rule's button, no paragraph under Rules (mr_coffee0083)
|
||
|
|
a732f3c493 |
gateway: models of one API other than chat are grouped by id on their route (#5339)
XYenon (Discord) has the same embedding model at several providers and
asked why it isn't grouped the way chat models are. It wasn't even
listed: a fetched list dropped every embedding, rerank, speech and
transcription model, so "embed-1" on /v1/embeddings was a 404 unless a
hand-made group named it.
- catalog: a fetched list keeps those models, tagged with their API
(Model.Serves, read from the id by ServesOf: rerank, embed/bge-,
whisper/transcribe, tts-/-tts). Chat() and Live() leave them out, so
agents' model lists, gateway keys and Routing's chat pickers never
see them; LiveServing(id, kind) reads them. The live file says
"kinded": true; a list fetched before this is fetched again once a
run (autolist), with no schedule needed.
- provider: KindGroup(kind, ref) is made per request, never stored, so
it is in neither Groups() nor Catalog(). Its id is
auto-<kind>:<model> ("group/auto-embedding:embed-1"); its members are
the providers that serve exactly that id for that API, in the order
they were added, none off, decide-only, serving none, or with the
model disabled.
- gateway: embeddings, rerank, speech, transcriptions and videos pick
the group by route (mediaMembers): a bare id is a kind group when
more than one provider serves it, the group's own id always; a
hand-made group still works through offChatList. A group is of its
own API: an embedding model's id on /v1/rerank is a 404.
Run at
|
||
|
|
b63b289589 |
provider: WorkBuddy's mover min is 0.2.22, extra credits keep the account going once the plan's are spent (ferock)
ferock on Discord (2026-11-05, WorkBuddy China): once an account's base credits were used up magpie moved to another account, though WorkBuddy goes on serving it on its extra credits. workbuddy 0.2.22 (magpie-community/plugins 36fc59a7) sets the plan's Credits window aside once it is spent with extra credits left, and Extra credits stops the account, for the extra credits only the detail lists carry too, as the summary's own split already did. keepMovedCurrent brings every moved user up to it. npm: `npm view --prefer-online --registry https://registry.npmjs.org @magpie-community/opencode-workbuddy-auth version` answered 0.2.22 before this commit (the publish run is red only on think-tags 0.1.1's E404, plugins#180). Run at this tree on mote: go test -timeout 45m ./internal/provider/ ok (302.7s); gofmt -l clean. Not tried: a real move to 0.2.22, or any real account with extra credits (the China desktop sign-in here is refused 401 by the billing meter). |
||
|
|
d620ff6b54 |
codex: an old OpenAI thread follows Codex onto magpie by its row, and back at the Disconnect (Parry_Moody, Cyrus)
Parry_Moody and Cyrus on Discord: Codex on OpenAI through an API key
before magpie, and for two days the Codex app answered every older
conversation "继续聊天未成功: This chat uses openai, but your current
provider is magpie. Switch to openai to continue."
Cause, from Codex's source (rust-v0.167.0-alpha.3.1, same in 0.166.0):
every thread Codex 0.166 starts is paginated (history_mode 'paginated'
in its state-DB row), and for those thread-store read_thread takes the
provider from the row, never the rollout ("Paginated history may contain
only a suffix, so its display metadata lives in SQLite"). The app sends
thread/resume with modelProvider null (ChatGPT.app 26.1021, Kct in
app-shared), so the row alone decides, and load_for_resume refuses a row
other than the current provider. bringOver moved threads by rewriting
files: plain ones in place, packed ones only from the last 30 days and
128 MB a sync. An older or packed OpenAI thread kept an openai row.
Now sessions.RetagPagedCodexThreads moves every paginated thread on a
provider by its row alone: any age, packed or not, an id of any length,
no file read, written or copied. Each thread is held by its writer lock
(an open one stays: its writer would write the provider back), one
written to in the last minute waits, 200 rows a transaction. It runs
after the in-place relabel in bringOver, bringBack (so a Disconnect no
longer copies a whole paginated history to the trash), bringOfficial and
bringBeside, and giveBeside by ids (RetagPagedCodexThreadIDs). Legacy
threads keep the file path. The Sessions page lists a paginated thread
on its row's provider (codexPagedProviders, memoised on the DB and WAL
stamp), so it isn't offered a Move it had.
Run:
- real codex-cli 0.166.0 (npm latest) on mote in a sandbox CODEX_HOME,
a fake Responses server: a thread started with OpenAI (API key,
openai_base_url) is paginated, row openai; with model_provider magpie
`codex exec resume` failed with exactly "This chat uses openai, but
your current provider is magpie" (modelProviderMismatch). After
magpie's RetagPagedCodexThreads on that home (a throwaway test calling
it, not committed) it resumed and answered; the rollout still names
openai. Reversed (magpie -> openai) with config back on OpenAI, it
resumed again. The first retag try moved nothing: the rollout had been
written <1 minute before, the ActiveWindow skip, as intended.
- mote: gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows
for ./internal/sessions ./internal/agent; go test ./internal/sessions
./internal/agent: ok (sessions 20.1s, agent 194.4s) on mote, plus go vet on darwin, linux -tags nogui and windows
Broken by hand:
- RetagPagedCodexThreads returning nil (the old behaviour):
TestCodexPagedThreadsFollowByRow red (250 packed 90-day-old threads
"on openai, want magpie"), TestRetagPagedCodexThreads red.
- the writer-lock hold skipped: TestCodexPagedThreadsFollowByRow red,
the open thread moved to magpie.
Not tried: the Codex app GUI itself (the app goes through the same
app-server thread/resume, whose modelProvider it sends null); Windows
and Linux runs (vet only). Codex rebuilds a row from its rollout when a
search listing reconciles it, which puts a retagged thread back on its
file's provider until the next sync; not seen, read from the source.
A legacy thread packed over 30 days still waits for Sessions' Move.
|
||
|
|
bd0f338282 |
hermes: a Claude model goes on anthropic_messages, so cache_ttl 1h works; the user's api_mode stays (#5315)
cherish_onlyy (#5315): magpie wrote providers.magpie as chat_completions at the gateway's /v1 for every model. On chat completions to a custom provider Hermes sends no cache marks (anthropic_prompt_cache_policy gives (False, False)), and the marks magpie adds for a Chat client last five minutes, so prompt_caching.cache_ttl: 1h never reached the vendor. They set api_mode: anthropic_messages and the gateway's root by hand and got 1h writes; magpie's next sync or connect wrote chat_completions at /v1 back. Hermes takes api_mode per providers entry, never per model (_resolve_named_custom_runtime, hermes_cli/runtime_provider_custom.py; aliases in config_providers.py's _API_MODE_ALIASES, transport read when api_mode is absent). On anthropic_messages its adapter strips a trailing /v1 and the SDK adds /v1/messages, and for a "claude" model on a third-party gateway it puts its own system_and_3 marks at the configured ttl (agent/prompt_caching.py, read at d914e233). So magpie now writes two entries, as dsh already splits its routes: - magpie: chat_completions at gw/v1, every model not on Messages; - magpie-anthropic: anthropic_messages at gw (no /v1), the models whose native API is Anthropic's Messages and not Responses (hermesOnMessages). model.provider follows the picked model (hermesRoute), in every profile; a sync moves a Claude model magpie had set under "magpie" onto magpie-anthropic, and drops that entry when no model is left for it. Disconnect takes both out. The user's own value: an api_mode or transport on one of magpie's entries that isn't the one magpie writes there (by Hermes's aliases, so "openai" is still magpie's chat) is the user's (hermesModeIn). It stays through sync and pick, base_url follows it, and on "magpie" that entry then serves every model and no magpie-anthropic is written, which is the reporter's set-up exactly. magpie only ever wrote chat_completions into providers.magpie, so nothing earlier is mistaken for the user's. Tests: - TestHermesClaudeGoesOnMessages: Claude on magpie-anthropic (mode, base without /v1, models), deepseek stays on magpie at /v1, Get/Check/Drift clean, a pick moves model.provider back, a bot profile too, Disconnect removes both entries from every profile. - TestHermesSyncMovesClaudeOntoMessages: an existing connected config is moved on sync, and back when the provider goes chat-only. - TestHermesKeepsTheUsersAPIMode: api_mode anthropic_messages at gw, transport: anthropic, codex_responses: each survives two syncs and two picks, base_url kept; api_mode: openai is still magpie's. - internal/gateway TestHermesHourMarksReachTheVendor: a Hermes-shaped /v1/messages turn with 1h marks reaches the Anthropic upstream with every mark at 1h; the same turn on /v1/chat/completions goes at 5m. This one passes on the old code too: the gateway already passed the marks through; it guards that and records why the mode matters. Run (mote-run, this tree): - go test ./internal/agent/ -count=1 -timeout 45m: ok - go test ./internal/gateway/ -run 'TestHermesHourMarksReachTheVendor|TestResponsesToClaudeMarksLastAnHour' -count=1: ok - go vet ./internal/agent/ ./internal/gateway/, GOOS=linux and GOOS=windows: ok - gofmt -l: clean Broken by hand: - hermesSplit returning (nil, false), the old one-entry behaviour: ClaudeGoesOnMessages, SyncMovesClaude and the openai-alias case fail. - hermesModeIn never reporting the user's mode: all three KeepsTheUsersAPIMode cases fail at "sync". Not tried: - Hermes itself: it was not run (running it under a temp HERMES_HOME rewrites the live launcher); its behaviour is read from its source at d914e233. No real 1h cache write was measured against a vendor. - Group models whose members are all Claude, and Claude Code sign-ins (no Native API), stay on chat_completions; GPT on codex_responses is #3080. - Windows and Linux runs of the agent package (vet only). |
||
|
|
465928bcce |
backup: the default backup folder says a reinstall takes it too; docs say how to keep magpie on another disk (two_2025.)
two_2025. on Discord asked to pick magpie's config folder: on Windows it is on C:, and a system reinstall without a backup loses everything. Two ways already exist and neither is said where the user looks: automatic backups can go to any folder (Settings > Sync and backup > Backup folder > Change...), but default to auto-backups inside magpie's own folder, lost with it; and portable mode (a data folder beside magpie.exe, internal/appdir) keeps everything on another disk. So no new data-folder setting: moving the live folder would have to repoint the library's links, agents' configs and a running gateway, and its pointer would sit on C: and be lost on the same reinstall. - AutoStatus reports inside: the backup folder is settings.Dir() or in it, letter case aside off Linux. The Backup folder row then says a reinstalled system or a lost disk takes these backups too, and to pick a folder on another disk or a cloud drive's (en, zh, zh-TW, ja, de). A folder picked elsewhere says nothing new. - docs/start (en, zh, ja) #data-folder: pick a backup folder on another disk and restore from it after a reinstall, sync for the keys, or run portable from D:\magpie with a data folder beside magpie.exe. - docs/subsystems/sync-backup.md names the field and the tests. Run (mote, at this tree on origin/main |
||
|
|
435f041514 |
gateway: an account near its usage cap takes one turn at a time (dyzdyz010)
dyzdyz010 on Discord: two Claude Code accounts, each capped at 90% of its five hours, Stop at the caps and Check usage near the cap on, and both read 100%. Routing holds a capped account by its last reading. Turns sent together (an agent's subagents, several agents) were each planned on the same reading, so an account a point under its cap took every one of them, and went as far past it as they used between them. Check usage near the cap reads the usage again before planning, but every turn read the same figure: each saw 89%. - gateway (cap_near.go): within 5 points of a usage cap (carefulNear), an account takes one turn at a time. A turn that finds it busy goes to the next candidate first, the account moved behind them once; the last candidate waits for it. Once its turn comes capHeld judges it again, by what the reply before it said (codex.rate_limits, rate_limit_event), or by the usage read again when that reply said nothing (at most carefulWait). Held, it is passed over, or the agent gets the cap's 429 when nobody is left. The cap is passed by one turn at most. - A conversation kept on its account by Stays: Strict takes no turn there and goes on past the cap, as before. Neither does an account already held when its try begins, let in past its cap on purpose (a Codex reset spent for it, its credits). - docs: gateway-routing.md's capHeld step, providers-accounts.md's cap sentence. Run (wsl-run, magpie-desktop, Go 1.26.8): - go test -tags nogui -run 'NearCap|FarFromCap' -v ./internal/gateway: the five new tests pass. - go test -tags nogui -race -count=20 -run 'NearCap|FarFromCap' ./internal/gateway: ok. - GOOS=linux go vet -tags nogui ./internal/gateway, GOOS=windows go vet ./internal/gateway: ok. gofmt -l: nothing. - go test -tags nogui -timeout 30m -run 'NearCap|FarFromCap|CodexNoCredits|Reset|Strict|Cap|Credits' ./internal/gateway: ok. - go test -tags nogui -timeout 45m ./internal/gateway ./internal/provider, at this tree rebased on |
||
|
|
01a260af46 |
routing: a group with no rule says what a rule is for, with an example rule (mr_coffee0083)
mr_coffee0083 on Discord asked how to set up a group where one model
thinks and several others write code: the group editor's rules part
had no word on it and no example to start from.
- plugins/routing/client.js: a group of two models or more, not routed
by hand, with no rule yet, says under Rules that every turn goes by
the routing, and how one model thinks while others write code: the
coding models in a group of their own added first, the thinking model
after it, routed In order, and a rule sending planning and hard
problems to the thinking model. "Add an example rule" beside "Add a
rule" adds that rule, its intent filled in ("planning, design, or a
hard problem to think through"), for the editor to finish. Neither
shows once the group has a rule, or for one model, or routed by hand.
- i18n.js: the three strings in zh, zh-TW, ja and de, with each
language's own word for In order.
- routing.css: the button wraps and reads in the accent colour, as the
text buttons beside it.
Run (wsl-run, magpie-desktop, Node 22, Playwright 1.62.0):
- routing-rule-example.test.cjs (new): 20 of 20, chromium and webkit,
en zh zh-TW ja de, at 1100 and 390 wide. The hint and button show,
nothing is past the editor's side, pressing adds one rule to opus
with the translated intent, Save posts it with the classifier Jev;
after a reload a group of one model, or routed by hand, shows
neither.
- the 16 i18n-*, routing-rule*, routing-rules-*, group-editor-* and
routing-classifier* files: 190 of 221. The 31 reds are in
i18n-keys (#5327, #5332), routing-rule-drag, routing-rule-models,
routing-rule-remove and routing-rules-line (#4585, #5088, #3789,
#4112, #4560). Those five files run alone, one at a time, at clean
origin/main
|
||
|
|
5db1b07ed9 |
gui: the tray panel's Usage tab is drawn again in Settings' currency picked alone, and when its read came before the state (dLdgKyRd)
dLdgKyRd on Discord, v0.1.3025 on macOS: the menu-bar panel's Usage tab said ≈$12.36 while the window's Usage page said ≈¥82.61 for the same day. v0.1.2913 ( |
||
|
|
a2f7ed2e81 |
gateway: a hand-made group of embedding, rerank, speech, transcription or video models is served when its providers have picks
XYenon on Discord: a routing group of embedding models was a 404 on /v1/embeddings. Picks are of chat models, so membersFound dropped every member of a provider with picks as unpicked (#3911). |
||
|
|
2891ec7a7b |
docs: Trae / Trae CN through magpie, in the start page's FAQ (en, zh, ja)
A user (tz_188, Discord) confirmed Trae works with magpie this way: the gateway's address in Trae's custom model settings, Share on local network (局域网共享) turned on, and a gateway key as the API key. Trae keeps custom models in the Trae account, server-side, so magpie can't set it up in one click, and Trae may not reach 127.0.0.1. The FAQ entry (#trae) says that, hedged as a user report, and links Remote magpie's #share. Run: node --test site/*.test.mjs via mote-run at this tree, 84 of 84 ok. (Run with -C site it is 83 of 84: the sponsors test reads ../README.md, which -C site doesn't copy; not a red.) No Go test reads site/public/docs (pluginrt's tree walk skips site/), so none was run. Not tried: Trae itself; the steps are the reporter's, not reproduced here. |
||
|
|
06508f2bf5 |
library: a stdio server that refuses home is checked again in a project folder (fff)
math_milian on Discord: fff-mcp worked in their agent, but Library → MCP
said "fff exited (1)". fff-mcp indexes the folder it starts in and
refuses a file system root or home ("Can not run certain FFF features in
a file system root or home directories"), exiting 1. magpie's check
starts every stdio server in home (#1727), where agents never start it;
they start it in their project.
When a local check exits, it now starts the server once more in an empty
project folder of its own (removed after). If it answers there:
- given to agents that start it themselves (no router, not Codex on
magpie, or hub "direct"), the row shows its tools, and the tooltip says
it exits in home, with what it said;
- run by magpie in home for agents (the MCP router, or Codex on magpie's
RunPath), the row says "won't start in home" (why "home"), and its
editor offers "Through the MCP router" to turn off, even with the router
off, so each agent starts it in its project.
A server that exits in both places reads as before. WSL checks are
unchanged. healthKey (Go and client.js) now includes whether magpie runs
it in home, so a router change checks it again. startServer takes the
dir; the hub and the RunPath runner still pass home.
Run:
- go test -count=1 -timeout 30m ./internal/library on mote: ok (159s).
- TestCheckServerThatRefusesHome red on the old code: State error, Why
exited, Code 1, with fff's text, the reporter's case.
- Real fff-mcp 0.11.0 (cargo-built on mote, sandbox HOME resolved through
/private/var) via CheckServer: direct ok, 3 tools, Project; router on,
Why home, Code 1.
- go vet ./internal/library ./internal/gui (darwin), GOOS=windows and
GOOS=linux go vet ./internal/library on mote; gofmt -l clean.
- GUI on mote, Chromium + WebKit: mcp-home-health (new, every language,
1100 and 390), library-mcp-health, mcp-hub-direct, library-mcp-hub,
library-mcp-health-wsl, i18n-en-no-cjk, i18n-keys: 91 of 92 ok. The red
is i18n-keys "a plugin's words are its own" on search_row_archive_test.go's
"View routing", red on main since
|
||
|
|
24d315fa85 |
routing: the request list can be grouped By key, each gateway key's calls under its name
acezan (#help on Discord) asked to see API use on the Routing page the way
it shows each agent's, live and in the history. The list's group bar gets
a third button, By key, after By request and By session. It shows once
Settings has a gateway key (/api/caller-keys). Each head is the key's
current name (else the name the route kept, else its id), with its agents
dim beside it and the usual count, tokens, in progress and cost. Calls with
no key (from this computer, or kept before 75fb76186 named the key) go
under "No gateway key". A row's tooltip names its key too. The choice is
kept in localStorage (magpie.routingGroupBy), and the old
magpie.routingBySession still works. Text added in zh, zh-TW, ja and de.
click-scroll counted two group buttons and now counts three, with By key
hidden when there is no key. purpose-filter clicked .last() for By
session and now picks [data-by="session"].
reference.md and gateway-sessions.md describe By key and Route.CallerKey.
Run (WSL magpie-desktop: mote's disk is full, ld errno=28):
- routing-by-key.test.cjs: 20/20 in chromium and webkit, in en, zh,
zh-TW, ja and de, at 1100 and 420. Red 20/20 with client.js and
i18n.js at the parent (waits for By key).
- 254 Routing-related GUI files at concurrency 4. Every red was rerun
serially, with this change and at origin/main
|
||
|
|
5fe4c48df9 |
gateway: a route names the gateway key it came with, by id and name
The Routing page is to show each gateway key's requests as it shows each
agent's (acezan on Discord). A route kept the key's id only for
sessionLatest, unexported, so neither the trace nor the routing history
said it. Route.CallerKey and CallerKeyName are now in its JSON: the id and
the name the key had, never the secret. A request with no key names none,
and so does every route the history kept before this.
The trace is told to this computer alone (/v1/magpie/trace is loopback
only, /api/gateway/trace the GUI's), and /v1/magpie/route sends
sessionRouteOf's projection, which carries neither field.
Run (wsl-run, magpie-desktop; mote's disk was full, its link failed with
errno 28): go test -count=1 -run
'TestTraceNamesCallerKey|TestSessionRoute|TestCallerUsage|TestRejectedRequest'
./internal/gateway ok. Broken by hand: with trace.go, unrouted.go and
session_route.go back at
|
||
|
|
b95a78d43c |
gui: the editor says where magpie found a relay's balance, with Use
A relay added by hand with no Balance URL has its balance found by magpie, but nothing in the window said so. A user who saw a wrong amount couldn't tell it was a guess or where to put it right. Under the Balance URL, in Advanced, the editor now shows "Found by magpie: <url> <field>" with Use, which copies the query into the Balance URL and Balance field to be changed. Check balance draws the line again from what it found, and when it found nothing it says "No balance at /v1/usage or /api/usage/token" instead of "No Balance URL to ask". /api/providers carries balanceFound and balanceFoundField. The check's reply carries looked, found and foundField. The line is in balfound.js, loaded when the editor draws a relay's balance with no Balance URL. Its one call and the check's text in app.js are paid for by three provider editor comments cut down, so there is no raise: the core is 1,533,452, 350 under its budget. zh, zh-TW, ja and de are translated. Run on mote: - go test -count=1 -timeout 45m ./internal/gui: ok, except TestMainWindowCorners/macOS_26_SDK, mote's macOS 27 (#3949). - GUI, both engines: balance-found (new, 900px and 420px, every language) 22/22. balance-url-first, balance-fix, balance-method, balance-field-default, key-balance-card and old-webkit: ok. i18n-keys: "a plugin's words are its own" is red (#5327), as on main. Broken by hand: with the import taken out of app.js, balance-found is 0/11 in chromium. Not tried: the whole GUI suite at this head (run after the push), and the real app with a real relay. |
||
|
|
464cc30f91 |
provider: a relay's found balance query is looked for again each day
A relay added by hand with no Balance URL has its balance found at
/v1/usage or /api/usage/token (
|
||
|
|
2488532257 |
provider: a relay added by hand finds its balance where relays tell it
The same relay user had added yylx.io by hand: no Balance URL, so no balance anywhere until they deleted it and imported it from the relay's site, whose link names the query (小鱼 of yylx.io, WeChat, 11-05). A provider added by hand, or from a relay's preset, with a key and no Balance URL, at no host magpie knows a query for, is now asked at its base's origin: /v1/usage (sub2api, $remaining), then /api/usage/token (new-api, $data.total_available / 500000), with the key's own auth and headers, as balanceRead asks. A 200 whose field reads is the query. It is kept in memory per origins and key (the key hashed), and so is finding none, for 6h (5 min when the relay can't be reached), so a poll asks once. Nothing is written to providers.json. The card, Check balance and `magpie provider show` (BalanceQuery) read the found URL; none found is no card, and the editor's "No Balance URL to ask". Never asked: a vendor's or local server's preset host (api.openai.com, api.anthropic.com, api.deepseek.com…), this computer, opencode.ai and api.cline.bot, a plan whose windows are its card. The subsystem page has the row. Run (mote, go1.26.8): - go vet ./internal/provider; go test -count=1 ./internal/provider: ok. - The new tests: a sub2api relay read at $10472.14 with /v1/usage asked 3 times over the probe, a Balance and a card poll; a new-api relay found after /v1/usage's 404; a relay answering HTML 200 everywhere has no card and is asked twice in all over two polls; the hosts left alone. Broken by hand: with the probe taken out of balanceRead, the three HandAdded tests fail (balance "" false; a card with no balance). Before this, TestOpenCodeZenSaysItTellsNoBalance caught the probe asking opencode.ai for OpenCode Go and a custom inference provider; those hosts are left out now. Real use (mote, sandbox HOME holding only the owner's yylx.io provider, copied with its key, removed after): `magpie provider yylx-hand` (no preset) and `magpie provider yylx` (鱼鱼连线's preset, Global region) both show "balance $19.97 from https://global.yylx.io/v1/usage $remaining". Not tried: a real new-api relay; a new-api relay that routes unknown /v1 paths to its upstream. |
||
|
|
e2aaf21f73 |
gui: a custom provider's Balance URL is asked above its balance token
A relay's user wanting their balance opened the editor and found "Account balance" asking for a new-api System Access Token or a sub2api JWT and user id, while the setting that worked (Balance URL https://app.yylx.io/v1/usage, token left empty) sat at the foot of the form under More endpoints (小鱼 of yylx.io, WeChat, 11-05). The Balance URL and Balance field now sit right above Account balance in Advanced (balSlot), and Advanced opens when a Balance URL is saved. The token's hint says first to leave it empty, that most relays tell a key's balance at the Balance URL above (sub2api's …/v1/usage, new-api's …/api/usage/token), and only then what the token is for. zh, zh-TW, ja and de have it. In Advanced's narrower column the method picker and URL wrap, so the URL keeps at least 120px at 420px. Run (mote, Playwright 1.62.0): - balance-url-first (new), balance-fix, balance-method and the other balance-* files: 186/186 in Chromium and WebKit, at 900 and 420px, en/zh/zh-TW/ja/de. - The whole GUI suite, cut short after 733 tests (it ran for hours beside other sessions): red only in account-eye chromium en/ja (#5052) and account-weight webkit ja 390 (#4644), both open and in files this change doesn't reach. - i18n-keys: "a plugin's words are its own" red, the same on main (#5327). TestCoreScriptBudget: the hint took the core 494 bytes over its budget; five comments in the provider editor were cut (573 bytes), so it is 79 under, with no raise. - go test ./internal/provider ./internal/gui ./internal/cli ./internal/tui at the rebased head: ok but internal/gui's TestMainWindowCorners on mote's macOS 27 (#3949, open) and the budget before the cut. Broken by hand: balance-url-first on the old app.js fails at "a saved Balance URL opens Advanced" (chromium). Filed: #5336, Advanced is 46px too wide at 420px on main (the Rests tick's label); the new test checks only the balance rows for it. Not tried: the real app on Linux (WebKitGTK); no motion or new API here. |
||
|
|
373cab2b08 |
provider: the Cursor mover's min is 0.2.41 (plugins#706)
cursor 0.2.41 (plugins#706, ooboqoo): a short session whose parent Run
waits on tool results no longer loses that step's usage. The later Run
of the conversation collects it, and it is counted once. Raising the
min makes keepMovedCurrent bring every moved Cursor user to it.
npm view --prefer-online @magpie-community/opencode-cursor-auth version
gave 0.2.41 before the change and again right before this commit.
Run on mote at this change on
|
||
|
|
2947685999 |
claude: an interactive run's calls keep the conversation they answered when their line comes late
kay20475 on X (magpie 0.1.3005, local magpie -> shared server magpie ->
Claude subscription, interactive bridge): a Claude Code sub-agent's
requests on one account read 99%, 6%, 6%, 99% from the cache; the two 6%
requests were 169.1k each, 35s apart, about 3s long with a short reply.
That is the shape of Claude Code's AgentSummary: every ~30s it sends the
sub-agent's conversation with its last results and "Describe your most
recent action in 3-5 words", while the sub-agent's own run has already
taken those results.
Cause. Such a request finds no run waiting on its calls and should go on
in a branch of the sub-agent's run's session (branch). branch takes it
only when the conversation stored on the call's line (callLine.told)
matches the one before the reply. park stored that only on lines it
already had. The interactive mode streams a reply first and reads its
session lines from the file afterwards (118-162ms after the call). So the
run parked before noteLines had the call's line, and the line came in
with no conversation. The next park then gave it the next request's
conversation. branch returned nil, and every AgentSummary (and every
fork directive) was told the whole conversation in a new Claude Code,
pasted as one text block. A single block can't match the cache beyond
the tools and system prompt, so 6%, and the next summary missed the same
way because its tail differs.
Fix. park also keeps the conversation for each call the client was shown
(r.shown), as a line with no uuid yet. noteLines keeps it when the line
comes, and branch skips lines with no uuid.
Test: TestClaudeForkBranchesOffTheLeadsSession/interactive now has the
fake write the call's session line after the reply's stream, once the
result is handed over, so after the park, which is the real order.
Broken by hand: with this test and the old claude_subscription.go on
mote, it fails ("told it whole", want "branched at line-...").
Run on mote at this tree (base
|
||
|
|
3518445947 |
gui: the self-remote notes are shorter, the core back under its budget
|
||
|
|
4cb7159f18 |
routing: a ChatGPT account whose usage can't be read is asked, not starved
peterpark8527 on Discord: 11 ChatGPT accounts under Use before expiry,
one never used. An account whose wham/usage reading fails (or names no
window, or is held by "When I ask") stayed not known for good:
Use before expiry counted it a fresh week (FreshPace, ~0.6/h), behind
every known week being spent; Smart put it after every known account.
NoteCodexLimits only updated accounts already read, so its replies'
x-codex-* headers never made it known. Its week, once started by
magpie's own turns or warm-up, lapsed unspent. A simulation of 11
accounts over 4 weeks (Pace, Poisson load 30/60/90%) had it at 141 of
~1200 used at 30% load, losing 3406, while every known account was used.
- provider: a reply that tells an unread account's week makes it known
from that (usedCache.heard), kept over failed readings, until a good
reading tells it; a 5h window alone still makes nothing up.
- gateway: a Codex account not known, weighed against one known, is
Learns, like Claude's: asked first once so its reply tells its week,
and again an hour after its last answer if that told nothing
(codexAnswered, codexLearnAgain). Of accounts none known the order
stands, so no week is started before it is needed.
- docs/reference.md: Smart and Use before expiry say so.
Ruled out (by design or not starving): an unstarted Codex week lasts
until its first request, so last is right for it; ties go by decayed
tokens, not a fixed order; a 5h-only account goes by its 5h pace
(ahead); rests are time-bound with probes.
Run:
- wsl-run go test -count=1 -timeout 45m ./internal/gateway
./internal/routes ./internal/provider ./internal/middleware: provider,
routes, middleware ok; gateway had 3 reds (TestAccountProxy,
TestCodexDrawMovesToNextAccount, TestWeeklyPace's five-hours case):
accounts none known reordered by answers earlier tests left in
codexAnswered. Fixed by the known-peer gate above; then wsl-run
go test -count=1 -timeout 45m ./internal/gateway ./internal/routes:
ok (809s). The none-known guard's u00 line was added after that run
and run alone on Windows (win-run -run TestUnknownCodexAccountIsAsked
./internal/gateway, with the reds above: ok).
- win-run the two new tests on the old code (
|
||
|
|
87c51cd6bb |
gui: a tap that comes let go before it is pressed clicks its control once (refeccd)
refeccd on Discord (magpie 0.1.3014, macOS 27.2 26B123): with Tap to click on, a tap often does nothing, in the tray panel and the window, and almost always inside a dialog, sheet or menu opened from the active window. Cause: WebKit's WebViewImpl::nativeMouseEventHandler hands every mouse event to NSTextInputContext handleEvent:completionHandler: while an editable element has focus, and before WebKit ba0432f3f5 (2026-11-04, bug 329642, "Dispatch mouse events to the page in the order sent to the input method", rdar://102126328) each event was dispatched from its own completion handler. Some input methods answer out of order, so a tap, whose down and up are a few ms apart, reaches the page as mouseup then mousedown: no click, :active stuck, and the next tap's mouseup pairs with the left press and clicks where the two meet (the "second tap works" of the earlier reports). A physical press is ~100ms long, so its order holds. Dialogs focus their first field when they open and menus focus their search box, which is why dialogs are almost always hit. macOS 27.2's system WebKit predates the fix. Not proven on refeccd's machine: no real trackpad with an input method was used; the order is reproduced, not observed there. Change (app.js, the one capture-phase tap net every control goes through): a press within 300ms and 12px of a release that had no press, and not let go within 100ms, is such a tap (tapBack). Its control (the lost-click net's selector) is clicked once after 100ms, and the trusted click the next release pairs with it (detail > 0, so never a keyboard click) is dropped. A release within the 100ms means the press was in order after all: nothing is clicked by the page and the browser's click is kept. The segs press tracker and the lost-click net ignore a tapBack press. Comments in app.js were condensed to keep the core script budget (main was already 380 bytes over it, #4526's test); no budget raised. Not covered: an inverted tap on a dialog's backdrop doesn't close it (backdropClick pairs pointerdown/up); nothing is clicked for it. Run (mote, at this tree rebased on origin/main |