Skip to content

fix: thinking+json_mode crash, SSE dedup, improve meeting summary quality#17

Merged
superdd-coder merged 4 commits into
mainfrom
fix/dashscope-thinking-format
Jul 19, 2026
Merged

fix: thinking+json_mode crash, SSE dedup, improve meeting summary quality#17
superdd-coder merged 4 commits into
mainfrom
fix/dashscope-thinking-format

Conversation

@superdd-coder

Copy link
Copy Markdown
Owner

Summary

  • Fix thinking+json_mode crash: Extract JSON from reasoning_content before _strip_think() when json_mode is active. Fixes empty response bug on DashScope/mimo models where JSON answer gets trapped inside <think> tags.
  • SSE stream deduplication: Prevent duplicate LLM calls when page refreshes during blueprint/section generation. New SSE connections reuse the existing task's event queue.
  • Token budget scaling: Auto-scale max_tokens 2x when thinking mode is active, preventing content truncation (especially Detail sections).
  • Meeting summary quality: Rewrite Detail section prompt — final answers only, no discussion journey. Speaker attribution only for decisions/opinions, not for stating facts.
  • Language constraint: Strengthen language instruction to prevent random Chinese output on English transcripts.
  • Inference rules: Allow simple single-step arithmetic derivations, forbid multi-step/domain-specific ones.

Files changed

File Changes
src/providers/llm/openai_compat.py _extract_json_from_raw() helper + generate() fallback fix
src/meeting/service.py SSE dedup (blueprint + section) + _thinking_max_tokens()
src/prompts.py Detail writing style + language constraint + inference rules

DashScope's OpenAI-compatible API expects {"enable_thinking": bool}
for thinking mode, not DeepSeek's native {"thinking": {"type": ...}}.

The wrong format caused DashScope to return misleading 400 errors like
"Range of input length should be [1, 1000000]" even when input was
well within limits.  This affected all meeting summarization calls
when meeting_thinking was enabled with a DashScope provider.

- Detect DashScope endpoints via base_url (dashscope.aliyuncs.com)
- Add _build_thinking_extra() helper for format dispatch
- Apply to all three call sites: generate, generate_stream_tagged,
  generate_stream
…cription

- Auto-open floating transcript panel on the rising edge of
  realtime transcription starting (false → true transition)
- After recording stops and audio is saved, automatically trigger
  file transcription if a cloud/file provider is configured, replacing
  realtime WebSocket segments with full-quality transcription
…ord mode

When coming from record mode, save_realtime_transcript already set
status to completed.  The upload_audio endpoint was unconditionally
resetting status to created, which broke the flow where the frontend
expects completed status to immediately trigger /transcribe.

Now only resets to created if there's no transcript yet (pure upload).
…lity

- Extract JSON from reasoning_content before _strip_think() when
  json_mode is active (fixes DashScope/mimo empty response bug)
- Deduplicate blueprint and section SSE streams to prevent duplicate
  LLM calls on page refresh
- Scale max_tokens 2x when thinking mode is active
- Rewrite Detail section style: final answers only, no discussion
  journey, speaker attribution only for decisions/opinions
- Strengthen language constraint (hard failure on language switch)
- Add inference rules: allow single-step arithmetic, forbid
  multi-step/domain-specific derivations
@superdd-coder
superdd-coder merged commit ed7e87d into main Jul 19, 2026
4 of 6 checks passed
@superdd-coder
superdd-coder deleted the fix/dashscope-thinking-format branch July 19, 2026 14:44
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