3 Commits

Author SHA1 Message Date
zszz3
9c4b74deda fix: drop the inline copy of the geogebra user template
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
2026-11-30 13:44:53 +08:00
zszz3
9412a7c435 fix: send geogebra instructions as system prompt and the question as user 2026-11-30 03:47:50 +08:00
Albertanda
08963e29ab fix(geogebra): repair image analysis that crashed before any model call (#1362)
* fix(geogebra): repair image analysis that crashed before any model call

Every invocation of the ``geogebra_analysis`` tool died with a TypeError
before reaching a model: ``_call_vision_llm`` passed a ``verbose=False``
kwarg that ``BaseAgent.stream_llm`` does not accept (the signature has no
``verbose`` parameter and no ``**kwargs`` fallback). Image understanding —
the only path that turns a problem figure into GeoGebra commands — was
therefore broken end to end, in both chat and deep_solve.

Two repairs in the vision solver agent:

* drop the nonexistent ``verbose=`` kwarg so the call reaches the model;
* make ``_extract_json`` tolerate what reasoning vision models actually
  return: a ``<think>`` preamble (e.g. Qwen3-VL-*-Thinking), prose after
  the JSON object, multiple fenced blocks (the last one wins), and bare
  tail JSON. The comment and trailing-comma tolerance of the original
  parser is preserved.

Regression coverage: parametrized ``_extract_json`` cases for the shapes
above, plus a test asserting ``_call_vision_llm`` forwards no ``verbose``
kwarg while still building the multimodal ``image_url`` message.

* fix(geogebra): bound a stalled vision analysis with a 240s timeout

An unbounded ``await agent.process(...)`` lets a stalled provider hang the
whole turn. Reasoning VL models legitimately take minutes on hard figures,
so the bound is generous (240s): it only converts a silent hang into a
loud, actionable failure ("retry, or describe the figure in text") instead
of leaving the learner staring at an empty response.
2026-09-10 23:44:08 +08:00