diff --git a/mindcli/capability.py b/mindcli/capability.py index 1d37a97..52f38ba 100644 --- a/mindcli/capability.py +++ b/mindcli/capability.py @@ -71,9 +71,17 @@ def _scan_mcp_servers() -> list[dict[str, str]]: def _get_vendor_commit() -> str: + """读取 _vendor/VENDOR_COMMIT,只返回 commit hash。 + + VENDOR_COMMIT 是多行标记文件(source:/commit:/date:), + 只返回 commit: 行的值,不是整个文件内容。 + """ commit_file = os.path.join(mindcli._VENDOR_DIR, "VENDOR_COMMIT") try: with open(commit_file) as f: - return f.read().strip() + for line in f: + if line.startswith("commit:"): + return line.split(":", 1)[1].strip() + return "unknown" except FileNotFoundError: return "unknown"