拓冰建站拓冰建站
首页 / 资讯中心 / 正文

oh-my-openagent 后台任务卡在 lsp_install_decision 等安装决策怎么排查?

oh-my-openagent 后台任务卡在 lsp_install_decision 等安装决策怎么排查【免费下载链接】oh-my-openagentOmO: Just type mass ulw keyword with your prompt. Now you are the master of graph engineering.项目地址: https://gitcode.com/gh_mirrors/oh/oh-my-openagent在 oh-my-openagentOmO里跑后台任务时如果任务调用了 LSP 工具如lsp_diagnostics而对应的 language server 没有安装任务会停在lsp_install_decision上报卡在安装决策、一直等待安装提示而不继续执行。这是 已知问题 #5260 记录的现象任务报告 stuck onlsp_install_decision等待 install prompt 而不是在没有 LSP 的情况下继续跑完。症状长什么样LSP 工具命中未安装的 language server 时返回的消息以Command not found: 命令名开头并附带安装建议安装命令、server_id例如rust。如果当前 harness 支持记录决策消息结尾是明确的行动指令见 client-wrapper.tsACTION REQUIRED — ASK THE USER whether to install this LSP server. - If the user agrees: run the install command above, then retry this tool. - If the user declines, OR has NOT explicitly asked for LSP installation: call lsp_install_decision { server_id: rust, decision: declined }, which writes to install decisions 文件路径, then ignore this message and proceed WITHOUT LSP.也就是说卡住的后台任务通常是在等一个装不装的答复而后台会话里没有人能回答这个提示。判断依据就是任务输出里出现lsp_install_decision、Command not found或ACTION REQUIRED — ASK THE USER whether to install this LSP server这几类字样。机制决策如何被持久化每个缺失的 server 只会被询问一次答复会写入 harness 专属的决策文件见 configuration.md 的 LSP Install Decisions 一节Harness决策文件位置OpenCodeOpenCode config directory 下的lsp-install-decisions.jsonlsp.ts 中解析为config dir/lsp-install-decisions.json即$XDG_CONFIG_HOME/opencode/lsp-install-decisions.jsonCodex$CODEX_HOME/lsp-install-decisions.json两个路径都可以用环境变量LSP_TOOLS_MCP_INSTALL_DECISIONS覆盖为自定义路径在 lsp-tools-mcp 的文档中相对路径会解析到用户主目录内。lsp_install_decision工具接收两个参数见 definitions.tsserver_id未安装消息里给出的 LSP server id例如rustdecisiondeclined或allowed。declined静默后续提示allowed预授权安装。解除卡住记录 declined 决策主路径是让会话或后台任务对应的父会话为该缺失 server 记录一条declined决策然后让任务在没有 LSP 的情况下继续lsp_install_decision { server_id: 未安装消息中的 server id例如 rust, decision: declined }server_id直接取自未安装消息不要自造。记录之后按文档说明该 server 后续所有 LSP 调用都会折叠成一条单行警告one-line warning不再弹出安装决策后台任务即可继续。如果确实想装也可以传decision: allowed预授权再按消息里给出的安装命令执行安装并重试该 LSP 工具。验证是否生效再次触发同一个 LSP 工具输出应只剩一条单行提示而不是安装问题declined条目将后续 diagnostics 折叠为一行 note。用lsp_status列出当前已配置和处于活跃状态的 LSP server确认没有把缺失 server 误认为可用该工具在 features.md 的 LSP Tools 表中列为 List configured and active LSP servers。跨会话共享与撤销决策跨会话共享把LSP_TOOLS_MCP_INSTALL_DECISIONS设置成一个稳定的决策文件路径各会话读取同一份决策避免每个新会话重新等待提示。重新获得提示 / 重新启用如果你之前记的是declined包括 agent 代你记录的情况删除决策文件本身或删除其中该 server 的条目之后会再次被询问。删除操作只针对这一个决策文件不影响其他配置。相关排查与限制这个行为本身后台任务等待安装决策在 #5260 中状态仍是 Opendeclined决策是当前文档给出的 workaround。如果后台任务需要 LSP注意 已知问题 #4225v4.2.3 之后写在项目.opencode/oh-my-openagent.jsonc里的自定义 LSP 配置会被静默忽略。server 应配置在.opencode/lsp.json、.omo/lsp.json、.omo/lsp-client.json或用户级 OpenCode 配置目录的lsp.json中lsp-tools-mcp README 列出的 OpenCode 项目配置路径顺序为cwd/.opencode/lsp.json、cwd/.omo/lsp.json、cwd/.omo/lsp-client.json。决策记录依赖 harness 支持lsp_install_decision工具在不支持记录决策的 harness 里工具会直接提示记录不可用如用户拒绝则在没有 LSP 的情况下继续此时只能按提示手动处理。【免费下载链接】oh-my-openagentOmO: Just type mass ulw keyword with your prompt. Now you are the master of graph engineering.项目地址: https://gitcode.com/gh_mirrors/oh/oh-my-openagent创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门