DeepSeek Harness + cc-connect + 飞书:让手机直接驱动本地 Agent

DeepSeek Harness + cc-connect + 飞书:让手机直接驱动本地 Agent

2026-08-17 | 作者:borong | 分类:AI 编程

一、为什么做这件事

DeepSeek Harness 是 DeepSeek 官方开源的 Agent Harness,核心思路是:

text 复制代码
Model + Harness = Agent

它负责模型之外的部分:文件系统、Shell、会话、工具、审批、持久化和 Web UI。对我来说,最有价值的是它能把本地 Agent 跑成一个真实可执行的运行底座。

但默认 Web UI 只能在电脑上打开。我希望做到:

  • 人在外面,只有手机。
  • 打开飞书,发一条消息。
  • 本地 DeepSeek Harness 开始执行。
  • 结果自动回到飞书。

这篇文章记录我用 cc-connect + ACP 把它跑通的过程。

二、整体架构

text 复制代码
飞书 Bot
  -> cc-connect
  -> DeepSeek Harness ACP stdio 服务
  -> DeepSeek 模型 + Harness 工具能力

cc-connect 负责飞书和本地 Agent 的桥接,DeepSeek Harness 通过 ACP 协议提供一个自动化入口。ACP 是 Agent Client Protocol,本质是 JSON-RPC over stdio,非常适合让 cc-connect 这类桥接层直接驱动。

三、核心组件

组件 作用
飞书机器人 手机端消息入口
cc-connect v1.5.0 桥接飞书消息到本地 Agent
cc-connect type = "acp" 通用 ACP Agent 适配器
DeepSeek Harness 提供模型调用、Shell、文件系统、会话和审批
DeepSeek API 负责模型推理

四、实施步骤

1. 准备 DeepSeek Harness ACP 配置

Harness 仓库提供了 ACP 自动化示例。我复制出一份独立配置,调整模型和会话目录:

text 复制代码
deepseek-harness/examples/dsh-cc/acp.cordis.yml

PoC 阶段使用:

  • 模型:deepseek-v4-flash
  • 权限模式:workspace-write
  • 工作区:独立目录
  • 会话目录:独立目录

一个重要的坑:配置必须放在 deepseek-harness/examples/ 下。因为 Harness 的 workspace 插件依赖在 examples/node_modules 中,配置放错目录会报:

text 复制代码
ERR_MODULE_NOT_FOUND: Cannot find package '@deepseek-ai/dsh-llm-deepseek'

2. 配置 cc-connect 项目

在 ~/.cc-connect/config.toml 中新增项目:

toml 复制代码
[[projects]]
name = "dsh"
admin_from = "*"

[projects.agent]
type = "acp"

[projects.agent.options]
work_dir = "/path/to/dsh-workspace"
cmd = "/path/to/node"
args = [
  "/path/to/deepseek-harness/packages/examples/acp-demo/lib/bin.js",
  "--config",
  "/path/to/deepseek-harness/examples/dsh-cc/acp.cordis.yml"
]
display_name = "DeepSeek Harness"

[projects.agent.options.env]
DEEPSEEK_API_KEY = "your-api-key"
DSH_PERMISSION_MODE = "workspace-write"

3. 创建飞书机器人

cc-connect 提供飞书二维码注册流程:

bash 复制代码
cc-connect feishu new \
  --project dsh \
  --qr-image dsh-feishu-qr.png

手机扫码后,cc-connect 会自动把 App ID、App Secret 和平台配置写入项目。

五、验证结果

cc-connect 日志出现:

text 复制代码
platform ready project=dsh platform=feishu
engine started project=dsh agent=acp platforms=1
message received platform=feishu
session spawned agent_session=...
turn complete response_len=141

飞书会话收到回复:

text 复制代码
链路确认 OK:shell 正常,工作目录 /path/to/dsh-workspace 可读写(当前为空)。

六、踩坑清单

问题 原因 解决
项目没有平台导致启动失败 dsh 项目缺少 [[projects.platforms]] 先扫码创建飞书机器人,再启动 cc-connect
systemd 服务反复失败 旧的游离进程占用实例锁 清理游离进程,只用 systemd 启动
Harness ACP 找不到插件 ACP 配置放在仓库外部 配置放到 deepseek-harness/examples/ 下
SSH 退出后服务停止 用户 Linger 未开启 执行 loginctl enable-linger <user>

七、安全建议

  • Harness 能执行 Shell,不能无脑开放所有权限。
  • 建议使用 workspace-write,只允许在工作区内写文件。
  • Web UI 不要直接暴露到公网。
  • 飞书机器人和 API Key 要严格保密。
  • 需要更宽操作时,在飞书里逐项审批,不要直接 danger-full-access。

八、下一步

  • 在飞书里测试文件创建、代码修改等工具调用。
  • 对比 deepseek-v4-flash 和 deepseek-v4-pro 的效果。
  • 如果需要长期多轮会话,可以继续评估 Harness 的 Python SDK / JSON-RPC 入口。

这套链路的意义在于:Agent 不一定要被绑在电脑前,手机上的飞书消息也可以成为它的入口。

相关推荐
CODER03045 天前
ubuntu22.04部署完整deepseek局域网web服务全过程(RTX5090安装黑屏+web端多人并发)
pytorch·webui·ubuntu22.04·ollama·deepseek·rtx5090·自然语言模型
华科大胡子5 天前
DeepSeek Harness 开源贡献手记:从入门到合入主线
deepseek
Together_CZ6 天前
DeepSeek-V4.1-Flash:Pushing the Limits of KV Cache Compression——推动 KV 缓存压缩的极限
缓存·llm·compression·kv cache·deepseek·v4.1-flash·推动 kv 缓存压缩的极限
roamingcode6 天前
DeepSeek Harness 记忆召回插件的“PRD”设计拆解
agent·memory·deepseek·harness·dsh·dsh-plugin
前端小白乘风6 天前
VS Code 终于能连微信了!发现一个硬核开源神仙插件:WeChat AHP
微信·visual studio code·deepseek
今夕资源网7 天前
把 DeepSeek 网页版变成能操作本地项目的 AI Agent:Cuckoo Code 使用指南 GitHub开源
开源·github·deepseek
gs801408 天前
【大模型工程实践】LLM 提效降本指南:基于 Context Caching 与专属 Endpoint 的架构优化
deepseek·大模型缓存
ss2738 天前
DeepSeek Harness v0.1.6-alpha.2:文件审阅、Office 预览、插件管理,Web 端越来越像 IDE 了
deepseek·dsh
JaydenAI9 天前
[DeepSeek Harness插件内核-15]再谈Cordis的事件总线
ai·agent·plugin·deepseek·harness·cordis
miaowmiaow9 天前
我让 AI 给老项目做了一次分层架构升级:对标 Now in Android,从「穿层」到「端口与适配器」
android·ai编程·deepseek