Each capability now owns its own answer-now branch so the early-exit
respects the capability's natural output shape:
- chat -> synthesize markdown answer (existing behavior)
- deep_solve -> skip planning + reasoning, jump to writer
- deep_question -> skip ideation, emit full quiz JSON in one structured call
- deep_research -> skip rephrase/decompose/research, write report directly
- math_animator -> skip analysis/design/summary, KEEP code-gen + render
- visualize -> skip analysis/review, emit renderable code in one call
The orchestrator no longer rewrites answer_now turns into chat. It now
preserves active_capability and only falls back to chat when the
originally selected capability is missing from the registry.
Shared plumbing lives in deeptutor/capabilities/_answer_now.py
(extract gate, trace summary formatter, skip notice, LLM stream
wrapper, chunk joiner). Each fast-path preserves the same result
envelope so QuizViewer / MathAnimatorViewer / VisualizationViewer
render unchanged, and prepends a "Skipped X stage(s)" notice so the
user knows it was a best-effort early exit.
Frontend: handleAnswerNow no longer overrides snapshot.capability.
Tests: rewrote the orchestrator routing tests for the new contract;
added tests/capabilities/test_answer_now.py with 28 cases covering
the helpers and every per-capability fast-path (including unparseable
JSON / invalid render_type / fence-wrapped JSON recovery, and a
math_animator test that verifies analysis/design/summary are NOT
invoked while code-gen + render ARE).
Updated v1.1.1 release notes to reflect the new design.
Made-with: Cursor