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
|
|
@ -56,6 +56,30 @@ def _get_git_commit(project_root: Path) -> str:
|
|||
return "(unknown)"
|
||||
|
||||
|
||||
def _get_git_commit_date(project_root: Path) -> str:
|
||||
"""Return the date the HEAD commit was authored (YYYY-MM-DD), or ''.
|
||||
|
||||
Resolves live via ``git log`` on source installs. The published Docker
|
||||
image excludes ``.git``, so this returns '' there — the dump line simply
|
||||
drops the date suffix in that case (the baked SHA still identifies the
|
||||
build).
|
||||
"""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["git", "log", "-1", "--format=%cd", "--date=short", "HEAD"],
|
||||
capture_output=True, text=True, timeout=5,
|
||||
cwd=str(project_root),
|
||||
)
|
||||
if result.returncode == 0:
|
||||
value = result.stdout.strip()
|
||||
if value:
|
||||
return value
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
def _redact(value: str) -> str:
|
||||
"""Redact all but first 4 and last 4 chars.
|
||||
|
||||
|
|
@ -231,12 +255,12 @@ def run_dump(args):
|
|||
hermes_home = get_hermes_home()
|
||||
|
||||
try:
|
||||
from hermes_cli import __version__, __release_date__
|
||||
from hermes_cli import __version__
|
||||
except ImportError:
|
||||
__version__ = "(unknown)"
|
||||
__release_date__ = ""
|
||||
|
||||
commit = _get_git_commit(project_root)
|
||||
commit_date = _get_git_commit_date(project_root)
|
||||
|
||||
try:
|
||||
config = load_config()
|
||||
|
|
@ -283,10 +307,14 @@ def run_dump(args):
|
|||
|
||||
lines = []
|
||||
lines.append("--- hermes dump ---")
|
||||
# Identify the build by commit + the date that commit was made, resolved
|
||||
# live via git. __release_date__ (the package release date) is
|
||||
# intentionally NOT shown here — it reads like a wall-clock timestamp and
|
||||
# confuses support triage. The commit date is the real "as-of" date.
|
||||
ver_str = f"{__version__}"
|
||||
if __release_date__:
|
||||
ver_str += f" ({__release_date__})"
|
||||
ver_str += f" [{commit}]"
|
||||
if commit_date:
|
||||
ver_str += f" ({commit_date})"
|
||||
lines.append(f"version: {ver_str}")
|
||||
lines.append(f"os: {os_info}")
|
||||
lines.append(f"python: {sys.version.split()[0]}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue