# openhands-cli - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 openhands-cli 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/custom-codereview-guide/SKILL.md` Claim：`clm_0003` supported 0.86

## 它能做什么

- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/custom-codereview-guide/SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 怎么开始

- `uv tool install openhands --python 3.12` 证据：`README.md` Claim：`clm_0004` supported 0.86
- `curl -fsSL https://install.openhands.dev/install.sh | sh` 证据：`README.md` Claim：`clm_0005` supported 0.86
- `npx -- -y mcp-remote "https://mcp.tavily.com/mcp/?tavilyApiKey=<your-api-key>"` 证据：`README.md` Claim：`clm_0006` supported 0.86

## 继续前判断卡

- **当前建议**：需要管理员/安全审批
- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：真实输出质量不能在安装前相信。
- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件

### 现在可以相信

- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/custom-codereview-guide/SKILL.md` Claim：`clm_0003` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/custom-codereview-guide/SKILL.md` Claim：`clm_0001` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0004` supported 0.86

### 现在还不能相信

- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/custom-codereview-guide/SKILL.md`, `AGENTS.md`
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/custom-codereview-guide/SKILL.md`, `AGENTS.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/cli-release/references/post-release-checklist.md`, `AGENTS.md`, `README.md` 等
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）
- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0007` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0008` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`.agents/skills/cli-release/SKILL.md`, `.agents/skills/custom-codereview-guide/SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86

### 上下文规模

- 文件总数：164
- 重要文件覆盖：40/164
- 证据索引条目：78
- 角色 / Skill 条目：2

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 openhands-cli 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 openhands-cli 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 openhands-cli 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

- 共索引 2 个角色 / Skill / 项目文档条目。

- **cli-release**（skill）：- 激活提示：当用户任务与“cli-release”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/cli-release/SKILL.md`
- **custom-codereview-guide**（skill）：- 激活提示：当用户任务与“custom-codereview-guide”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/custom-codereview-guide/SKILL.md`

## 证据索引

- 共索引 78 条证据。

