Repository navigation
Description
Observable failure
Client.isOpenRouter() in internal/provider/client.go decides whether a routing preference (provider.order, provider.only, the relaxation ladder's rungs) is put on the wire by testing the base URL for the substring openrouter.ai or the model id for the prefix openrouter/.
After #419 (issue #373) a proxy, a mirror, a self-hosted router or the router reached by IP gets its lane sheet by asking the base, so it ranks lanes and a person can pin one. But for a model not spelled openrouter/… on such a base, isOpenRouter() is false and the preference is never sent: the ranking never reaches the wire, and a pin the person set is silently not honoured. Nothing errors, nothing logs, the settings row still reads pinned: X. That is a silent substitution, the thing this repository's law forbids.
This is the general form of #373 one layer up: a capability decided by where the base lives rather than by what it answers.
The law
Whether a base honours routing preferences is learned the same way its sheet is: once per base, by asking, and remembered, never from the hostname or a model prefix. A preference the wire will not carry is said, not dropped: the person is told their pin cannot be sent on this base, in one visible line, rather than the pin being quietly left off the request.
Fix shape
- One answer per base, cached beside the sheet answer in
internal/lane's sheet (the same struct lanes: a base is asked whether it has a sheet, never read for its hostname #419 added the probe answer to), learned from the base's own behaviour: a base that served an endpoints page carries preferences (that is the router's contract); a base that is sheetless is asked once with a preference and its answer (honoured, ignored, or refused) remembered. isOpenRouter()survives only as the fast-path hint for the shipped router, never as the decision, exactly asLaneSheetCertaindoes in lanes: a base is asked whether it has a sheet, never read for its hostname #419.- When a pin cannot be sent, one visible line through the existing
RescueNewspath, and the settings row says so. internal/lane/lanestub's package header, which documents the hostname gate ("FIRST, the transport only sends a routing preference to something it believes is a router…"), is rewritten in the same change; it becomes the stale half of the story the moment lanes: a base is asked whether it has a sheet, never read for its hostname #419 lands.
Replication
A lanestub at its plain Server.URL() base (works after #419) with a pinned lane: grep the stub's request log for provider.only and find none, while the settings row reads pinned:.
Acceptance
- A pinned lane on a plain loopback base reaches the wire as
provider.only(lanestub asserts on its request log), with no hostname trick in the test. - The shipped
openrouter.aipath pays no extra request and behaves as today. - A base that will not carry a preference produces exactly one visible line naming the pin and the base, and the request goes out without the preference rather than not at all.
Provenance
Found by the #419 lane on 2026-09-02 while reading client.go for the envelope decoder; ruled its own issue by the coordinating session. Lands after #419, same seam family.
Drafted with CodeAF · reviewed and owned by the author
Activity
routing: an unasked base carries only what a person asked for, and th…
routing: whether a base carries a preference is learned from the base…
routing: an unasked base carries only what a person asked for, and th…
routing: whether a base carries a preference is learned from the base…
lanestub: the plain base is the only base (#426) (#554)
Lanes: the pin on the model's name is withheld where the base refuses it
Picker: → walks into a model's lanes, a fold always opens, and the pi…