Files
NeuroSploit/neurosploit-rs
Joas A SantosandClaude Opus 5 a00c856960 feat(providers): full custom provider profiles, not just a base URL
The registry held {name: base_url}. That covers an endpoint speaking plain
OpenAI over a direct connection — most of them, and none of the awkward ones:
a gateway wanting its own session header, an endpoint only reachable through a
SOCKS proxy, a model whose price the cost ledger cannot guess from its name, a
tenant whose rate limit sits far below the provider's published one.

Add CustomProvider: base_url, wire format, model list, proxy, session header,
user agent, rps/rpm, context window, and four prices. Entries written as a
bare URL string still load, so an upgrade does not lose anyone's providers,
and `register` now merges rather than replaces — editing the URL from the CLI
no longer drops a proxy and pricing set elsewhere.

Every field changes behaviour; none is stored for display:

  proxy and user_agent    build a per-provider reqwest client, cached on the
                          settings so an edit takes effect without a restart
  session_header          carries a per-process id, for gateways that pin
                          prompt-cache routing on one
  models                  reaches the Provider, so pickers can offer them
  price_*                 overrides pricing_for, which otherwise guesses from
                          the model name — and a private gateway's model name
                          says nothing about what the operator is billed

A proxy that reqwest rejects does not fall back to a direct connection. It
points at a dead local port and says so, because silently leaving the proxy is
the one outcome an operator routing through one cannot afford. Malformed
proxies and unknown wire formats are refused at save time.

Seven tests, including that a bare-URL registry still loads and that
registering a URL keeps the rest of the profile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 14:31:10 -03:00
..