- **Repository Guidelines**（documentation）：Repository Purpose OpenHands CLI is a standalone terminal interface Textual TUI for interacting with the OpenHands agent. 证据：`AGENTS.md`
- **Project status**（documentation）：OpenHands V1 CLI Powered by OpenHands Software Agent SDK 证据：`README.md`
- **TUI End-to-End Tests for OpenHands CLI**（documentation）：TUI End-to-End Tests for OpenHands CLI 证据：`tui_e2e/README.md`
- **ACP Implementation**（documentation）：What is the Agent Client Protocol ACP ? 证据：`openhands_cli/acp_impl/README.md`
- **CLI Release Guide**（skill_instruction）：This skill walks through the OpenHands CLI release process step by step. 证据：`.agents/skills/cli-release/SKILL.md`
- **OpenHands CLI — Custom Code Review Guidelines**（skill_instruction）：OpenHands CLI — Custom Code Review Guidelines 证据：`.agents/skills/custom-codereview-guide/SKILL.md`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`LICENSE`
- **Release Procedure**（documentation）：This document outlines the steps to release a new version of OpenHands CLI. 证据：`RELEASE_PROCEDURE.md`
- **Post-Release Checklist**（documentation）：After the GitHub release is published and the PyPI package is available, several automated and manual follow-up steps are needed. 证据：`.agents/skills/cli-release/references/post-release-checklist.md`
- **Hooks**（structured_config）：{ "stop": { "matcher": " ", "hooks": { "type": "command", "command": ".openhands/hooks/on stop.sh", "timeout": 300 } } } 证据：`.openhands/hooks.json`
- **Byte-compiled / optimized / DLL files**（source_file）：Byte-compiled / optimized / DLL files pycache / .py cod $py.class 证据：`.gitignore`
- **.Pre Commit Config**（source_file）：--- repos: - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt rev: 0.2.1 hooks: - id: yamlfmt - repo: local hooks: - id: ruff-format name: Ruff format entry: uv args: run, --frozen, ruff, format language: system types: python pass filenames: true always run: false - id: ruff-check name: Ruff lint entry: uv args: run, --frozen, ruff, check, --fix, --exit-non-zero-on-fix language: system types: python pass filenames: true always run: false - id: pycodestyle name: PEP8 style check pycodestyle entry: uv args: run, --frozen, pycodestyle, --max-line-length=88, '--ignore=E203,E501,W503,E704' language: system types: python pass filenames: true always run: false - id: pyright name: Type… 证据：`.pre-commit-config.yaml`
- **Colors for output**（source_file）：SHELL := /usr/bin/env bash .SHELLFLAGS := -eu -o pipefail -c 证据：`Makefile`
- **Clean up .pyc files**（source_file）：def clean build directories - None ⋮---- build dirs = "build", "dist", " pycache " ⋮---- Clean up .pyc files ⋮---- def check pyinstaller - bool ⋮---- Run PyInstaller with uv cmd = "uv", "run", "pyinstaller", spec file, "--clean" ⋮---- Check if the executable was created dist dir = Path "dist" ⋮---- executables = list dist dir.glob " " ⋮---- size = exe.stat .st size / 1024 1024 ⋮---- ================================================= SECTION: Test and profile binary ⋮---- SECTION: Main ⋮---- def main - int ⋮---- """Main function.""" parser = argparse.ArgumentParser description="Build OpenHands CLI executable" ⋮---- args = parser.parse args ⋮---- Build the executable ⋮---- Test the executable… 证据：`build.py`
- **Build**（source_file）：set -e echo "🚀 OpenHands CLI Build Script" echo "==============================" if ! command -v uv & /dev/null; then echo "❌ uv is required but not found! Please install uv first." exit 1 fi INSTALL PYINSTALLER=false PYTHON ARGS= for arg in "$@"; do case $arg in --install-pyinstaller INSTALL PYINSTALLER=true PYTHON ARGS+= "$arg" ;; PYTHON ARGS+= "$arg" ;; esac done if "$INSTALL PYINSTALLER" = true ; then echo "📦 Installing PyInstaller with uv..." if uv add --dev pyinstaller; then echo "✅ PyInstaller installed successfully with uv!" else echo "❌ Failed to install PyInstaller" exit 1 fi fi uv run python build.py "${PYTHON ARGS @ }" 证据：`build.sh`
- **Conftest**（source_file）：@pytest.fixture autouse=True def isolate test persistence tmp path, monkeypatch ⋮---- home dir = tmp path / "home" ⋮---- persistence dir = home dir / ".openhands" ⋮---- conversations dir = persistence dir / "conversations" ⋮---- original expanduser = os.path.expanduser def mock expanduser path ⋮---- path str = str path 证据：`conftest.py`
- **Rthook Profile Imports**（source_file）：ENABLE = os.getenv "IMPORT PROFILING", "0" not in "", "0", "false", "False" OUT = "dist/import profiler.csv" THRESHOLD MS = float os.getenv "IMPORT PROFILING THRESHOLD MS", "0" ⋮---- timings = defaultdict float counts = defaultdict int max dur = defaultdict float ⋮---- bootstrap = None start time = time.perf counter ⋮---- orig find and load = bootstrap. find and load def timed find and load name, import ⋮---- preloaded = name in sys.modules t0 = time.perf counter ⋮---- dt = time.perf counter - t0 ⋮---- @atexit.register def dump import profile ⋮---- def ms s items = ⋮---- w = max len n for n, in items :25 证据：`hooks/rthook_profile_imports.py`
- **- - mode: python ; coding: utf-8 - -**（source_file）：- - mode: python ; coding: utf-8 - - """ PyInstaller spec file for OpenHands CLI. 证据：`openhands-cli.spec`
- **Init**（source_file）：version = version "openhands" ⋮---- version = "0.0.0" 证据：`openhands_cli/__init__.py`
- **Deprecated Utils**（source_file）：LEGACY DELEGATE TOOL NAME = "delegate" def conversation has delegate tool conversation id: str - bool ⋮---- conversations dir = get conversations dir normalized id = conversation id.replace "-", "" events dir = Path conversations dir / normalized id / "events" ⋮---- system prompt files = sorted events dir.glob "event-00000- .json" ⋮---- event data = json.load f 证据：`openhands_cli/deprecated_utils.py`
- **Check if resume was called without ID and without --last**（source_file）：console = Console env path = Path.cwd / ".env" ⋮---- debug env = os.getenv "DEBUG", "false" .lower ⋮---- def handle resume logic args: argparse.Namespace - str None ⋮---- store = LocalFileStore conversations = store.list conversations limit=1 ⋮---- latest id = conversations 0 .id ⋮---- Check if resume was called without ID and without --last ⋮---- Resume called without ID - show conversation list ⋮---- Return the resume ID as-is could be None for new conversation ⋮---- def main - None ⋮---- """Main entry point for the OpenHands CLI. Raises: ImportError: If agent chat dependencies are missing Exception: On other error conditions """ parser = create main parser args = parser.parse args Handle… 证据：`openhands_cli/entrypoint.py`
- **Check if Docker is installed**（source_file）：console = Console highlight=False, soft wrap=True def format docker command for logging cmd: list str - str ⋮---- cmd str = " ".join cmd ⋮---- def check docker requirements - bool ⋮---- """Check if Docker is installed and running. Returns: bool: True if Docker is available and running, False otherwise. """ Check if Docker is installed ⋮---- result = subprocess.run ⋮---- def ensure config dir exists - Path ⋮---- path = Path get persistence dir ⋮---- def get openhands version - str def launch gui server mount cwd: bool = False, gpu: bool = False - None ⋮---- config dir = ensure config dir exists version = get openhands version app image = f"docker.openhands.dev/openhands/openhands:{version}"… 证据：`openhands_cli/gui_launcher.py`
- **Locations**（source_file）：def get persistence dir - str def get conversations dir - str def get work dir - str def get project id - str ⋮---- work dir = os.path.abspath os.path.realpath get work dir ⋮---- def get project dir - str def get prompt history path - str AGENT SETTINGS PATH = "agent settings.json" MCP CONFIG FILE = "mcp.json" 证据：`openhands_cli/locations.py`
- **Setup**（source_file）：class MissingAgentSpec Exception ⋮---- agent store = AgentStore agent = agent store.load or create ⋮---- mcp config: dict str, Any = agent.mcp config or {} existing servers: dict str, dict str, Any = mcp config.get "mcpServers", {} ⋮---- agent = agent.model copy ⋮---- existing skills = agent.agent context.skills ⋮---- console = Console ⋮---- agent = load agent specs callbacks = event callback if event callback else None hook config = HookConfig.load working dir=get work dir ⋮---- conversation: BaseConversation = Conversation 证据：`openhands_cli/setup.py`
- **Terminal Compat**（source_file）：class TerminalCompatibilityResult BaseModel ⋮---- is tty: bool reason: str None = None ⋮---- is terminal = bool console.is terminal 证据：`openhands_cli/terminal_compat.py`
- **Theme**（source_file）：def create openhands theme - Theme OPENHANDS THEME = create openhands theme 证据：`openhands_cli/theme.py`
- **Utils**（source_file）：def abbreviate number n: int float - str ⋮---- n = int n or 0 ⋮---- def format cost cost: float - str def get os description - str ⋮---- system = platform.system or "Unknown" ⋮---- ver = platform.mac ver 0 or platform.release ⋮---- kernel = platform.release ⋮---- OPENHANDS PROVIDER PREFIX = "openhands/" LLM PROXY PATTERN = re.compile r"^https?://llm-proxy\. ^. +\.all-hands\.dev ?:/ $ " def is openhands provider model model name: str - bool def should set litellm extra body model name: str, base url: str None = None - bool ⋮---- """ Determine if litellm extra body should be set based on the model name or base URL. Set litellm extra body for: - Models with "openhands/" prefix - Any model usin… 证据：`openhands_cli/utils.py`
- **Version Check**（source_file）：class VersionInfo NamedTuple ⋮---- current version: str latest version: str None needs update: bool error: str None def parse version version str: str - tuple int, ... def check for updates timeout: float = 2.0 - VersionInfo ⋮---- current = version ⋮---- url = "https://pypi.org/pypi/openhands/json" req = urllib.request.Request url ⋮---- data = json.loads response.read .decode "utf-8" latest = data "info" "version" ⋮---- current tuple = parse version current latest tuple = parse version latest needs update = latest tuple current tuple ⋮---- needs update = False 证据：`openhands_cli/version_check.py`
- **Limit third-party package intake to versions released at least 7 days ago.**（source_file）：build-system build-backend = "hatchling.build" requires = "hatchling =1.25" 证据：`pyproject.toml`
- **Start initial app**（source_file）：DEBOUNCE MS = 1000 POLL INTERVAL MS = 100 TERMINAL SETTLE DELAY = 0.2 PROCESS SHUTDOWN TIMEOUT = 3 def reset terminal def print status msg: str def is watched file path: str - bool ⋮---- """Check if file should trigger a restart.""" ⋮---- class WatchRunner ⋮---- def init self def start app self def stop app self def check if exited self ⋮---- exit code = self.process.returncode ⋮---- def run self ⋮---- """Main watch loop.""" ⋮---- watch path = Path "openhands cli" ⋮---- def signal handler signum, frame ⋮---- """Handle Ctrl+C to exit cleanly.""" ⋮---- Start initial app ⋮---- Watch for changes ⋮---- changed files = Path p .name for , p in list changes :3 ⋮---- Restart app ⋮---- runner = Watch… 证据：`scripts/run_watch.py`
- **Mock Critic**（source_file）：class MockCritic CriticBase ⋮---- model config = ConfigDict arbitrary types allowed=True critic results: list dict str, Any = PrivateAttr default factory=list current index: int = PrivateAttr default=0 lock: threading.Lock = PrivateAttr default factory=threading.Lock def init self, critic results: list dict str, Any None = None, kwargs ⋮---- result data = self. critic results self. current index ⋮---- def reset self - None ⋮---- @property def remaining results self - int def create mock critic from trajectory trajectory: Any - MockCritic 证据：`tui_e2e/mock_critic.py`
- **Health check**（source_file）：DEFAULT USAGE = {"prompt tokens": 100, "completion tokens": 50, "total tokens": 150} ⋮---- @dataclass class TrajectoryReplayState ⋮---- responses: list TrajectoryEvent = field default factory=list current index: int = 0 lock: threading.Lock = field default factory=threading.Lock def get next response self - TrajectoryEvent None ⋮---- response = self.responses self.current index ⋮---- def peek next response self - TrajectoryEvent None def reset self - None class OpenAIResponseBuilder class TrajectoryResponseConverter ⋮---- def convert event self, event: TrajectoryEvent - dict str, Any ⋮---- completion id = f"chatcmpl-{uuid.uuid4 .hex :24 }" ⋮---- def create tool call response self, event: Tr… 证据：`tui_e2e/mock_llm_server.py`
- **Models**（source_file）：class TestResult BaseModel ⋮---- test name: str success: bool cost: float = 0.0 boot time seconds: float None = None total time seconds: float error message: str None = None output preview: str None = None metadata: dict str, Any = {} def str self - str ⋮---- status = "✅ PASSED" if self.success else "❌ FAILED" time info = f" {self.total time seconds:.2f}s" ⋮---- result = f"{self.test name}: {status} {time info}" ⋮---- class TestSummary BaseModel ⋮---- """Summary of all E2E test results.""" total tests: int passed tests: int failed tests: int ⋮---- total cost: float = 0.0 results: list TestResult ⋮---- @property def success rate self - float ⋮---- """Calculate success rate as percentage."""… 证据：`tui_e2e/models.py`
- **Create a failed result for any unexpected exceptions**（source_file）：def run all tui e2e - TestSummary ⋮---- tests: list Callable , TestResult = results: list TestResult = start time = time.time ⋮---- result = test func ⋮---- Create a failed result for any unexpected exceptions result = TestResult ⋮---- total time = time.time - start time Calculate summary statistics passed tests = sum 1 for r in results if r.success failed tests = len results - passed tests total cost = sum r.cost for r in results summary = TestSummary ⋮---- def print detailed results summary: TestSummary - None ⋮---- """Print detailed test results.""" ⋮---- boot info = "" ⋮---- boot info = f" boot: {result.boot time seconds:.2f}s " time str = f"{result.total time seconds:.2f}s{boot info}" 证据：`tui_e2e/runner.py`
- **Find all event files and sort by sequence number**（source_file）：@dataclass class TrajectoryEvent ⋮---- id: str timestamp: str source: Literal "user", "agent", "environment" kind: str raw data: dict str, Any tool call: dict str, Any None = None tool name: str None = None tool call id: str None = None reasoning content: str None = None thinking blocks: list dict str, Any = field default factory=list llm message: dict str, Any None = None critic result: dict str, Any None = None ⋮---- @classmethod def from json cls, data: dict str, Any - "TrajectoryEvent" def has critic result self - bool def is user input self - bool def is llm response self - bool def get user text self - str ⋮---- content = self.llm message.get "content", ⋮---- @dataclass class Trajecto… 证据：`tui_e2e/trajectory.py`
- **Utils**（source_file）：def seed dummy settings ⋮---- model name = "dummy-model" extra kwargs: dict str, Any = {} ⋮---- llm = LLM model=model name, api key="dummy-key", extra kwargs dummy agent = get default cli agent llm=llm spec path = os.path.join get persistence dir , AGENT SETTINGS PATH specs path = Path os.path.expanduser spec path 证据：`tui_e2e/utils.py`
- **On Stop**（source_file）：set -o pipefail PROJECT DIR="${OPENHANDS PROJECT DIR:-$ pwd }" cd "$PROJECT DIR" { &2 echo "⚠️ Failed to cd to project directory: $PROJECT DIR, skipping checks" echo '{"decision": "allow", "reason": "Invalid project directory - hook skipped"}' exit 0 } &2 echo "=== Stop Hook: Running pre-commit ===" if command -v uv & /dev/null && uv run pre-commit --version & /dev/null; then PRECOMMIT CMD="uv run pre-commit" elif command -v pre-commit & /dev/null; then PRECOMMIT CMD="pre-commit" else &2 echo "⚠️ pre-commit is not installed, skipping checks" echo '{"decision": "allow", "reason": "pre-commit not installed - hook skipped"}' exit 0 fi PRECOMMIT OUTPUT=$ $PRECOMMIT CMD run --all-files 2 &1 PREC… 证据：`.openhands/hooks/on_stop.sh`
- **Init**（source_file）：all = 证据：`openhands_cli/acp_impl/agent/__init__.py`
- **Always configure auth method**（source_file）：logger = logging.getLogger name class BaseOpenHandsACPAgent ACPAgent, ABC ⋮---- @property @abstractmethod def agent type self - AgentType ⋮---- """Return the agent type 'local' or 'remote' .""" ⋮---- @property def active sessions self - Mapping str, BaseConversation ⋮---- """Return the active sessions mapping.""" ⋮---- """Get an active conversation from cache or create a new one. Args: session id: Session/conversation ID UUID string working dir: Working directory for workspace local only mcp servers: MCP servers config only for new sessions is resuming: Whether this is resuming an existing conversation Returns: Cached or newly created conversation """ ⋮---- @abstractmethod def cleanup sessi… 证据：`openhands_cli/acp_impl/agent/base_agent.py`
- **Launcher**（source_file）：logger = logging.getLogger name ⋮---- def create local agent conn: Client - LocalOpenHandsACPAgent ⋮---- def create agent conn: Client - OpenHandsCloudACPAgent 证据：`openhands_cli/acp_impl/agent/launcher.py`
- **Register built-in subagent types default, explore, bash so the**（source_file）：logger = logging.getLogger name class LocalOpenHandsACPAgent BaseOpenHandsACPAgent ⋮---- @property def agent type self - AgentType ⋮---- """Return the agent type.""" ⋮---- async def is authenticated self - bool def cleanup session self, session id: str - None ⋮---- conversation = self. setup conversation ⋮---- """Set up a local conversation with event streaming support.""" Register built-in subagent types default, explore, bash so the delegate tool can spawn them. enable browser=False because CLI mode doesn't provide browser tools. ⋮---- agent = load agent specs streaming enabled = ⋮---- agent = agent.model copy ⋮---- working dir = get work dir working path = Path working dir ⋮---- workspac… 证据：`openhands_cli/acp_impl/agent/local_agent.py`
- **Skip cache check when resuming to recreate workspace**（source_file）：logger = logging.getLogger name class OpenHandsCloudACPAgent BaseOpenHandsACPAgent ⋮---- @property def agent type self - AgentType ⋮---- """Return the agent type.""" ⋮---- async def is authenticated self - bool def cleanup session self, session id: str - None ⋮---- workspace = self. active workspaces.pop session id, None ⋮---- conversation = self. active sessions.pop session id, None ⋮---- async def verify and get sandbox id self, conversation id: str - str ⋮---- """Verify a conversation exists and get its sandbox id.""" ⋮---- client = OpenHandsApiClient self. cloud api url, self. cloud api key conversation info = await client.get conversation info conversation id ⋮---- sandbox id = convers… 证据：`openhands_cli/acp_impl/agent/remote_agent.py`
- **Util**（source_file）：logger = logging.getLogger name def get session mode state current mode: ConfirmationMode - SessionModeState AgentType = Literal "remote", "local" 证据：`openhands_cli/acp_impl/agent/util.py`
- **Create a tool call representation**（source_file）：logger = logging.getLogger name ConfirmationMode = Literal "always-ask", "always-approve", "llm-approve" CONFIRMATION MODES: dict ConfirmationMode, dict str, str = { PERMISSION OPTIONS = def get available modes - list SessionMode def get option handlers - dict str, Callable , ConfirmationResult ⋮---- actions description = ⋮---- tool name = action.tool name action content = ⋮---- Create a tool call representation tool call = ToolCallUpdate ⋮---- response = await conn.request permission outcome = response.outcome ⋮---- option handlers = get option handlers handler = option handlers.get outcome.optionId 证据：`openhands_cli/acp_impl/confirmation.py`
- **Get visualization text**（source_file）：logger = get logger name class EventSubscriber ⋮---- async def call self, event: Event - None async def handle action event self, event: ActionEvent - None ⋮---- thought text = " ".join t.text for t in event.thought ⋮---- async def handle message event self, event: MessageEvent - None ⋮---- """Handle MessageEvent by sending AgentMessageChunk or UserMessageChunk. Args: event: MessageEvent from agent or user """ ⋮---- Get visualization text viz text = event visualize to plain event ⋮---- Determine which type of message chunk to send based on role 证据：`openhands_cli/acp_impl/events/event.py`
- **Shared Event Handler**（source_file）：logger = get logger name REASONING HEADER = " Reasoning :\n" THOUGHT HEADER = "\n Thought :\n" def event visualize to plain event: Event - str class ACPContext Protocol ⋮---- session id: str conn: Client conversation: BaseConversation None class SharedEventHandler ⋮---- def meta self, ctx: ACPContext - dict str, dict str, int float str None async def send thought self, ctx: ACPContext, text: str - None ⋮---- async def handle pause self, ctx: ACPContext, event: PauseEvent - None ⋮---- async def handle condensation self, ctx: ACPContext, event: Condensation - None ⋮---- obs = event.observation ⋮---- status map: dict TaskTrackerStatusType, PlanEntryStatus = { entries: list PlanEntry = ⋮---- as… 证据：`openhands_cli/acp_impl/events/shared_event_handler.py`
- **Token Streamer**（source_file）：ACPUpdate = logger = get logger name class TokenBasedEventSubscriber ⋮---- def reset header state self - None def prune tool call state self, tool call id: str - None ⋮---- indices to remove = ⋮---- def is tool call started self, tool call id: str - bool async def update tool call with summary self, event: ActionEvent - None ⋮---- summary = str event.summary if event.summary else None title = get tool title kind = get tool kind tool name=event.tool name, action=event.action ⋮---- async def unstreamed event handler self, event: Event - None def on token self, chunk: LLMStreamChunk - None ⋮---- delta = getattr choice, "delta", None ⋮---- choice index = getattr choice, "index", 0 or 0 tool cal… 证据：`openhands_cli/acp_impl/events/token_streamer.py`
- **Kind is cached once skeleton is valid depends only on command, not path**（source_file）：class ToolCallState ⋮---- def init self, tool call id: str, tool name: str - None ⋮---- Kind is cached once skeleton is valid depends only on command, not path ⋮---- Incrementally streamed summary from assistant content prior to tool call ⋮---- def append args self, args part: str - None ⋮---- """Append new arguments part to the accumulated args and lexer.""" ⋮---- def extract thought piece self - str None ⋮---- """Incrementally emit new text from the Think tool's thought argument. Reparses the best-effort JSON args and diffs against the previously emitted prefix. Prepends THOUGHT HEADER on the first non-empty delta for consistent formatting with non-streaming mode. """ ⋮---- args = json.lo… 证据：`openhands_cli/acp_impl/events/tool_state.py`
- **Return structured metrics data including status line**（source_file）：TOOL KIND MAPPING: dict str, ToolKind = { def format status line usage: TokenUsage, cost: float - str ⋮---- input tokens = abbreviate number usage.prompt tokens or 0 output tokens = abbreviate number usage.completion tokens or 0 prompt = int usage.prompt tokens or 0 cache read = int usage.cache read tokens or 0 cache rate = f"{ cache read / prompt 100 :.2f}%" if prompt 0 else "N/A" reasoning tokens = int usage.reasoning tokens or 0 parts: list str = ⋮---- """Get metrics data to include in the meta field. Returns metrics data similar to how SDK's format metrics subtitle works, extracting token usage and cost from conversation stats. Returns: Dictionary with metrics data or None if stats unav… 证据：`openhands_cli/acp_impl/events/utils.py`
- **Main**（source_file）：logger = logging.getLogger name 证据：`openhands_cli/acp_impl/main.py`
- **Runner**（source_file）：logger = logging.getLogger name ⋮---- user confirmation = await handle confirmation request ⋮---- pending actions = ConversationState.get unmatched actions conversation.state.events ⋮---- result = await ask user confirmation acp decision = result.decision policy change = result.policy change 证据：`openhands_cli/acp_impl/runner.py`
- **Slash Commands**（source_file）：logger = logging.getLogger name VALID CONFIRMATION MODE: list ConfirmationMode = def get available slash commands - list AvailableCommand ⋮---- mode options = " ".join CONFIRMATION MODES.keys mode list = " ".join CONFIRMATION MODES.keys ⋮---- def create help text - str ⋮---- """Create help text for available slash commands. Returns: Formatted help text """ commands = get available slash commands lines = "Available slash commands:", "" ⋮---- def get confirm help text current mode: ConfirmationMode - str ⋮---- modes list = "\n".join ⋮---- def get confirm error text invalid mode: str, current mode: ConfirmationMode - str def get confirm success text mode: ConfirmationMode - str ⋮---- """Get su… 证据：`openhands_cli/acp_impl/slash_commands.py`
- **Init**（source_file）：all = 证据：`openhands_cli/acp_impl/utils/__init__.py`
- **Try to convert unsupported formats**（source_file）：def convert image block block: ACPImageContentBlock - TextContent ImageContent ⋮---- Try to convert unsupported formats data = base64.b64decode block.data converted = convert image to supported format data, block.mimeType ⋮---- Conversion failed - save to disk and return explanatory text filename = f"image {uuid4 .hex}" target = get acp cache dir / filename ⋮---- supported = ", ".join sorted SUPPORTED IMAGE MIME TYPES ⋮---- message content: list TextContent ImageContent = 证据：`openhands_cli/acp_impl/utils/convert.py`
- **Mcp**（source_file）：ACPMCPServerType = McpServerStdio HttpMcpServer SseMcpServer def convert env to dict env: Sequence dict str, str - dict str, str ⋮---- env dict: dict str, str = {} ⋮---- converted servers: dict str, dict str, Any = {} ⋮---- server dict = server.model dump server name: str = server dict "name" server config: dict str, Any = { 证据：`openhands_cli/acp_impl/utils/mcp.py`
- **1. If it's a supported image type, directly return ImageContent**（source_file）：RESOURCE SKILL = Skill ⋮---- @lru cache maxsize=1 def get acp cache dir - Path ⋮---- cache dir = Path.home / ".openhands" / "cache" / "acp" ⋮---- SUPPORTED IMAGE MIME TYPES = { ⋮---- img = Image.open io.BytesIO image data ⋮---- output format = "PNG" target mime = "image/png" ⋮---- output buffer = io.BytesIO ⋮---- converted data = base64.b64encode output buffer.read .decode "utf-8" ⋮---- res: ACPTextResourceContents ACPBlobResourceContents = block.resource ⋮---- mime type = res.mimeType or "" 1. If it's a supported image type, directly return ImageContent ⋮---- data uri = f"data:{mime type};base64,{res.blob}" ⋮---- 2. If it's an unsupported image type, try to convert it ⋮---- data = base64.b… 证据：`openhands_cli/acp_impl/utils/resources.py`
- **Acp Parser**（source_file）：def add acp parser subparsers: argparse. SubParsersAction - argparse.ArgumentParser ⋮---- acp parser = subparsers.add parser ⋮---- acp confirmation group = acp parser.add mutually exclusive group 证据：`openhands_cli/argparsers/acp_parser.py`
- **Auth Parser**（source_file）：def add login parser subparsers: argparse. SubParsersAction - argparse.ArgumentParser ⋮---- login parser = subparsers.add parser default cloud url = os.getenv "OPENHANDS CLOUD URL", "https://app.all-hands.dev" ⋮---- """Add logout subcommand parser. Args: subparsers: The subparsers object to add the logout parser to Returns: The logout argument parser """ logout parser = subparsers.add parser "logout", help="Log out from OpenHands Cloud" 证据：`openhands_cli/argparsers/auth_parser.py`
- **Cloud Parser**（source_file）：def add cloud parser subparsers: argparse. SubParsersAction - argparse.ArgumentParser ⋮---- cloud parser = subparsers.add parser ⋮---- default cloud url = os.getenv "OPENHANDS CLOUD URL", "https://app.all-hands.dev" 证据：`openhands_cli/argparsers/cloud_parser.py`
- **Main Parser**（source_file）：def create main parser - argparse.ArgumentParser ⋮---- parser = argparse.ArgumentParser ⋮---- confirmation group = parser.add mutually exclusive group ⋮---- subparsers = parser.add subparsers dest="command", help="Additional commands" 证据：`openhands_cli/argparsers/main_parser.py`
- 其余 18 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`AGENTS.md`, `README.md`, `tui_e2e/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`AGENTS.md`, `README.md`, `tui_e2e/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **Project Overview and Installation**：importance `high`
  - source_paths: README.md, pyproject.toml, openhands_cli/__init__.py, build.py, build.sh
- **Configuration, Running Modes and CLI Surface**：importance `high`
  - source_paths: openhands_cli/entrypoint.py, openhands_cli/argparsers/main_parser.py, openhands_cli/argparsers/acp_parser.py, openhands_cli/argparsers/auth_parser.py, openhands_cli/argparsers/cloud_parser.py
- **TUI System: Widgets, Modals, Conversation Runner and Critic**：importance `high`
  - source_paths: openhands_cli/tui/textual_app.py, openhands_cli/tui/textual_app.tcss, openhands_cli/tui/widgets/richlog_visualizer.py, openhands_cli/tui/widgets/main_display.py, openhands_cli/tui/widgets/input_area.py
- **ACP Server, Cloud Mode, MCP and Conversation Storage**：importance `high`
  - source_paths: openhands_cli/acp_impl/main.py, openhands_cli/acp_impl/runner.py, openhands_cli/acp_impl/confirmation.py, openhands_cli/acp_impl/slash_commands.py, openhands_cli/acp_impl/agent/base_agent.py

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `8f5d89ef2c12e200140adf603e857690cea5d371`
- inspected_files: `uv.lock`, `pyproject.toml`, `README.md`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：[Feature]: add `openhands mcp test <name>` to validate a configured MCP server

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[Feature]: add `openhands mcp test <name>` to validate a configured MCP server
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | https://github.com/OpenHands/OpenHands-CLI/issues/694 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 仓库名和安装名不一致

- Trigger: 仓库名 `openhands-cli` 与安装入口 `openhands` 不完全一致。
- Host AI rule: 在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。
- Why it matters: 用户照着仓库名搜索包或照着包名找仓库时容易走错入口。
- Evidence: identity.distribution | github_repo:1049343369 | https://github.com/OpenHands/OpenHands-CLI | repo=openhands-cli; install=openhands
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：[Bug]: Critic button isn't showing up properly

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug]: Critic button isn't showing up properly
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/OpenHands/OpenHands-CLI/issues/641 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：[UX] CLI does not clean up terminal state after exit, requiring manual reset

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：[UX] CLI does not clean up terminal state after exit, requiring manual reset
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/OpenHands/OpenHands-CLI/issues/671 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | github_repo:1049343369 | https://github.com/OpenHands/OpenHands-CLI | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | github_repo:1049343369 | https://github.com/OpenHands/OpenHands-CLI | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | github_repo:1049343369 | https://github.com/OpenHands/OpenHands-CLI | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 存在评分风险

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | github_repo:1049343369 | https://github.com/OpenHands/OpenHands-CLI | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：[CLI] Feature Request: LLM Profile Management for OpenHands CLI

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[CLI] Feature Request: LLM Profile Management for OpenHands CLI
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | https://github.com/OpenHands/OpenHands-CLI/issues/68 | 来源讨论提到 api key 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 来源证据：[M1] Plugin Loading and Command Invocation

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[M1] Plugin Loading and Command Invocation
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/OpenHands/OpenHands-CLI/issues/409 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
