hermes - ✅(Solved) Fix [Bug]: hermes设置agent.tool_use_enforcement:never 仍然无法使用本地部署的 `deepseek-r1:7b-64k` 模型 [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#13659Fetched 2026-04-22 08:04:58
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

Operating System

WSL2 (Ubuntu 22.04) on Windows 11

Python Version

3.11.15

Hermes Version

v0.10.0 (2026.4.16)

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

PR fix notes

PR #13950: fix(agent): omit tools from API requests when tool_use_enforcement is never/false

Description (problem / solution / changelog)

Summary

  • tool_use_enforcement: never now omits the tools parameter from API requests entirely, not just the prompt enforcement text
  • Fixes 400 errors from models that don't support tool calling (e.g. deepseek-r1 via Ollama)

Details

_tools_for_api() helper returns None when enforcement is false/never/no/off, and is used in all 4 API paths (OpenAI, Anthropic, Bedrock, Codex).

Closes #13659

Test plan

  • Added 3 new tests in TestToolUseEnforcementConfig verifying tools are omitted from _build_api_kwargs when enforcement is never/false, and included with auto
  • All 15 enforcement tests pass
  • Manual test: configure tool_use_enforcement: never with an Ollama model (e.g. deepseek-r1), confirm no 400 error

Changed files

  • hermes_cli/config.py (modified, +7/-5)
  • run_agent.py (modified, +18/-4)
  • tests/run_agent/test_run_agent.py (modified, +20/-0)

Code Example

ollama pull deepseek-r1:7b
   ollama create deepseek-r1:7b-64k -f <(echo 'FROM deepseek-r1:7b\nPARAMETER num_ctx 65536')

2. **修改 Hermes 配置**
编辑 ~/.hermes/config.yaml,确保以下配置存在:

---

3. **启动 Hermes**

---

4. **发送任意消息**
例如输入:你好

观察错误
终端输出如下错误信息:

---

### Expected Behavior

设置 tool_use_enforcement: never 后,Hermes Agent 应完全禁用在请求中附加 tools 参数,使本地 DeepSeek-R1 模型能够正常响应普通对话,不再因为不支持 tools 而报错。

### Actual Behavior

即使 tool_use_enforcement: never 已正确设置,Hermes Agent 在调用本地 deepseek-r1:7b-64k 模型时仍然在请求中包含了 tools 字段,导致 Ollama 服务返回 400 Bad Request,提示模型不支持 tools。


### Affected Component

CLI (interactive chat), Tools (terminal, file ops, web, code execution, etc.)

### Messaging Platform (if gateway-related)

N/A (CLI only)

### Debug Report

---

### Operating System

WSL2 (Ubuntu 22.04) on Windows 11

### Python Version

3.11.15

### Hermes Version

v0.10.0 (2026.4.16)

### Additional Logs / Traceback (optional)
RAW_BUFFERClick to expand / collapse

Bug Description

在 Hermes Agent 的 config.yaml 中已将 agent.tool_use_enforcement 设置为 never,但使用本地部署的 deepseek-r1:7b-64k 模型时,Hermes Agent 依然尝试发送 tools 参数,导致模型返回 400 Bad Request 错误,无法正常对话。

Steps to Reproduce

  1. 下载本地模型 通过 Ollama 下载 deepseek-r1:7b,并创建 64K 上下文的版本 deepseek-r1:7b-64k
    ollama pull deepseek-r1:7b
    ollama create deepseek-r1:7b-64k -f <(echo 'FROM deepseek-r1:7b\nPARAMETER num_ctx 65536')
  2. 修改 Hermes 配置 编辑 ~/.hermes/config.yaml,确保以下配置存在:
agent:
  tool_use_enforcement: never
model:
  default: deepseek-r1:7b-64k
  provider: custom
  base_url: http://127.0.0.1:11434/v1
  context_length: 65536
  1. 启动 Hermes

    hermes chat
  2. 发送任意消息 例如输入:你好

观察错误 终端输出如下错误信息:

HTTP 400: registry.ollama.ai/library/deepseek-r1:7b-64k does not support tools

Expected Behavior

设置 tool_use_enforcement: never 后,Hermes Agent 应完全禁用在请求中附加 tools 参数,使本地 DeepSeek-R1 模型能够正常响应普通对话,不再因为不支持 tools 而报错。

Actual Behavior

即使 tool_use_enforcement: never 已正确设置,Hermes Agent 在调用本地 deepseek-r1:7b-64k 模型时仍然在请求中包含了 tools 字段,导致 Ollama 服务返回 400 Bad Request,提示模型不支持 tools。

Affected Component

CLI (interactive chat), Tools (terminal, file ops, web, code execution, etc.)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

⚠️ API call failed (attempt 1/3): BadRequestError [HTTP 400]
   🔌 Provider: custom  Model: deepseek-r1:7b-64k
   🌐 Endpoint: http://127.0.0.1:11434/v1
   📝 Error: HTTP 400: registry.ollama.ai/library/deepseek-r1:7b-64k does not support tools
   📋 Details: {'message': 'registry.ollama.ai/library/deepseek-r1:7b-64k does not support tools', 'type': 'api_error', 'param': None, 'code': None}

Operating System

WSL2 (Ubuntu 22.04) on Windows 11

Python Version

3.11.15

Hermes Version

v0.10.0 (2026.4.16)

Additional Logs / Traceback (optional)

Hermes Agent 版本:v0.10.0 (2026.4.16)

Ollama 版本:0.6.5

操作系统:WSL2 (Ubuntu 22.04) on Windows 11

配置内容(关键部分):

agent:
  tool_use_enforcement: never
model:
  default: deepseek-r1:7b-64k
  provider: custom
  base_url: http://127.0.0.1:11434/v1
  context_length: 65536
custom_providers:
  - name: deepseek-r1:7b-64k
    base_url: http://127.0.0.1:11434/v1
    model: deepseek-r1:7b-64k
    context_length: 65536

完整错误日志:

⚠️ API call failed (attempt 1/3): BadRequestError [HTTP 400]
   🔌 Provider: custom  Model: deepseek-r1:7b-64k
   🌐 Endpoint: http://127.0.0.1:11434/v1
   📝 Error: HTTP 400: registry.ollama.ai/library/deepseek-r1:7b-64k does not support tools
   📋 Details: {'message': 'registry.ollama.ai/library/deepseek-r1:7b-64k does not support tools', 'type': 'api_error', 'param': None, 'code': None}

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue can be resolved by ensuring that the tool_use_enforcement setting is properly applied to disable the tools parameter in requests to the deepseek-r1:7b-64k model.

Guidance

  1. Verify configuration: Double-check the config.yaml file to ensure that agent.tool_use_enforcement is set to never and that the model section correctly references the deepseek-r1:7b-64k model.
  2. Check for overrides: Confirm that there are no other configuration files or environment variables that might be overriding the tool_use_enforcement setting.
  3. Inspect API requests: Use a tool like curl or a debugger to inspect the API requests being sent to the deepseek-r1:7b-64k model and verify that the tools parameter is not included.
  4. Test with a minimal configuration: Try reducing the config.yaml file to the minimum required settings to see if the issue persists, which can help identify if other configuration options are interfering with the tool_use_enforcement setting.

Example

No specific code example is provided as the issue seems to be related to configuration rather than code. However, ensuring that the config.yaml contains the correct settings, such as:

agent:
  tool_use_enforcement: never
model:
  default: deepseek-r1:7b-64k
  provider: custom
  base_url: http://127.0.0.1:11434/v1
  context_length: 65536

is crucial.

Notes

The root cause of the issue seems to be related to how the tool_use_enforcement setting is applied or interpreted by the Hermes Agent. Without direct access to the codebase or more detailed debugging information, it's challenging to provide a definitive fix. The guidance provided aims to help isolate the issue and potentially resolve it through configuration adjustments.

Recommendation

Apply workaround: Temporarily, try setting tool_use_enforcement to never in all possible configuration files and environment variables to ensure it's applied correctly, and verify if this resolves the issue. If the problem persists, it may indicate a need for a code-level fix or further investigation into how configuration settings are being processed by the Hermes Agent.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: hermes设置agent.tool_use_enforcement:never 仍然无法使用本地部署的 `deepseek-r1:7b-64k` 模型 [1 pull requests, 1 participants]