Files
magpie/docs
yetone 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.
2026-11-05 17:25:26 +08:00
..