AI Orchestrator v2.0.11
What this is: Browser automation that talks to DeepSeek via Puppeteer.
What this is NOT: A general AI router or multi-model orchestrator. It's one browser → one LLM.
Execution
Working directory rule: Unless a command here uses an absolute path, run ai-orchestrator commands from the skill root: ~/.openclaw/workspace/skills/ai-orchestrator.
If you are not already there, run:
CODEBLOCK0
Relative paths such as .daemon-ws-endpoint, .profile/, .deepseek.json, and scripts/setup-daemon.sh assume this directory.
Quick Start
CODEBLOCK1
When to use ai-orchestrator
| Task | ai-orchestrator | Direct API | Manual browser |
|---|
| Code analysis / review | ✅ Fast, no API key | Needs API | ❌ Slow |
| Text analysis / summary |
✅ (with --daemon) | Needs API | ❌ Tedious |
| Brainstorming | ❌ (use Dual Thinking skill) | Needs API | ❌ |
| Web scraping | ❌ Wrong tool | ❌ | ✅ |
| API testing | ❌ Overkill | ✅ | ❌ |
| CAPTCHA solving | ❌ Will fail | ❌ | ✅ (manual) |
Rule: Need LLM reasoning without API key → ai-orchestrator.
Need browser tasks (scrape, click, fill forms) → use agent-browser skill instead.
Default site mode: ai-orchestrator must keep DeepSeek in Expert mode whenever the site exposes the Instant / Expert switch. Treat Expert as the canonical default. Do not fall back to Instant unless a future implementation explicitly adds an override and the user asks for it.
Session continuity: in daemon mode, follow-up requests using --session NAME must restore the exact saved DeepSeek chatUrl for that session unless --new-chat was explicitly requested. Reusing an arbitrary open DeepSeek tab is incorrect because it breaks multi-round review continuity.
All Flags
| Flag | Purpose |
|---|
| INLINECODE13 | Persistent context across requests (keeps chat history) |
| INLINECODE14 |
Use running Chrome daemon (~35ms startup) |
|
--search | Enable DeepSeek web search capability |
|
--think | Enable DeepThink site mode (deeper reasoning) |
|
--new-chat | Start new chat within existing session |
|
--end-session | Close and clean up session |
|
--visible | Open visible browser (for auth/CAPTCHA fixes) |
|
--wait | Wait for manual auth completion (with --visible) |
|
--close | Force close browser after request |
|
--dry-run | Test auth + composer without sending prompt |
|
--stdin | Explicitly read prompt body from stdin |
|
--debug | Verbose debug output |
|
--verbose | More detailed logs |
|
-h, --help | Show help |
Health check
CODEBLOCK2
If any step fails, do not improvise. Use the troubleshooting ladder below.
Failure Recovery (mandatory routing)
First failure rule — do not skip
When any command fails:
- 1. STOP — do not try a random second fix yet
- CAPTURE — read the exact error you saw
- MATCH — find the closest symptom row below
- RUN — execute that row's exact command
- VERIFY — retry with the specified verification command
Symptom → exact command
| If you see this symptom | Run this exact command | Then verify with |
|---|
INLINECODE27 , ECONNREFUSED, daemon not online | INLINECODE29 | INLINECODE30 |
INLINECODE31 , CAPTCHA, login page, 401, INLINECODE34 |
cd ~/.openclaw/workspace/skills/ai-orchestrator && pm2 stop deepseek-daemon && rm -f .daemon-ws-endpoint && bash ask-deepseek.sh --visible --wait --dry-run && pm2 start deepseek-daemon |
bash ask-deepseek.sh --dry-run --daemon |
| response cuts off / incomplete long answer |
ask-deepseek.sh "Part 1" --session temp && ask-deepseek.sh "Continue with next part" --session temp |
ask-deepseek.sh --session temp --end-session |
|
lock,
Singleton, profile already in use |
cd ~/.openclaw/workspace/skills/ai-orchestrator && rm -f .profile/Singleton* && pm2 restart deepseek-daemon |
bash ask-deepseek.sh --dry-run |
|
timeout, selector missing, composer not found |
ask-deepseek.sh --dry-run --visible | only after manual inspection consider selector edits |
If 3 fixes failed already
Do not keep guessing. Reset to a known-good baseline:
CODEBLOCK3
If that still fails, escalate to manual auth/inspection with --visible --wait.
Manual Auth with --wait
INLINECODE46 blocks until you complete auth in the visible browser or interrupt the command yourself.
There is no automatic timeout documented here.
Use Ctrl+C if you need to abort.
Daemon Setup
One-liner:
CODEBLOCK4
Or manual:
CODEBLOCK5
Exit Codes
| Code | Meaning | Action |
|---|
| 0 | Success — response received | Continue |
| 1 |
Config/arg error | Check flags, run
--help |
| 2 | DeepSeek unreachable or daemon unavailable | Check network, daemon endpoint, pm2 status |
| 3 | Blocked or rate limited | Wait 5s, retry, or use --visible |
Note: Partial success (truncated response) still returns 0. Use "Continue" button handling.
Known Limitations (v2.0.11)
- - Exact-string prompts: DeepSeek may prepend explanation text before the requested suffix. For machine-sensitive checks, prefer structured JSON prompts when possible, or validate that the returned payload still contains the expected terminal token instead of assuming exact literal obedience.
- Oversized prompts: if a giant single-shot prompt does not actually leave the page, ai-orchestrator now validates submit outcome, retries with adaptive shortening, and fails explicitly with
DEEPSEEK_SUBMIT_BLOCKED_OVERSIZE_PROMPT if delivery never succeeds. - Publish hygiene: local runtime state must not be published. Before ClawHub publish, verify that
.clawhubignore excludes local profile, diagnostics, logs, sessions, and daemon state files.
DeepSeek Free Tier Limits
- - Per response: ~13,000 characters (verified 2026-04-03)
- Button "Continue" auto-clicked up to 30 times
- Rate limit: 5 seconds between requests
- Session limit: Use
--session for long conversations instead of single huge prompts
Workaround for Long Answers (>13k chars)
CODEBLOCK6
Logging
After important orchestrator runs, append to
memory/episodic/YYYY-MM-DD.md:
## ai-orchestrator
- Task: code review app.js (tool: deepseek, duration: 12s, status: success)
- Failure: CAPTCHA on deepseek (fallback: manual via --visible)
Not every request needs logging. Log decisions and failures, not routine questions.
What NOT to do
- - ❌ Use for web scraping or browser automation (wrong tool — use agent-browser skill)
- ❌ Bypass Dual Thinking for complex decisions (orchestrator executes, doesn't think)
- ❌ Ignore failure logs (they tell you what's broken)
- ❌ Run without --daemon unless debugging (cold start = 15s vs 35ms)
- ❌ Guess random fixes when a known failure case already matches
- ❌ Open a visible browser first if the problem is only a dead daemon — restart daemon first
- ❌ Keep reusing one broken long prompt after free-tier cutoff — switch to
--session chunks instead
Configuration (.deepseek.json)
CODEBLOCK8
Minimal Contract for Weak Runtimes
- - Exit codes:
0 = success, 1 = config/runtime error, 2 = DeepSeek unreachable or daemon unavailable, 3 = blocked or rate-limited. Never treat 2 or 3 as success. - Mode enforcement: when DeepSeek shows
Instant / Expert, ai-orchestrator must use Expert unless the user explicitly requests otherwise via a future supported override. - Session restore:
--session NAME must restore the exact saved chatUrl unless --new-chat was explicitly requested. - Publish hygiene: before publishing to ClawHub, ensure
.clawhubignore exists and excludes local runtime state.
Minimal Decision Rules for Weak Models
When choosing what to do next, use these defaults:
- - Need fastest normal run → use INLINECODE66
- Need context across multiple prompts on one topic → use INLINECODE67
- Need a brand new DeepSeek chat for that topic → add INLINECODE68
- Need to close the topic chat → use INLINECODE69
- Need auth/login repair → stop daemon first, then INLINECODE70
- Need a health check without sending a real prompt → use INLINECODE71
- Need a long answer → use
--session and split it into chunks - Need browser automation on websites → stop and use
agent-browser, not ai-orchestrator
- Need failure recovery → do not guess; use the symptom table above
- Before every real prompt send, keep the DeepSeek site in Expert mode when that switch exists
- If --think is used, enable the site DeepThink` toggle before sending the prompt
Troubleshooting → REFERENCE.md
See
REFERENCE.md for:
- - Architecture overview (Puppeteer + CDP interceptor)
- Complete troubleshooting guide
- Diagnostic system (trace + metrics + summary JSON + file log)
- Performance benchmarks
- Common issues: CAPTCHA, rate limits, selector changes, visible-browser vs daemon behavior
AI Orchestrator v2.0.11
这是什么: 通过 Puppeteer 与 DeepSeek 对话的浏览器自动化工具。
这不是什么: 通用 AI 路由器或多模型编排器。它是一个浏览器 → 一个 LLM。
执行
工作目录规则: 除非此处命令使用绝对路径,否则请从技能根目录运行 ai-orchestrator 命令:~/.openclaw/workspace/skills/ai-orchestrator。
如果你尚未进入该目录,请运行:
bash
cd ~/.openclaw/workspace/skills/ai-orchestrator
相对路径如 .daemon-ws-endpoint、.profile/、.deepseek.json 和 scripts/setup-daemon.sh 均以此目录为基准。
快速开始
bash
简单问题
ask-deepseek.sh 什么是 HTTP?
会话(在问题之间保持上下文)
ask-deepseek.sh 解释 OAuth2 --session work
ask-deepseek.sh 那 OpenID Connect 呢? --session work
ask-deepseek.sh --session work --end-session
使用守护进程(快速启动 ~35ms vs ~15s 冷启动)
ask-deepseek.sh 问题 --daemon
管道输入代码或长提示
cat code.py | ask-deepseek.sh 查找错误
ask-deepseek.sh --stdin < code.py
ask-deepseek.sh <
何时使用 ai-orchestrator
| 任务 | ai-orchestrator | 直接 API | 手动浏览器 |
|---|
| 代码分析/审查 | ✅ 快速,无需 API 密钥 | 需要 API | ❌ 慢 |
| 文本分析/总结 |
✅ (使用 --daemon) | 需要 API | ❌ 繁琐 |
| 头脑风暴 | ❌ (使用 Dual Thinking 技能) | 需要 API | ❌ |
| 网页抓取 | ❌ 工具错误 | ❌ | ✅ |
| API 测试 | ❌ 杀鸡用牛刀 | ✅ | ❌ |
| 验证码解决 | ❌ 会失败 | ❌ | ✅ (手动) |
规则: 需要 LLM 推理但无 API 密钥 → 使用 ai-orchestrator。
需要浏览器任务(抓取、点击、填写表单)→ 改用 agent-browser 技能。
默认站点模式: 当站点显示 Instant / Expert 开关时,ai-orchestrator 必须将 DeepSeek 保持在 Expert 模式。将 Expert 视为规范默认值。除非未来实现明确添加覆盖且用户要求,否则不要回退到 Instant。
会话连续性: 在守护进程模式下,使用 --session NAME 的后续请求必须恢复该会话保存的精确 DeepSeek chatUrl,除非明确请求了 --new-chat。重用任意打开的 DeepSeek 标签页是错误的,因为它会破坏多轮审查的连续性。
所有标志
| 标志 | 用途 |
|---|
| --session NAME | 跨请求的持久上下文(保留聊天历史) |
| --daemon |
使用正在运行的 Chrome 守护进程(~35ms 启动) |
| --search | 启用 DeepSeek 网页搜索能力 |
| --think | 启用 DeepThink 站点模式(更深层推理) |
| --new-chat | 在现有会话中开始新聊天 |
| --end-session | 关闭并清理会话 |
| --visible | 打开可见浏览器(用于认证/验证码修复) |
| --wait | 等待手动认证完成(与 --visible 一起使用) |
| --close | 请求后强制关闭浏览器 |
| --dry-run | 测试认证 + 编辑器而不发送提示 |
| --stdin | 明确从标准输入读取提示内容 |
| --debug | 详细调试输出 |
| --verbose | 更详细的日志 |
| -h, --help | 显示帮助 |
健康检查
bash
1. 守护进程在运行?
pm2 status | grep -q deepseek.*online || echo 守护进程已关闭
2. 干运行路径正常?
ask-deepseek.sh --dry-run --daemon || echo DeepSeek 干运行失败 # 通过守护进程路径检查认证 + 编辑器
3. 真实响应路径正常?
ask-deepseek.sh OK --daemon | grep -q OK || echo DeepSeek 无响应
如果任何步骤失败,不要临时凑合。使用下面的故障排除阶梯。
故障恢复(强制路由)
首次失败规则 — 不要跳过
当任何命令失败时:
- 1. 停止 — 不要立即尝试随机第二种修复
- 捕获 — 读取你看到的精确错误
- 匹配 — 找到下面最接近的症状行
- 运行 — 执行该行的精确命令
- 验证 — 使用指定的验证命令重试
症状 → 精确命令
| 如果你看到此症状 | 运行此精确命令 | 然后用以下命令验证 |
|---|
| Connection refused、ECONNREFUSED、守护进程未在线 | pm2 restart deepseek-daemon && sleep 8 && ask-deepseek.sh --dry-run --daemon | ask-deepseek.sh 说 OK --daemon |
| auth expired、CAPTCHA、登录页面、401、403 |
cd ~/.openclaw/workspace/skills/ai-orchestrator && pm2 stop deepseek-daemon && rm -f .daemon-ws-endpoint && bash ask-deepseek.sh --visible --wait --dry-run && pm2 start deepseek-daemon | bash ask-deepseek.sh --dry-run --daemon |
| 响应截断/长答案不完整 | ask-deepseek.sh 第1部分 --session temp && ask-deepseek.sh 继续下一部分 --session temp | ask-deepseek.sh --session temp --end-session |
| lock、Singleton、配置文件已在使用 | cd ~/.openclaw/workspace/skills/ai-orchestrator && rm -f .profile/Singleton* && pm2 restart deepseek-daemon | bash ask-deepseek.sh --dry-run |
| timeout、选择器缺失、编辑器未找到 | ask-deepseek.sh --dry-run --visible | 仅在手动检查后考虑选择器编辑 |
如果已尝试 3 次修复仍失败
不要继续猜测。重置为已知良好的基线:
bash
cd ~/.openclaw/workspace/skills/ai-orchestrator
pm2 stop deepseek-daemon
pkill -f puppeteer || true
rm -f .daemon-ws-endpoint .profile/Singleton*
bash scripts/setup-daemon.sh
bash ask-deepseek.sh 说 OK --daemon
如果仍然失败,使用 --visible --wait 升级到手动认证/检查。
使用 --wait 手动认证
--wait 会阻塞,直到你在可见浏览器中完成认证或自行中断命令。
此处没有记录自动超时。
如果需要中止,请使用 Ctrl+C。
守护进程设置
一行命令:
bash
cd ~/.openclaw/workspace/skills/ai-orchestrator && bash scripts/setup-daemon.sh
或手动:
bash
bash scripts/setup-daemon.sh # 或按以下步骤逐步运行
npm install # 仅首次
pm2 start deepseek-daemon.js --name deepseek-daemon --no-autorestart
pm2 save
pm2 startup # 开机自动启动
退出代码
配置/参数错误 | 检查标志,运行 --help |
| 2 | DeepSeek 不可达或守护进程不可用 | 检查网络、守护进程端点、pm2 状态 |
| 3 | 被阻止或速率受限 | 等待 5 秒,重试,或使用 --visible |
注意: 部分成功(截断响应)仍返回 0。使用继续按钮处理。
已知限制(v2.0.11)
- - 精确字符串提示: DeepSeek 可能会在请求的后缀前添加解释文本。对于机器敏感检查,尽可能首选结构化 JSON 提示,或验证返回的负载是否仍包含预期的终端令牌,而不是假设精确的字面服从。
- 过大的提示: