DeepSeek only accepts high / max / low / medium / xhigh for reasoning_effort,
but the code unconditionally forwarded the configured value as a top-level
parameter. When LLM_REASONING_EFFORT=minimal (DeepTutor convention for
"disable thinking"), DeepSeek rejects the request with:
unknown variant minimal, expected one of high, low, medium, max, xhigh
Fix across three provider layers:
- provider_core: skip top-level reasoning_effort when the provider spec
has thinking_style and the semantic effort is "minimal" — the thinking
control is already expressed via extra_body
- tutorbot: same logic + add deepseek & minimax to the extra_body chain
(they were missing, so thinking disable was silently ignored)
- cloud_provider: skip reasoning_effort=minimal for providers that handle
thinking through extra_body
Other providers (OpenAI, Anthropic, Gemini, Mistral, etc.) are unaffected
because they either don't have thinking_style or accept minimal natively.
Add Zulip as a new messaging channel for DeepTutor tutorbot.
Features:
- Private message and stream message support
- Event queue API (register/get_events/deregister) for reliable message listening
- Three-layer infinite loop protection (max_message_id, own message filter, dedup)
- File upload/download with configurable timeout and retry
- Permission control via allow_from (supports both user_id and email)
- Stream group policy: mention (respond only when mentioned) / open (respond to all)
- KaTeX/LaTeX bidirectional conversion for math formulas
- Typing indicator support for private chats (Zulip native API)
Technical highlights:
- Uses call_endpoint with custom timeout instead of send_message/upload_file
(default 15s timeout causes ReadTimeout on file uploads)
- Sync-async bridging via run_in_executor and run_coroutine_threadsafe
- Automatic event queue re-registration on BAD_EVENT_QUEUE_ID error
Tests: 88 unit tests covering all core functionality
Add whitespace-pre-wrap to the user message content div so that
newlines entered via Shift+Enter are rendered correctly instead of
being collapsed into a single line.
Add a `start` CLI command that delegates to scripts/start_web.py so users
can launch the full web app with a single command instead of manually
running `python scripts/start_web.py`.
The test hardcoded 65536 as the expected effective context window,
but after raising MAX_EFFECTIVE_CONTEXT_WINDOW to 1_000_000 the
explicit context_window=128000 is no longer truncated. Update the
assertion to match the new correct behavior.
- context_window.py: raise MAX_EFFECTIVE_CONTEXT_WINDOW from 65536 to
1000000 (safety cap, not a ceiling for reasonable configs).
Add LARGE_CONTEXT_MODEL_DEFAULT=65536 to break the circular
reference where default_context_window_for_model() returned
MAX_EFFECTIVE_CONTEXT_WINDOW, making default=ceiling=65536.
User-configured values (via WebUI or model_catalog.json) are
now respected instead of being truncated by min(x, 65536).
All default values remain unchanged (65536).
- capabilities.py: add supports_vision=True to MODEL_OVERRIDES['qwen']
so that qwen models are recognized as vision-capable regardless
of binding (custom, dashscope, etc.), not just when binding=openai.
When the Responses API path is selected for newer OpenAI models
(gpt-5.x, o1, o3, o4) and an extra kwarg of `max_completion_tokens`
flows in (typically from `get_token_limit_kwargs(model, n)`), the
OpenAI SDK raises `TypeError` from `responses.create()` before any
HTTP request leaves the client.
`_should_fallback_from_responses_error()` only catches HTTP errors
that carry a `status_code`, so the call is never retried via Chat
Completions; the user just sees a stack trace. The bug exists on
both OpenAICompatProvider and AzureOpenAIProvider, in the chat and
chat_stream paths (4 sites total).
Add `adapt_chat_kwargs_to_responses()` that translates the alias to
`max_output_tokens` and is used at all four merge sites. The helper:
- preserves the existing `None`-drop semantics of the previous
dict-comprehension merge,
- only applies the alias when `max_output_tokens` is not explicitly
set by the caller,
- does not mutate the input.
Closes#437.
The chat capability silently dropped `extra_headers` from the active
LLM profile because three downstream call sites in `AgenticChatPipeline`
did not forward them:
- `_build_openai_client()` constructed `AsyncOpenAI` /
`AsyncAzureOpenAI` without `default_headers`, so custom headers
required by some gateways (e.g. a `User-Agent` override to bypass
WAF allowlists that block `OpenAI/Python <ver>`) were lost on the
native-tool-calling path.
- `_stream_messages` and `_run_react_fallback` invoked `llm_stream()`
with `model`, `api_key`, `base_url`, `binding` but no
`extra_headers`. The factory's `_resolve_call_config` treats this
set of caller-provided fields as an explicit override and rebuilds
`LLMConfig` with empty `extra_headers`, bypassing the catalog value
loaded by `get_llm_config()`.
Pulls `extra_headers` from `llm_config` once in `__init__` and
forwards it from all three call sites.
Reproduce: configure an OpenAI-compatible gateway whose WAF rejects
the default `OpenAI/Python <ver>` User-Agent; set
`extra_headers: { "User-Agent": "Mozilla/5.0 ..." }` on the active
LLM profile in `model_catalog.json`. Before this change, chat returns
HTTP 403 "Your request was blocked." After, the override reaches the
gateway and chat succeeds.
The Provider <select> in Settings used `bg-transparent`, leaving the
native dropdown popover unpainted. On Edge/Chromium with the
`.dark` theme the popover renders against a white surface despite
`color-scheme: dark` being set, leaving option text near-invisible
(reported in #433 with screenshots).
Switch the shared `selectClass` to `bg-[var(--background)]` so the
closed select keeps its current visual (--background matches the
form panel in every theme) and the opened popover inherits the
themed surface — `#1a1918` in dark, `#faf9f6` in light, equivalent
in theme-snow / theme-glass.
Closes#433.
get_llm_config() prefers the resolver path over .env, so the env var
was silently ignored. Apply it as an override regardless of which path
produced the config.
Replace fragile json.loads() with parse_json_response() in code,
flash_cards, timeline, and deep_dive generators. Handles LLM
responses with markdown fences, preamble text, and malformed JSON.
DeepSeek only supports high/max for reasoning_effort; minimal is a
DeepTutor convention that maps to thinking.type=disabled. Update comments
to be accurate for each provider.
- Read LLM_REASONING_EFFORT from environment in config.py
- Pass config.reasoning_effort to chat_with_retry/chat_stream_with_retry
in both complete() and stream() (was previously dropped)
- Set to "low"/"medium"/"high" to enable thinking, leave empty to use
automatic detection based on reasoning_model_patterns
- Swap reasoning_content/reasoning fallback order in _parse() to match
the precedence used when extracting reasoning_content (per Copilot review)
- Add reasoning_content → content fallback in _parse_chunks() for both
provider_core and tutorbot providers
- Fix streaming path in factory.py: when only reasoning chunks are
emitted (no direct content), fall back to response.content so
downstream consumers receive non-empty responses
- Harden idea_agent against non-dict JSON payloads
DeepSeek models (v4-flash, reasoner, etc.) return the actual response in the
reasoning_content field while leaving content empty when thinking mode is
enabled. The _parse() method only fell back to m.reasoning (DashScope-style),
causing "LLM returned empty response" errors.
Also fix idea_agent to handle LLM responses that are JSON arrays instead of
objects with an "ideas" key.