* fix(llm): force temperature 1.0 for gpt-6 and treat reasoning_effort+tools rejection as tool-schema unsupported
* fix(llm): drop reasoning_effort instead of tools when combined request is rejected
---------
Co-authored-by: Shaikh Fardin <152140625+Fardin7798@users.noreply.github.com>
Co-authored-by: OrdoAbChao7 <2369980241@qq.com>
The quiz panel sends per_type_counts (e.g. choice=3, fill_in_blank=2)
and the planner prompt asks for that exact mix, but _parse_plan only
enforced the allowed types and difficulty. A planner that returned five
choice templates produced a five-choice quiz.
Retype the surplus templates to the types that are still short, keeping
topics, order and difficulty.
CallToolTool answered every unforwarded call with "load it first". That
was wrong for a tool already in tools[] (an MCP tool, a built-in) and for
malformed arguments, and for the former it sent the model round in a
loop. DeferredToolLoader.proxy_refusal now names the reason (missing
name, call_tool itself, already in the tool list, proxy off, unknown,
not loaded) and proxy_arguments checks the arguments: an object, or a
string holding valid JSON for one; anything else is refused. The
pipeline's _resolve_proxied_tool_calls and CallToolTool both go through
proxy_call_refusal, so the message matches the decision.
Setup tools loaded through load_tools are proxied. Opening setup mode
later left them proxied: not in tools[], no rules (already loaded), and
a note that never mentioned call_tool. An opened mode's tools are now
made native, like mastery's outline tools; a setup turn whose tools are
still proxied gets a hint to reach them through call_tool.
Also: call_tool is mounted only when the loader has built-in/capability
tools to proxy; its manifest order no longer duplicates load_tools'; a
forwarded call without an id is not marked for renaming.
Refs #2972
load_tools appended the loaded schema to the end of tools[]. tools[] is the
first thing in the provider's prompt-cache key, so the next request of the
same turn re-processed the system prompt and the whole history.
When the turn mounts the new call_tool builtin, load_tools now returns the
loaded tools' definitions in its result and leaves tools[] alone; the loop
forwards each call_tool call to the named tool before dispatch, so the tool
runs with its own argument checks, injected kwargs and trace, while the
history keeps the model's own call. Tools loaded this way stay proxied for
the session (loaded_tools.json gains proxied_tools). Runtime loads that must
land in tools[] pass native=True; the TypeScript engine keeps the old
behaviour.
The setup protocol (confirm with ask_user before apply_setting, never
handle secrets, ...) reached the model only in the load_tools result or
the turn that opened setup mode. Once history snipping or summarisation
dropped that message, the setup tools stayed in tools[] without their
rules. A setup turn (explicit mode or an intent message) whose capability
already has tools loaded now gets the protocol repeated in its turn note,
and the intent wording says the tools are already loaded.
A partner turn refuses every setup write (setup/access.py can_write), so
the setup tools are no longer listed under Extended Tools or pointed at
by the turn note there. Non-admin users keep them: personal preferences
are still theirs to change.
Also correct the comment about when set_deferral_available runs:
is_active is already asked by the exclusive-capability checks before it.
Refs #2972
The deferred-tool notes imported deeptutor.tools.research_tools on every
turn that had local deferred tools, so a minimal install (setup tools
deferred, no research module) failed the chat turn with
ModuleNotFoundError. Import it only when the research module is enabled,
as the rest of the pipeline already does.
Refs #2972
SetupCapability.turn_note and the legacy setup system block now read the
header, gap-list heading, intro section and explicit/intent/intro leads from
capabilities/setup/prompts/{en,zh}/notes.yaml (overridable under
setup.notes.<key>); the intro section gains a Chinese version. The Extended
Tools manifest header no longer says every entry is supplied by an external
service, since built-in setup and research tools are listed there too.
json-repair was closing the partial arguments and the tool then ran, so a
write could persist half a value and report success. A truncated round now
keeps the text and records one not-executed result per call.
Fixes#2713
Signed-off-by: fanjiahe <fanjiahe@mail.ustc.edu.cn>
Co-authored-by: Cursor <cursoragent@cursor.com>
When a tools snapshot goes away (a session stored before native requests
dropped the text manifest, or the turn after a schema-rejection fallback),
the generic retraction said the section is now empty, which reads as "no
tools" while the request carries native schemas. The tools snapshot now
gets its own retraction text, in the Python loop and the TypeScript engine.
Refs #2973
The provider-side fill only adds "" once another round in the request
already carries reasoning. A thinking model that calls a tool with no
reasoning on the very first round of a turn (or on every round so far)
still got the field dropped, and DeepSeek rejected the next request.
The stream says whether the model is thinking: DeepSeek in thinking
mode sends reasoning_content (as "" when it has nothing), and never
sends the key with thinking disabled. Record that on LLMCallResult and
send the tool round back with "" when the field was declared. Providers
that never send the field get nothing added.
Refs #2976
The fallback used when geogebra_user.md is missing had no "## 图片"
section, so it already differed from the file. The file ships as
package data like geogebra.md, so the agent now reads it directly and
the test checks the image section reaches the user message.
Refs #2974
Two assertions could not fail: "report" in the research user message
matched other words, and the question number check passed for any digit
near the template heading. They now look for the rendered mode
(``report``) and for "#n of 3" / "第 n/3 道". The research forced-finish
docstring said tool_choice="none" while the test asserts "auto".
Refs #2974
The forced FINISH round keeps the loop's tools, so the model may still
call one. That call is not run, and the assistant turn added before the
repair note had empty content plus the round's reasoning or thinking
blocks. Anthropic rejects an empty text block, so the turn now carries a
short note ("Tool call not run: this round must finish.") when the round
returned tool calls and no text. Rounds that returned text are unchanged.
Refs #2974
The research block already tests the case where the model calls a tool
in the forced FINISH round; deep_question's _force_finish had no such
test. The new test checks that both requests carry the tools, the call
is not dispatched (no tool or tool_calls messages) and the repair note
is appended before the second attempt.
Refs #2974
When a research block or a deep_question explore/quiz loop runs out of
rounds, the forced FINISH request was sent with no tools. Removing the
tools changes the first bytes of the request, so none of the block's
history is served from the provider cache. In a real deep_research run a
block's forced finish paid 28.6k and 279.8k uncached tokens.
The forced rounds now send the loop's tool schemas unchanged; the prompt
already tells the model to stop calling tools. tool_choice="none" is not
used because DeepSeek renders it like no tools (replayed: 1,152 cached
tokens with "none" or no tools, 14,976 with the tools left as they were).
A tool call in a forced round is not dispatched; it fails the attempt and
gets the existing repair note.
Refs #2974
* fix(video): align scene narration and fit diagrams
- Refine bilingual prompts for scene-by-scene narration and visuals
- Fit and center SVG diagrams with their labels and strokes
- Improve geometry coordinate guidance and preserve layout retries
* fix(video): do not report a fitted scene graphic as overflow
The kit scales a graphic with a transform on its full-size frame, so the
scaled frame box and the SVG canvas can exceed the region while the drawing
fits. Measure HTML overflow without that transform and canvas.
---------
Co-authored-by: zzzworm <15828873+zzzworm86@user.noreply.gitee.com>
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
* fix(math_animator): make the code-repair deadline configurable
The render-fix loop's overall repair timeout was fixed at 180s: run_render
built CodeRetryManager without passing repair_timeout_seconds, so the knob
existed on the manager but was unreachable from settings. A long reasoning
model repairing a book animation was cancelled mid-edit at that ceiling with
no way to raise it (#2767).
Lift the deadline into a runtime setting capabilities.math_animator.repair_timeout
in main.yaml, read once in run_render through a get_math_animator_params getter
that shares the UI's coerce/clamp path. The single read site covers all three
callers (math_animator capability, visualize Manim route, book AnimationGenerator),
and an in-flight render keeps the value it started with. The apply branch only
persists when the key is present, so saving unrelated animation settings does not
shadow the loop's default (#1316 shape). Clarify both repair-timeout errors to name
the stage, the effective seconds, and that this is a local deadline rather than a
provider connection failure.
Backend only; the Settings-form field is left to a follow-up and failure-stage
diagnostics/artifact retention to #2768.
* fix(config): keep repair timeout default out of settings saves
The Settings page PUTs the full GET DTO, so exposing the runtime default caused unrelated saves to persist repair_timeout=180. Omit it until explicitly configured, cover the full round trip, and soften the timeout diagnostic.
---------
Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
Prepare v1.7.3 notes for reading and book editing, expanded provider and
agent connections, learning records, model streams, and desktop upgrades.
Sync README prose and 11 translations, archive older release notes, and
update the package version. Resolve release lint/type blockers with explicit
parser and capability contracts, compatible Book call forwarding, accurate
auth task types, and quoted SQLite schema identifiers. Cover positional Book
calls and quoted legacy columns; align KB seed tests with visible retrieval
failure reporting. Keep HTTP fixtures independent of host proxies and translate
new Portuguese UI copy.
Release notes: assets/releases/ver1-7-3.md
Move the context-full finish reason into the shared LLM protocol and add English and Chinese notices; test both localized warnings and provider mappings (186 passed).
The chat loop replays the workspace note as the "workspace" runtime
snapshot, which lives inside the cached prompt prefix. The note embedded
workspace.logical_output_dir — outputs/chat/<session>/<turn>/ — so its
bytes changed on every turn: the snapshot-replace logic cut the old copy
out of the middle of the rebuilt history and appended a fresh one,
invalidating the provider prompt cache on every multi-turn request
(cached-token hit rate <1%; single-turn tool loops were unaffected).
- workspace_system_note(state_turn_path=False) keeps the replayed chat
snapshot byte-identical for the whole session and points at the current
user message for the exact path instead.
- new workspace_turn_note() delivers the per-turn output folder in the
trailing user message — fresh bytes each turn, so cache-safe by
construction.
- phase-built prompts (question/research pipelines) keep embedding the
exact path via the default state_turn_path=True; their behavior is
unchanged.
- model-history reconstruction keeps an exact prefix once snapshots are
stable; new multi-turn replay tests assert byte-level prefix extension
across three consecutive turns, plus the second factor named in the
issue turns out to be a consequence of the turn-scoped snapshot and
needs no separate change.
Verified: tests/agents/chat 273 passed; tests/capabilities 739 passed;
tests/services/workspace+session 709 passed (8 failures pre-exist on the
clean tree and are unrelated); remaining tests/agents failures pre-exist.
model_context_window_exceeded mapped to "length", which the agent loop
treats as an output cap and answers with continue_truncated, resending the
same full history. Report it as context_length_exceeded instead, and have
the loop end the round with a notice.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Carry the #958 service-layer reasoning_effort override through the whole
turn contract: the core TurnRequest LLMSelection accepts the field
(validated against VALID_REASONING_EFFORTS, old two-ID payloads unchanged),
the generated web contracts are regenerated, and ChatStateAdapter's
asLLMSelection restores a legal override instead of dropping it.
The composer gains a selector beside the model picker, offering only the
levels the selected model supports (live supported_reasoning_efforts or
the provider/model tables) narrowed to the wire vocabulary, hidden when
the model has none. The choice persists on the conversation's
llm_selection, so the next send uses it without a backend restart and
other conversations are unaffected; switching models resets the override.
Precedence stays conversation override -> profile/model default ->
provider default, and the context-budget readout reports the effective
effort beside the model when one was used.
The tool-result summarizer always sent stream_options and, on providers
that reject it, only logged a warning and dropped the summary. Retry once
without stream_options, as agent_loop and labeled_step already do.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>