fix: address round-3 review findings

- Strip the catalog-tier header from request options too. pi copies
  model.headers into options.headers before calling the provider
  (pi-ai getAuth -> prepareRequest) and the client applies
  options.headers last, so the header still reached Nous on every
  free/promo request; the old test pinned the leak. Both sides pinned.
- Drop the 'Press Enter' prompt in OAuth login: it cleared pi's
  device-code confirm action (login-dialog showPrompt), so Enter opened
  nothing. pi's own dialog shows the code and opens the browser.
- Poll interval rejects non-finite values (Node clamps an overflowing
  setTimeout to 1 ms) and each sleep is capped at the deadline, matching
  pi-ai's poller.
- Tests: 17 (was 14). /nous-free back to full, /nous-catalog cycling,
  and startup restore of a saved catalog are covered.
- Docs: README says the live list overlays the baseline by id (baseline
  ids that vanish stay listed); AGENTS.md states both strips.
This commit is contained in:
AlexKucera committed 2026-11-25 10:28:25 +01:00
1 parent b9065d409c
commit 8d91094022
4 files changed
+75 -24

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ The choice is saved in `~/.pi/agent/nous-portal-catalog` and survives restarts.
### Offline baseline
`pi -p` and `pi --list-models` never fetch live catalogs (pi hard-codes `allowModelNetwork: false` there), so the provider ships a small static baseline so it is always usable. Interactive pi replaces it with the live list.
`pi -p` and `pi --list-models` never fetch live catalogs (pi hard-codes `allowModelNetwork: false` there), so the provider ships a small static baseline so it is always usable. Interactive pi overlays the live list on the baseline by model id; a baseline id that disappears from the live catalog stays listed, with its frozen baseline price and context, until the next release.
## Known limits