magpie wrote `headers: {User-Agent: omp}` into omp's models.yml for every
omp. A newer omp sends `omp/<version>` itself, and the header put that
version out of sight.
From omp's own source: pi-ai 18.1.6 (CHANGELOG 2026-09-03, "Inference
requests now identify as omp by default") wraps fetch in
withInferenceUserAgent, later transportFetch, which sets User-Agent
omp/<VERSION> only when none is set. Real omp runs against a stand-in
gateway on mote, sandbox HOME, `bun add @oh-my-pi/pi-coding-agent@<v>`,
every API (Chat, Responses, Messages, Gemini):
16.3.5 and 18.1.5: Bun/1.4.2
18.1.6 and 18.4.4: omp/<version>
18.15+ needs Bun >= 1.4.4 (mote has 1.4.2); its source (18.15.0,
18.22.2) has the same transportFetch.
Now (ompUserAgent): no header from 18.1.6 on; omp/<installed version>
before; plain omp when the version isn't known. The version comes from
the installed package.json (InstalledVersion), never the network.
ompKept takes a User-Agent of magpie's own (omp, or omp/<version>) for
magpie's, so an old `User-Agent: omp` is replaced or removed on the next
sync, and any other value, under any casing, is the user's and stays
alone. usage.AgentOf cuts at "/", so omp, omp/16.3.5 and omp/18.4.4 all
count as omp; nothing reads omp's version from the UA.
Tests (internal/agent/omp_useragent_test.go): TestOmpUserAgentByVersion,
TestOmpOldMagpieUserAgentSynced, TestOmpUsersOwnUserAgentStays.
Broken by hand: origin's omp.go with a stub ompOwnUserAgent, all three
red; ompKept returning yamlKept's result unchanged, the last two red.
Real omp with the new header (mica, same stand-in): 16.3.5 and 18.1.5
with `User-Agent: omp/<v>` send omp/<v> on all four APIs.
Docs: docs/subsystems/agent-wiring.md row "omp's User-Agent"; site
omp.html en/zh/ja.
Run at this tree (base ed405d1d7, mica):
gofmt -l on changed files: nothing
go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go
vet ./...: ok
go build, GOOS=linux go build -tags nogui, GOOS=windows go build: ok
go test -count=1 -timeout 45m ./... (sandbox HOME, mote, at the pre-rebase head): every package ok but
gateway TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes (red on origin/main be400389b too, #7117) and gui
TestSetPortServesWhenTheOldOneWasTaken (TempDir cleanup race under load 48; 5 of 5 ok alone).
After the rebase onto 352b124b3..be400389b: internal/agent (45m timeout), fx, usage ok.
No GUI files touched; GUI suite not run.
Not tried: omp 18.15+ run for real (needs Bun >= 1.4.4); a WSL omp.