refactor: carry catalog tier on the model
Move the catalog tier from the x-nous-catalog-tier request header to a catalogTier property on each model. pi forwards only model.headers to the provider and copies them into the request options, so a header needed stripping on both the model and the options before every request; that adapter leaked for two audit rounds. A property never reaches the wire, survives pi's model store, and needs no wrapper, so TIER_HEADER, untier and withoutTierHeader are deleted and pi's stream passes through untouched. Models stored by the previous version come back without the property until the next interactive start rewrites the store; the CHANGELOG tells the user to start pi once interactively after upgrading.
This commit is contained in:
1 parent
a1735049b7
commit
cb5aecf815
5 files changed
+26
-73
No files matched your search
@@ -14,7 +14,7 @@
|
||||
|
||||
- Uses the **native** pi-ai `Provider` (`createProvider`) rather than the legacy `ProviderConfig` + `oauth` block. The legacy `getApiKey` contract pushes an extension toward minting an agent key; Nous retired that endpoint (`410 session_key_minting_retired`). Here `OAuthAuth.toAuth` returns the access token itself, and pi owns the locked refresh pattern. See `docs/adr/0001-stack.md`.
|
||||
- Streaming is delegated to pi's built-in `openai-completions` API. No custom wire protocol.
|
||||
- `Model.headers["x-nous-catalog-tier"]` carries the catalog tier **on the model**, because pi persists and restores model objects across runs and a side table would miss restored entries. `withoutTierHeader` strips it from both the model and the request options before every request (pi copies `model.headers` into `options.headers` before calling the provider).
|
||||
- The catalog tier rides **on the model** as the `catalogTier` property, because pi persists and restores model objects across runs and a side table would miss restored entries. It is a property, not a header: pi forwards only `model.headers` to requests (and copies them into the options first), so nothing is stripped before a request. Do not move it into `headers` without bringing back a strip on both the model and the options. The persisted catalog is `<agentDir>/models-store.json` (`ModelsStore`); `models.json` holds only user overrides, so check the store when verifying anything carried on a model.
|
||||
|
||||
## Conventions and gotchas
|
||||
|
||||
|
||||
Reference in new issue
Block a user