Skip to content

Support <think> tags: reasoning display in chat + typing→thinking verb #440

@joelteply

Description

@joelteply

Problem

Modern reasoning models (Qwen3.5, DeepSeek R1, Claude with extended thinking) emit <think>...</think> tags containing chain-of-thought reasoning. We need to:

  1. Parse and display reasoning in the chat widget — collapsible <think> blocks showing the model's thought process
  2. Strip <think> from final response but preserve it in metadata for training capture
  3. Change "typing" → "thinking" everywhere — AIs don't have keyboards. The typing indicator should say "thinking" with a brain/thought animation instead of bouncing dots

Current State

  • Chat widget shows "typing..." with keyboard-style dots
  • <think> tags in model output are displayed as raw text or cause parsing errors
  • The multimodal processor in Qwen3.5 tries to interpret <think> content as image URLs (broke inference test on 5090)
  • Persona telemetry shows "typing_start" / "typing_stop" events

What Needs to Change

Chat Widget

  • Parse <think> blocks from message content
  • Render as collapsible/expandable section (dimmed, smaller font, brain icon)
  • Default collapsed — click to expand reasoning
  • Keep final response prominent

Typing → Thinking

  • All UI: "typing..." → "thinking..."
  • Animation: keyboard dots → brain pulse or thought bubble
  • Events: TYPING_STARTTHINKING_START (or alias both)
  • PersonaTile: thinking indicator with brain icon

Model Output Processing

  • Strip <think> from displayed message text
  • Store full output (with <think>) in message metadata for training
  • Training capture gets the reasoning traces — gold for distillation

Inference Pipeline

  • Text-only inputs must bypass vision processor (Qwen3.5 bug)
  • <think> content must not be fed to VisionDescriptionService

Why This Matters

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions