Skip to content

feat(providers): extra request body per Provider for Profile Chains - #157

Merged
sudoTomas merged 1 commit into
mainfrom
feat/provider-extra-body
Nov 6, 2026
Merged

sudoTomas merged 1 commit into
mainfrom
feat/provider-extra-body

Conversation

@sudoTomas

Copy link
Copy Markdown
Owner

A Provider in the model picker can now carry extra request fields (a JSON object), set on every surface: service, API (POST /providers/{name}/extra-body), MCP (set_provider_extra_body), CLI (trader provider set-extra-body), and the desk.

Why: OpenRouter's nvidia/nemotron-3-super-120b-a12b reasons by default and returns empty content at decide's 512 max_tokens. The .env chain could already send {"reasoning":{"enabled":false}} via TRADER_DECIDE_EXTRA_BODY, but a Profile Chain's vendor Provider could not.

  • Migration 0020 adds providers.extra_body (jsonb, default {}); every save is audited.
  • chat_template_kwargs is refused on any Provider that is not the Nemotron preset endpoint, and dropped at client build if the preset URL later moves.
  • Anthropic and Jev Providers refuse a non-empty extra body, since their clients never send it.
  • A save bumps updated_at, already part of the client cache key, so the next call uses it.

https://claude.ai/code/session_01UDNLNu854ULHbHSL59UJKu

A Provider can now carry an extra_body: a JSON object merged into every chat
request a Profile Chain sends it, the picker's counterpart of
TRADER_DECIDE_EXTRA_BODY. OpenRouter's nemotron-3-super reasons by default
and returns empty content at decide's 512 max_tokens; with
{"reasoning":{"enabled":false}} it answers.

- migration 0020: llm_providers.extra_body jsonb NOT NULL DEFAULT '{}'
- ProviderDesk.set_extra_body: JSON object (or its text, loads_extra_body
  semantics), {} clears, audited as set_provider_extra_body; refuses
  chat_template_kwargs unless the base URL is the Nemotron preset endpoint,
  and refuses fields on Anthropic/Jev Providers, which would never send them
- list/_out shows extra_body
- one service capability, wired to API (POST /providers/{name}/extra-body),
  MCP (generated) and CLI (trader provider set-extra-body)
- ProfileDesk: vendor clients send the Provider's body; the preset endpoint
  gets apply_thinking_guard(body); chat_template_kwargs is dropped at build
  if the preset URL has since moved. updated_at invalidates cached clients,
  as a key change does
- on_preset_endpoint moved to llm.nemotron and shared by both desks
- desk: Extra body editor on OpenAI-chat Provider rows, route allowlisted

Claude-Session: https://claude.ai/code/session_01UDNLNu854ULHbHSL59UJKu
@sudoTomas
sudoTomas merged commit 7130d25 into main Nov 6, 2026
1 check passed
@sudoTomas
sudoTomas deleted the feat/provider-extra-body branch November 6, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant