unsloth/studio/backend
Daniel Han 5ec1208206 Fix consensus review findings on PR 5711
Round 3 of 3-Opus parallel review (2 reviewers HIGH on the persistence
chain, 2 HIGH on the routing chain, 1 HIGH on the test coverage gap).

HIGH fixes:
1. chat-runtime-store.ts: PERSISTED_INFERENCE_PARAM_KEYS extended from
   16 to 44 keys (28 extended samplers added). Before this, any value
   set on the Advanced Sampling sliders was lost on page reload because
   getChangedInferenceParams / getHydratedSettingsState iterate this
   list.
2. routes/chat_history.py: ChatInferenceSettings (extra="forbid")
   extended to mirror InferenceParams including fastMode + 28 new
   samplers. Without this every settings PUT containing any of those
   fields would 422.
3. routes/inference.py _build_openai_passthrough_body: was forwarding
   typical_p / mirostat / dynatemp but silently dropping dry_*, xtc_*,
   min_keep, ignore_eos, min_tokens, vLLM output knobs (skip/spaces
   special-tokens, include_stop_str_in_output, truncate_prompt_tokens),
   and llama.cpp instrumentation flags (n_keep, n_probs, cache_prompt,
   return_tokens, timings_per_token, post_sampling_probs). Now forwards
   all 18 to _build_passthrough_payload.
4. routes/inference.py _proxy_to_external_provider + external_provider.py
   stream_chat_completion: 20 extended kwargs are now plumbed through
   the route -> client -> OAI-compat body builder. Before this fix the
   chat-adapter computed top_a / vLLM output knobs / llama.cpp samplers
   on the frontend, sent them on the wire, and the route layer dropped
   them on the floor.
5. test_sampling_params_routing.py: extended
   test_chat_settings_payload_accepts_new_sampling_keys to round-trip
   every persisted field (was only 5). Added
   test_openrouter_forwards_top_a and test_vllm_forwards_output_shape_knobs
   to lock in the new wire forwarding.

MEDIUM fixes:
- providers.py: Mistral stop_max=4 (matches third-party shims; OAI docs
  publish no max but every consumer caps at 4).
- providers.py: Kimi body_omit now includes "presence_penalty" (Kimi
  k2.5/k2.6 chat schema lists temperature/top_p/max_tokens/stream/tools/
  tool_choice/thinking but not presence_penalty).
- external_provider.py: body_omit loop also pops the seed_field
  rename so a future provider with both `seed_field="random_seed"` and
  `body_omit=("seed",)` strips correctly. No current provider has both;
  defensive only.
- chat-adapter.ts: local-path parallel_tool_calls forwards only on
  explicit opt-out (matches the external-path stanza). Before this the
  field was sent on every chat from every existing local user.
- chat-settings-sheet.tsx: service tier Select now clamps the displayed
  value to a legal option for the active provider (e.g. "priority"
  saved on OpenAI, then user switches to Anthropic which only allows
  auto/standard_only -> Radix Select was showing a blank trigger).

LOW fixes:
- Em-dash cleanup: 7 em-dashes removed from provider-capabilities.ts /
  runtime.ts / chat-settings-sheet.tsx / test_sampling_params_routing.py
  per project rules.

Tests: 397/397 backend pass (sampling routing 69 plus anthropic /
openai / gemini / llama-server suites). Frontend tsc + vite build clean.
2026-05-27 16:32:21 +00:00
..
assets Add Qwen3.6 inference defaults for Studio (#5065) 2026-04-16 11:42:42 -07:00
auth studio: security and hardening pass (auth rate-limit, sandbox, path containment, schema validation, headers) (#5375) 2026-05-13 06:12:18 -07:00
core Fix consensus review findings on PR 5711 2026-05-27 16:32:21 +00:00
loggers Studio: stop truncating long log lines as suspected base64 (#5335) 2026-05-08 13:07:18 +04:00
models Tighten comments across PR 5711 (no behaviour change) 2026-05-27 14:32:11 +00:00
plugins fix(gh_client): fail fast on 401/403 auth errors instead of retrying forever (#5325) (#5329) 2026-05-08 21:57:41 +04:00
requirements Studio: add remote MCP server support (#5750) 2026-05-27 07:01:11 -07:00
routes Fix consensus review findings on PR 5711 2026-05-27 16:32:21 +00:00
state unsloth run: add --enable-tools/--disable-tools server-side tool policy (#5277) 2026-05-05 12:45:15 +04:00
storage Studio: add remote MCP server support (#5750) 2026-05-27 07:01:11 -07:00
tests Fix consensus review findings on PR 5711 2026-05-27 16:32:21 +00:00
utils Studio: add configurable CPU thread pool limit (#5760) 2026-05-27 05:09:34 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
_platform_compat.py Fix Studio crash on Anaconda/conda-forge Python (#4484) 2026-03-22 05:36:55 -07:00
colab.py Fix/studio colab button message: Add fallback message for Colab Studio button when proxy URL fails (#4866) 2026-04-05 21:57:45 -07:00
main.py Studio: add remote MCP server support (#5750) 2026-05-27 07:01:11 -07:00
run.py Studio: add configurable CPU thread pool limit (#5760) 2026-05-27 05:09:34 -07:00
startup_banner.py Studio: stop hint, Uvicorn log rename, reachability check + Mac UI CI retry hardening (#5503) 2026-05-17 07:44:06 -07:00