ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f5dd4e1423 |
routing: a try a plugin or Claude Code sent says why it has no time split
"Where the time went" needs magpie's own client to send the request (TryNet). A plugin sends its own through the plugin host, and a Claude subscription's goes through Claude Code, so those tries never have a split, and the page showed nothing in its place, which read as a request that lost its details (Discord, lute). A try now records who sent it when magpie didn't (Try.SentBy: "plugin" or "claude", from sentBy), and the request's story says it under a done, answered try with no timing: "Its plugin sent this request itself, so magpie can't split its time" (or Claude Code), in every language. Run (mote, go1.26.8, Node 22, Playwright 1.62.0): - TestPluginTrySaysWhoSentIt: red without the gateway.go line (SentBy empty), green with it. TestSentBy, TestTryTellsWhereItsTimeWent, TestCursorPlugin*: ok. - go test ./internal/gateway ./internal/usage -count=1 -timeout 45m: ok (gateway 502s, usage 16s). - node --test routing-time-went (now checks the plugin try's line and that a routed try has none), routing-masking, i18n-keys, routing-js, routing-time, routing-went-on, routing-steps-cap: 57 of 58 ok in Chromium and WebKit, every language. The red is routing-steps-cap's WebKit ResizeObserver error, red the same at |
||
|
|
6f92815335 |
routing: each try says where its time went: magpie, the network, the vendor (Discord, Magic_zero)
A user read a slow turn as the gateway being slow. The try loop's
httptrace now also records DNS, connect, TLS, GotConn (reused or not)
and the first response byte. Each Try keeps a TryNet ("net"): magpie's
own time, requests made before it, the wait for a pooled connection,
DNS, connect, TLS, sending, the vendor's wait for its first byte, and
Head (from the try's start to that byte). A Route also carries the usage
record's Sent/Own/Retried/Queued split. Usage records are unchanged.
The Routing page's story shows "Where the time went" under each finished
try. It is one stacked bar plus named values, in three groups (magpie,
network, vendor): Waiting for a slot (tr.queued, which was never shown
before), In magpie, DNS, Connecting, TLS, Sending, Vendor (first byte),
First token, Streaming. Parts that took no time are left out. The
strings are in every language. "Waiting for a slot" moves from the
Usage plugin's i18n into i18n.js, since Routing uses it too.
Not covered: plugin providers (and any other request sent by something
other than Go's client). Their request goes out through the Bun host's
fetch, so no httptrace fires. Such a try has no net and shows no
breakdown, only the time it took, as before (and so does a trace from
before this change).
Run (worktree at origin/main
|