DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.
Python ai-agentsai-tutorclawbotcli-tooldeepresearchinteractive-learninglearningmulti-agent-systemsrag
Merge pull request #1033 from contributor
Bingxi Zhao (Frank)8cfec4e68598
diff --cc deeptutor/tools/prompting/hints/en/exec.yamlindex eb97e20c8,8dd0e1a16..e11a0cc3e--- a/deeptutor/tools/prompting/hints/en/exec.yaml+++ b/deeptutor/tools/prompting/hints/en/exec.yaml@@@ -1,6 -1,6 +1,6 @@@short_description: "Run a shell command inside an isolated sandbox; returns stdout/stderr + exit code."when_to_use: "For data processing, running a skill's bundled scripts, or invoking CLI tools the task needs. Not for destructive or system-management commands."input_format: "`command` — the shell command. Optional `timeout` — seconds (default 30, max 300). Runs in this turn's workspace directory."- guideline: "Prefer non-interactive flags (e.g. `-y`). Keep output small; pipe through `head`/`grep` when a command is chatty. Read a skill's SKILL.md before running its scripts. For Python work or file generation, pass complete source to code_execution instead of `python -c` or a heredoc; use exec only for genuinely shell-only commands. Refer to generated artifacts exactly as the tool result lists them."- note: "Destructive patterns (rm -rf, mkfs, shutdown, …) are blocked. The sandbox confines filesystem and network access; commands that need the open internet may fail."-guideline: "Prefer non-interactive flags (e.g. `-y`). Follow the host shell named in the workspace note and use that shell's native output-limiting syntax. Read a skill's SKILL.md before running its scripts. Invoke package management as `python -m pip` so it targets the same interpreter. If the user asks you to create/export a file, run the command, save the file in the workspace, then include any Generated artifacts URL from the tool result in your final answer."++guideline: "Prefer non-interactive flags (e.g. `-y`). Follow the host shell named in the workspace note and use that shell's native output-limiting syntax to keep output small. Read a skill's SKILL.md before running its scripts. For Python work or file generation, pass complete source to code_execution instead of `python -c` or a heredoc; use exec only for genuinely shell-only commands. Invoke package management as `python -m pip` so it targets the same interpreter. If the user asks you to create or export a file, save it in the workspace and refer to its Generated artifacts URL exactly as the tool result lists it."+ note: "Destructive patterns (rm -rf, mkfs, shutdown, …) are blocked. On failure, inspect STDERR, the exit code, and the actual shell. Do not describe syntax or dependency failures as sandbox denial; report a filesystem or network restriction only when the tool explicitly returns that error."phase: "expansion"diff --cc deeptutor/tools/prompting/hints/zh/exec.yamlindex 2d928b72e,c96bc94e2..075768e06--- a/deeptutor/tools/prompting/hints/zh/exec.yaml+++ b/deeptutor/tools/prompting/hints/zh/exec.yaml@@@ -1,6 -1,6 +1,6 @@@short_description: "在隔离沙箱中执行 shell 命令,返回 stdout/stderr 与退出码。"when_to_use: "用于数据处理、运行技能自带脚本、调用任务所需的 CLI 工具。不要用于破坏性或系统管理类命令。"input_format: "`command` — shell 命令。可选 `timeout` — 秒(默认 30,上限 300)。命令运行在本回合的工作目录中。"- guideline: "优先使用非交互参数(如 `-y`)。控制输出体量,命令过于啰嗦时用 `head`/`grep` 过滤。运行技能脚本前先读其 SKILL.md。Python 工作或文件生成应把完整源码传给 code_execution,不要用 `python -c` 或 heredoc;exec 只用于真正必须使用 shell 的命令。最终回答按工具结果原样引用生成文件。"- note: "破坏性命令(rm -rf、mkfs、shutdown 等)会被拦截。沙箱限制文件与网络访问,需要公网的命令可能失败。"-guideline: "优先使用非交互参数(如 `-y`)。根据工作区说明中标明的宿主 shell 使用对应语法,并用该 shell 自带的方式限制输出。运行技能脚本前先读其 SKILL.md。调用 Python 包管理器时使用 `python -m pip`,不要把 `pip` 与另一个 `python` 混用。若用户要求创建/导出文件,执行命令并把文件保存到工作目录,然后在最终回答中给出工具结果里的 Generated artifacts 下载链接。"++guideline: "优先使用非交互参数(如 `-y`)。根据工作区说明中标明的宿主 shell 使用对应语法,并用该 shell 自带的方式限制输出。运行技能脚本前先读其 SKILL.md。Python 工作或文件生成应把完整源码传给 code_execution,不要用 `python -c` 或 heredoc;exec 只用于真正必须使用 shell 的命令。调用 Python 包管理器时使用 `python -m pip`,不要把 `pip` 与另一个 `python` 混用。若用户要求创建或导出文件,把文件保存到工作目录,并按工具结果原样引用 Generated artifacts 下载链接。"+ note: "破坏性命令(rm -rf、mkfs、shutdown 等)会被拦截。命令失败时检查 STDERR、退出码和实际 shell;不要把命令语法或依赖错误说成沙箱无权访问。只有工具明确返回拒绝访问或网络错误时,才能据此说明对应限制。"phase: "expansion"diff --cc tests/services/search/test_web_search_runtime.pyindex a034cbb80,b6153f80a..e342913fa--- a/tests/services/search/test_web_search_runtime.py+++ b/tests/services/search/test_web_search_runtime.py@@@ -163,6 -181,6 +181,40 @@@ def test_web_search_runtime_failure_falassert seen[1][1]["api_key"] == "tavily-key"++def test_web_search_fallback_drops_request_credentials_for_previous_provider(monkeypatch) -> None:++ seen: list[tuple[str, dict]] = []++++ def _fake_get_provider(name: str, **kwargs):++ seen.append((name, kwargs))++ return _FailingProvider(name) if name == "serper" else _FakeProvider(name)++++ _patch_runtime(++ monkeypatch,++ ResolvedSearchConfig(++ provider="serper",++ requested_provider="serper",++ api_key="profile-serper-key",++ base_url="https://profile.serper.example",++ max_results=5,++ ),++ candidates=["tavily"],++ credentials={"tavily": ("tavily-key", "https://tavily.example")},++ )++ monkeypatch.setattr("deeptutor.services.search.get_provider", _fake_get_provider)++++ result = web_search(++ "hello",++ api_key="request-serper-key",++ base_url="https://request.serper.example",++ )++++ assert result["provider"] == "tavily"++ assert seen[0][1]["api_key"] == "request-serper-key"++ assert seen[0][1]["base_url"] == "https://request.serper.example"++ assert seen[1][1]["api_key"] == "tavily-key"++ assert seen[1][1]["base_url"] == "https://tavily.example"++++def test_web_search_raises_when_every_candidate_fails(monkeypatch) -> None:_patch_runtime(monkeypatch,