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.
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:
bash
cd ~/.openclaw/workspace/skills/ai-orchestrator
Relative paths such as .daemon-ws-endpoint, .profile/, .deepseek.json, and scripts/setup-daemon.sh assume this directory.
bash
# Simple question
ask-deepseek.sh "What is HTTP?"
# Session (keeps context between questions)
ask-deepseek.sh "Explain OAuth2" --session work
ask-deepseek.sh "What about OpenID Connect?" --session work
ask-deepseek.sh --session work --end-session
# With daemon (fast startup ~35ms vs ~15s cold)
ask-deepseek.sh "Question" --daemon
# Pipe code or long prompts
cat code.py | ask-deepseek.sh "Find bugs"
ask-deepseek.sh --stdin < code.py
ask-deepseek.sh <<'EOF'
Long multi-line prompt here
EOF
Taskai-orchestratorDirect APIManual browserCode analysis / review✅ Fast, no API keyNeeds API❌ SlowText analysis / summary✅ (with --daemon)Needs API❌ TediousBrainstorming❌ (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.
FlagPurpose--session NAMEPersistent context across requests (keeps chat history)--daemonUse running Chrome daemon (~35ms startup)--searchEnable DeepSeek web search capability--thinkEnable DeepThink site mode (deeper reasoning)--new-chatStart new chat within existing session--end-sessionClose and clean up session--visibleOpen visible browser (for auth/CAPTCHA fixes)--waitWait for manual auth completion (with --visible)--closeForce close browser after request--dry-runTest auth + composer without sending prompt--stdinExplicitly read prompt body from stdin--debugVerbose debug output--verboseMore detailed logs-h, --helpShow help
bash
# 1. Daemon running?
pm2 status | grep -q "deepseek.*online" || echo "Daemon down"
# 2. Dry-run path works?
ask-deepseek.sh --dry-run --daemon || echo "DeepSeek dry-run failed" # Checks auth + composer through the daemon path
# 3. Real response path works?
ask-deepseek.sh "OK" --daemon | grep -q "OK" || echo "DeepSeek not responding"
If any step fails, do not improvise. Use the troubleshooting ladder below.
When any command fails:
If you see this symptomRun this exact commandThen verify withConnection refused, ECONNREFUSED, daemon not onlinepm2 restart deepseek-daemon && sleep 8 && ask-deepseek.sh --dry-run --daemon``ask-deepseek.sh "Say OK" --daemon``auth expired, CAPTCHA, login page, 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 --daemonresponse cuts off / incomplete long answerask-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 usecd ~/.openclaw/workspace/skills/ai-orchestrator && rm -f .profile/Singleton* && pm2 restart deepseek-daemon``bash ask-deepseek.sh --dry-run``timeout, selector missing, composer not foundask-deepseek.sh --dry-run --visibleonly after manual inspection consider selector edits
Do not keep guessing. Reset to a known-good baseline:
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 "Say OK" --daemon
If that still fails, escalate to manual auth/inspection with --visible --wait.
--wait 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.
One-liner:
bash
cd ~/.openclaw/workspace/skills/ai-orchestrator && bash scripts/setup-daemon.sh
Or manual:
bash
bash scripts/setup-daemon.sh # Or run step-by-step below
npm install # First time only
pm2 start deepseek-daemon.js --name deepseek-daemon --no-autorestart
pm2 save
pm2 startup # Auto-start on boot
CodeMeaningAction0Success — response receivedContinue1Config/arg errorCheck flags, run --help2DeepSeek unreachable or daemon unavailableCheck network, daemon endpoint, pm2 status3Blocked or rate limitedWait 5s, retry, or use --visible
Note: Partial success (truncated response) still returns 0. Use "Continue" button handling.
DEEPSEEK_SUBMIT_BLOCKED_OVERSIZE_PROMPT if delivery never succeeds..clawhubignore excludes local profile, diagnostics, logs, sessions, and daemon state files.--session for long conversations instead of single huge promptsbash
ask-deepseek.sh "Write a Python backend guide" --session guide
ask-deepseek.sh "Now cover async and databases" --session guide # Continue
ask-deepseek.sh --session guide --end-session # Done
After important orchestrator runs, append to memory/episodic/YYYY-MM-DD.md:
markdown
## 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.
--session chunks insteadjson
{
"idleTimeout": 15000,
"heartbeatInterval": 15000,
"domErrorIdleMs": 25000,
"maxContinueRounds": 30,
"logToFile": true,
"logPath": ".logs/deepseek.log"
}
0 = success, 1 = config/runtime error, 2 = DeepSeek unreachable or daemon unavailable, 3 = blocked or rate-limited. Never treat 2 or 3 as success.Instant / Expert, ai-orchestrator must use Expert unless the user explicitly requests otherwise via a future supported override.--session NAME must restore the exact saved chatUrl unless --new-chat was explicitly requested..clawhubignore exists and excludes local runtime state.When choosing what to do next, use these defaults:
--daemon--session--new-chat--end-session--visible --wait --dry-run--dry-run--session and split it into chunksagent-browser, not ai-orchestrator`Expert mode when that switch exists--think is used, enable the site DeepThink toggle before sending the promptSee REFERENCE.md for: