Files
magpie/docs
yetone 677034e1a2 gateway: a held request's report says where the request itself stood
wilsonxuuuu on X (0.1.4178, Codex to cloud/auto/gpt-6.1-sol, a remote
magpie's auto group): requests held 30s "in no wait magpie knows of"
and stopped with 504 all day. The report he pasted was cut before its
goroutine dump, so nothing said which step held the request.

watchUnrouted now keeps the handler's goroutine id (about 10us a request
at a 40-frame stack). On give-up, heldOwn finds that goroutine in a dump
of every goroutine and strips the argument words and pc offsets. The
report then puts "stood at: <first of magpie's own functions> (<what it
waited in>)" next to the known waits. It also puts the request's own
stack under "where this request stood", ahead of every goroutine's. The
log line says it as "standing at".

Not found: the block itself. A fake remote that hangs or answers
slowly, 49 cloud/ requests in flight, and 400 Codex requests with 200KB
bodies against concurrent settings and provider writes all routed. The
local magpie asks the remote nothing before routing a cloud/ model. The
next report will name the step.

Run:
- TestHeldReportSaysWhereItStood (a fake slow remote magpie, Codex
  /backend-api/codex/responses for cloud/auto/gpt-6.1-sol, a lock that
  routing needs held) is red on the old code: `stood at: ""`.
- TestHeldOfFindsItsGoroutine checks that heldOf finds the goroutine by
  its id and strips the values.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui and
  GOOS=windows ./... ok (mote).
- Full suite `go test -count=1 -timeout 45m ./...` on mote at 7c405dac7
  (this change on cd030691a): internal/gateway ok (1023s); every
  package ok except two reds already on main, outside this change:
  - TestNoEagerPackageRegexps: chatpage.go, #6689.
  - TestEveryRouteHasACommandOrIsNamed: providers/delete, fixed in
    4c86b0ab4, which this commit is now rebased onto.
2026-11-15 00:57:39 +08:00
..