mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-19 10:02:16 +00:00
fix(dump): show commit date instead of release date in hermes debug (#48104)
* feat(mcp): raise default tool-call timeout 120s -> 300s Port from openai/codex#28234. Long-running MCP tools (web fetches, sandboxed builds, deep-research servers) routinely exceed 120s, causing spurious timeout failures. Codex bumped its default MCP tool timeout from 120 to 300 for the same reason. - _DEFAULT_TOOL_TIMEOUT 120 -> 300 in tools/mcp_tool.py (per-server 'timeout' config override unchanged) - update test_default_timeout assertion - document the default in mcp-config-reference.md * fix(dump): show commit date instead of release date in hermes dump The version line in `hermes dump` (the top of the /debug report) appended the package release date in parentheses, which reads like a wall-clock "generated at" timestamp and confuses support triage. Replace it with the date the HEAD commit was actually made, resolved live via `git log -1 --format=%cd --date=short`, kept next to the commit SHA. On Docker/wheel installs with no .git the date resolves to '' and the suffix is simply omitted (the baked SHA still identifies the build).
This commit is contained in:
parent
c1f9eb0ec4
commit
9ba4615db2
2 changed files with 73 additions and 4 deletions
|
|
@ -116,3 +116,44 @@ def test_get_git_commit_output_format_identical_between_sources(tmp_path):
|
|||
# Same length, same charset — no decoration in either branch.
|
||||
assert len(live) == 8
|
||||
assert all(c in "0123456789abcdef" for c in live)
|
||||
|
||||
|
||||
def test_get_git_commit_date_uses_live_git(tmp_path):
|
||||
"""Source install: ``git log -1 --format=%cd --date=short`` returns the date."""
|
||||
from hermes_cli import dump
|
||||
|
||||
repo_dir = tmp_path / "repo"
|
||||
repo_dir.mkdir()
|
||||
|
||||
git_result = MagicMock(returncode=0, stdout="2026-06-17\n")
|
||||
with patch("hermes_cli.dump.subprocess.run", return_value=git_result):
|
||||
date = dump._get_git_commit_date(repo_dir)
|
||||
|
||||
assert date == "2026-06-17"
|
||||
|
||||
|
||||
def test_get_git_commit_date_empty_when_git_fails(tmp_path):
|
||||
"""Docker image / pip wheel: no git → '' so the dump line drops the date."""
|
||||
from hermes_cli import dump
|
||||
|
||||
repo_dir = tmp_path / "no-git-here"
|
||||
repo_dir.mkdir()
|
||||
|
||||
failed = MagicMock(returncode=128, stdout="")
|
||||
with patch("hermes_cli.dump.subprocess.run", return_value=failed):
|
||||
date = dump._get_git_commit_date(repo_dir)
|
||||
|
||||
assert date == ""
|
||||
|
||||
|
||||
def test_get_git_commit_date_empty_when_git_raises(tmp_path):
|
||||
"""git binary missing → '' (no crash, suffix simply omitted)."""
|
||||
from hermes_cli import dump
|
||||
|
||||
repo_dir = tmp_path / "repo"
|
||||
repo_dir.mkdir()
|
||||
|
||||
with patch("hermes_cli.dump.subprocess.run", side_effect=FileNotFoundError("git")):
|
||||
date = dump._get_git_commit_date(repo_dir)
|
||||
|
||||
assert date == ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue