13 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
3a3cb277c1 fix(runtime): localize incomplete turn notices 2026-10-19 00:33:38 +08:00
yepyhun
f8fa061759 test: reproduce incomplete capability reported as completed 2026-10-13 13:22:12 +02:00
Gao Chenkai
3192757d45 fix: handle DeepSeek reasoning budget exhaustion (#1331)
* fix: handle DeepSeek reasoning budget exhaustion

* style: satisfy ruff format, the one thing CI was red on

`ruff format --check` on agent_loop.py, the Responses parser and the test
file that came with them. No behaviour change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 01:43:40 +08:00
Hyeonsang Cho
3fab0de80d fix(runtime): cancel the capability when a turn's consumer stops (#1413)
`ChatOrchestrator.handle()` runs the capability in its own task and only
reads the bus, so a consumer that stopped reading never reached that
task. Pressing Stop persisted the turn as cancelled while the capability
kept calling the model and running tools until it finished on its own.
A capability parked on `ask_user` was never cancelled at all: once the
turn dropped its references it was destroyed mid-await, `_run`'s cleanup
failed before `unregister_bus`, and the turn's StreamBus stayed in the
registry for the life of the process.

Cancel and await the capability task in a `finally` around the
consumption loop, the same shape `llm.factory.stream()` already uses, so
both a cancelled consumer and a stream closed early take the capability
down with them. A normal turn is unaffected: its task has finished by
the time the loop ends.
2026-09-14 01:28:23 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
alanguan73
e82cdc5641 feat: /whisper dual-seat page and capability-complete forwarding (#921)
Adds a /whisper workspace page (seat switch, room_id from the stream, trainee-only whisper/debrief) over the existing unified-ws with capability + config.room_id, and lets a capability publish a body and declared extras on CAPABILITY_COMPLETE via context.metadata['agent_output'] / ['event_metadata'] — capability, session_id and turn_id stay unspoofable.
2026-08-20 00:29:48 +08:00
Bingxi Zhao
f12d6a8a1f fix: recover model catalog and provider transport (#888) 2026-08-17 01:58:23 +08:00
Dongyu
67283cfeb1 fix(chat): make capability failures terminal instead of blank messages (#732)
A capability raising an exception emitted a metadata-less error plus a status-less DONE, so turn_runtime stamped the turn 'completed' and the frontend — which renders the error card only on turn_terminal — showed an empty assistant message.

The orchestrator now emits the error/DONE pair with turn_terminal and a failed status, turn_runtime persists the real outcome instead of an unconditional 'completed', and the unknown-capability branch emits a DONE it previously omitted.

Closes #731.
2026-08-03 20:27:43 +08:00
Bingxi Zhao (Frank)
c9d387e2b6 super super great great update 2026-06-17 00:56:27 +08:00
Bingxi Zhao (Frank)
77f29cbcc7 fix lint 2026-04-23 19:29:16 +08:00
Bingxi Zhao (Frank)
4ef783066c feat(answer-now): per-capability fast paths instead of forced chat reroute
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
2026-04-17 23:32:45 +08:00
Bingxi Zhao (Frank)
e8aa57d737 release: v1.1.1 — universal answer-now, co-writer scroll sync, notebook system unification, tutorbot config refactor
- Promote "Answer now" to a universal escape hatch via answer_now_context;
  orchestrator re-routes any capability to chat._stage_answer_now.
- Co-Writer: draggable split + persistent ratio + line-anchored
  bidirectional scroll sync using a hidden mirror for wrap-aware editor y.
- SaveToNotebookModal: optional message-selection mode with quick presets;
  rebuild transcript / userQuery from the selected subset.
- Adopt the real notebook API (/api/v1/notebook/*) across Knowledge tab,
  guide notebook picker, and save-to-notebook flow; new typed helpers in
  web/lib/notebook-api.ts (listNotebooks/getNotebook/createNotebook/...).
- Extract CollapsibleConfigSection; unify Quiz / Math Animator / Visualize
  / Deep Research panels behind one collapsed-summary header.
- Replace streaming spinner with a dedicated Stop button; persistent
  composer header; mask-gradient on messages container.
- TutorBotManager: public load/save/merge API; atomic write via temp +
  Path.replace; merge_bot_config with explicit-clear semantics; new
  tests/services/tutorbot/test_manager_config.py.
- MarkdownRenderer: trackSourceLines passes data-source-line through;
  RichCodeBlock skips Prism for unlabeled/plaintext fences; mermaid
  detection includes flow/seq/sequence editor.md fences.
- UI/theme: deeper foregrounds + warmer borders for light/Snow themes;
  /guide migrated off hardcoded slate/indigo to design tokens;
  HistorySessionPicker themed and timestamp-seconds bug fixed.
- Filter system messages out of UnifiedChatContext.hydrateMessages and
  ChatMessageList so backend grounding context never renders as a bubble.
- Bug fixes (already merged earlier in dev):
  * tutorbot config wipe on restart (#332)
  * selective_access_log middleware unpack crash (#334/#335)
  * 15 npm security vulnerabilities — jspdf/next/mermaid (#330)
- Drive-by: remove "// README" typo from .env.example_CN.
- Add v1.1.1 release notes and update README.

Made-with: Cursor
2026-04-17 22:43:52 +08:00
Bingxi Zhao (Frank)
9544075d60 v1.1.0-beta
URL-based chat routing, Snow theme, WebSocket heartbeat & auto-reconnect,
ChatComposer perf optimization, embedding provider registry overhaul,
Serper search provider, streaming idle timeout, and expanded test suite.

Made-with: Cursor
2026-04-14 22:11:48 +08:00