Skip to content

Commit c991dc2

Browse files
committed
docs: refresh README/CHANGELOG for stability + Windows + secrets update
- README.md / README_ZH.md * Add a 2026-04-17 News entry summarising the stability, Windows compatibility and secrets-hygiene work. * Document OpenAI-compatible providers (Poe, OpenRouter, DashScope) in a collapsible block, including base_url examples and the matching mcp_agent.config.yaml model snippets. * Add an 'Editable install' note (pip install -e .) so the deepcode command reliably points at the current checkout. * Fix the launch table: the 'Local' column now shows 'deepcode --local' instead of bare 'deepcode' (which defaults to Docker mode). * Expand Troubleshooting with: Docker installed-but-not-running, Windows UnicodeEncodeError, Windows mkdir -p, and the LoopDetector NameError - each cross-referenced to the matching fix. - CHANGELOG.md: regenerate to match current state. Made-with: Cursor
1 parent 47e9cb4 commit c991dc2

2 files changed

Lines changed: 87 additions & 54 deletions

File tree

README.md

Lines changed: 82 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@
159159

160160
## 📰 News
161161

162+
🛠️ **[2026-04-17] Stability, Windows compatibility & secrets hygiene update**
163+
164+
- 🐛 **Code Implementation no longer crashes** with `name 'LoopDetector' is not defined` — added the missing `LoopDetector`/`ProgressTracker` imports in both `workflows/code_implementation_workflow.py` and `workflows/code_implementation_workflow_index.py`.
165+
- 🪟 **Windows: `mkdir -p` / `touch` / `rm -rf` / `cp -r` / `mv` now work natively.** `tools/command_executor.py` translates these common Unix file-tree commands via `pathlib`/`shutil` on every platform, eliminating the bug where `cmd.exe` would create a literal `-p` directory and stall the workflow.
166+
- 🚀 **Removed Brave Search end-to-end.** All Python code, MCP server config, Dockerfile pre-installs, nanobot integration and docs are scrubbed of `brave`/`BRAVE_API_KEY`/`WebSearchTool`. Web fetching keeps working via the built-in `fetch` MCP server; `bocha-mcp` is the recommended search backend.
167+
- 🔌 **OpenAI-compatible providers documented.** New `Quick Start → Configuration` snippet shows how to point the `openai` block at Poe (`https://api.poe.com/v1`), OpenRouter, or Alibaba DashScope, plus how to set `default_model`/`planning_model`/`implementation_model` (e.g. `gpt-5.4`).
168+
- 🔐 **Secrets hygiene.** `.gitignore` now covers `*.secrets.yaml`, `*.secrets.yml`, `secrets.json`, `*credentials*.json`, `.env`, `.env.*` (with `*.env.example` whitelisted). `mcp_agent.secrets.yaml` was also `git rm --cached`'d so existing checkouts stop tracking it.
169+
- 📝 **Launch table fixed.** `deepcode` (no flags) actually starts Docker mode — the README now shows `deepcode --local` for the no-Docker path and adds explicit Troubleshooting rows for "Docker is installed but not running", Windows GBK encoding, and the issues fixed above.
170+
- 🧹 **Misc:** auto-create `logs/` directory so JSONL logging never fails on a fresh checkout, replace bare `except:` with `except Exception:` in `agent_orchestration_engine.py` (Ruff E722), `command_executor` MCP tool descriptions now embed the host OS so the LLM picks compatible commands.
171+
172+
---
173+
162174
🎉 **[2026-02] nanobot ✖️ DeepCode. Just chat naturally with openclaw/nanobot to handle your coding tasks:**
163175

164176
<div align="center">
@@ -432,7 +444,6 @@ DeepCode leverages the **Model Context Protocol (MCP)** standard to seamlessly i
432444

433445
| 🛠️ **MCP Server** | 🔧 **Primary Function** | 💡 **Purpose & Capabilities** |
434446
|-------------------|-------------------------|-------------------------------|
435-
| **🔍 brave** | Web Search Engine | Real-time information retrieval via Brave Search API |
436447
| **🌐 bocha-mcp** | Alternative Search | Secondary search option with independent API access |
437448
| **📂 filesystem** | File System Operations | Local file and directory management, read/write operations |
438449
| **🌐 fetch** | Web Content Retrieval | Fetch and extract content from URLs and web resources |
@@ -651,6 +662,23 @@ pip install -r requirements.txt
651662
npm install --prefix new_ui/frontend
652663
```
653664

665+
##### 🧪 **Editable install (lets `deepcode` always run THIS checkout)**
666+
667+
If you want the global `deepcode` command to launch the source tree you are
668+
hacking on, install the project in editable mode after the steps above:
669+
670+
```bash
671+
pip install -e .
672+
```
673+
674+
This registers a `deepcode-hku` package (current version 1.2.0) and exposes
675+
the `deepcode` CLI entry point. Any local code change is picked up
676+
immediately on next launch — no reinstall needed.
677+
678+
> If you maintain multiple DeepCode checkouts, only one of them can own the
679+
> `deepcode` command at a time (the most recent `pip install -e .` wins).
680+
> Reinstall in the checkout you currently want to be active.
681+
654682
</details>
655683

656684
### 🔧 **Step 2: Configuration**
@@ -674,6 +702,37 @@ google:
674702
api_key: "your_google_api_key" # For Gemini models
675703
```
676704
705+
<details>
706+
<summary><strong>🔌 Using OpenAI-compatible providers (OpenRouter / Poe / DashScope / etc.)</strong></summary>
707+
708+
The `openai` block accepts any OpenAI-compatible endpoint. Just override
709+
`base_url`. Then in `mcp_agent.config.yaml` set the model name your provider
710+
expects (the `default_model`, `planning_model`, and `implementation_model`
711+
fields under the `openai:` section).
712+
713+
```yaml
714+
# mcp_agent.secrets.yaml
715+
openai:
716+
api_key: "your_provider_api_key"
717+
base_url: "https://api.poe.com/v1" # Poe
718+
# base_url: "https://openrouter.ai/api/v1" # OpenRouter
719+
# base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1" # Alibaba DashScope
720+
```
721+
722+
```yaml
723+
# mcp_agent.config.yaml — pick the model your provider supports
724+
openai:
725+
default_model: "gpt-5.4"
726+
planning_model: "gpt-5.4"
727+
implementation_model: "gpt-5.4"
728+
```
729+
730+
> **🔐 Never commit `mcp_agent.secrets.yaml`.** The provided `.gitignore`
731+
> excludes it, but if you cloned an older snapshot, also run
732+
> `git rm --cached mcp_agent.secrets.yaml` before your next push.
733+
734+
</details>
735+
677736
#### 🤖 LLM Provider *(optional)*
678737

679738
Edit `mcp_agent.config.yaml` to choose your preferred LLM provider (line ~106):
@@ -689,12 +748,7 @@ llm_provider: "google"
689748
Configure web search in `mcp_agent.config.yaml`:
690749

691750
```yaml
692-
# For Brave Search (default) — set in brave.env section (line ~28)
693-
brave:
694-
env:
695-
BRAVE_API_KEY: "your_brave_api_key_here"
696-
697-
# For Bocha-MCP (alternative) — set in bocha-mcp.env section (line ~74)
751+
# For Bocha-MCP (optional) — set in bocha-mcp.env section
698752
bocha-mcp:
699753
env:
700754
BOCHA_API_KEY: "your_bocha_api_key_here"
@@ -717,7 +771,6 @@ If you're using Windows, you may need to configure MCP servers manually in `mcp_
717771

718772
```bash
719773
# 1. Install MCP servers globally
720-
npm i -g @modelcontextprotocol/server-brave-search
721774
npm i -g @modelcontextprotocol/server-filesystem
722775
723776
# 2. Find your global node_modules path
@@ -729,9 +782,6 @@ Then update your `mcp_agent.config.yaml` to use absolute paths:
729782
```yaml
730783
mcp:
731784
servers:
732-
brave:
733-
command: "node"
734-
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
735785
filesystem:
736786
command: "node"
737787
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
@@ -744,28 +794,20 @@ mcp:
744794
<details>
745795
<summary><strong>🔍 Search Server Configuration (Optional)</strong></summary>
746796

747-
DeepCode supports multiple search servers for web search functionality. You can configure your preferred option in `mcp_agent.config.yaml`:
797+
DeepCode supports optional Bocha search plus built-in `fetch` for web content retrieval:
748798

749799
```yaml
750800
# Default search server configuration
751-
# Options: "brave" or "bocha-mcp"
752-
default_search_server: "brave"
801+
# Option: "bocha-mcp"
802+
default_search_server: "bocha-mcp"
753803
```
754804

755805
**Available Options:**
756-
- **🔍 Brave Search** (`"brave"`): Default option with high-quality search results. Requires `BRAVE_API_KEY`. Recommended for most users.
757806
- **🌐 Bocha-MCP** (`"bocha-mcp"`): Alternative search server. Requires `BOCHA_API_KEY`. Uses local Python server implementation.
758807

759808
**Full MCP server configuration in mcp_agent.config.yaml:**
760809
```yaml
761-
# For Brave Search (default) - around line 28
762-
brave:
763-
command: "npx"
764-
args: ["-y", "@modelcontextprotocol/server-brave-search"]
765-
env:
766-
BRAVE_API_KEY: "your_brave_api_key_here"
767-
768-
# For Bocha-MCP (alternative) - around line 74
810+
# For Bocha-MCP (optional)
769811
bocha-mcp:
770812
command: "python"
771813
args: ["tools/bocha_search_server.py"]
@@ -785,7 +827,7 @@ Choose your preferred launch method:
785827
<table width="100%">
786828
<tr>
787829
<th width="33%">🐳 Docker (Recommended)</th>
788-
<th width="33%">🚀 Local (<code>deepcode</code> command)</th>
830+
<th width="33%">🚀 Local — no Docker</th>
789831
<th width="33%">🛠️ Other Methods</th>
790832
</tr>
791833
<tr><td>
@@ -803,29 +845,35 @@ cp mcp_agent.secrets.yaml.example \
803845
# Access → http://localhost:8000
804846
```
805847

848+
> Plain `deepcode` (no flags) is equivalent to launching this Docker
849+
> path. It will fail with `Docker is installed but not running` if
850+
> Docker Desktop isn't started — use the `--local` mode on the right
851+
> in that case.
852+
806853
</td><td>
807854

808-
Auto-installs deps on first run.
855+
Run the new UI directly on the host (frontend + backend, no container).
809856

810857
```bash
811-
deepcode
858+
deepcode --local
812859
# Frontend → http://localhost:5173
813860
# Backend → http://localhost:8000
814861
# Ctrl+C to stop
815862
```
816863

817-
Features: User-in-Loop, real-time progress, inline chat.
864+
Features: User-in-Loop, real-time progress, inline chat. Use this when
865+
Docker isn't available or you need to iterate on local source changes.
818866

819867
</td><td>
820868

821869
```bash
822870
# macOS / Linux
823871
./run.sh
824-
# or: python deepcode.py
872+
# or: python deepcode.py --local
825873
826874
# Windows
827875
run.bat
828-
# or: python deepcode.py
876+
# or: python deepcode.py --local
829877
830878
# Classic Streamlit UI
831879
deepcode --classic
@@ -878,11 +926,14 @@ docker compose -f deepcode_docker/docker-compose.yml logs -f # Logs
878926
| Problem | Cause | Fix |
879927
|---|---|---|
880928
| Docker build fails with `tsc: not found` | Corrupted build cache | `docker builder prune -f` then rebuild with `--no-cache` |
881-
| `error during connect` / `cannot find the file` | Docker Desktop not running | Start Docker Desktop, wait until ready, retry |
929+
| `error during connect` / `cannot find the file` / `Docker is installed but not running` | Docker Desktop not running | Either start Docker Desktop, **or** skip Docker entirely with `deepcode --local` |
882930
| Frontend blank page | Corrupted `node_modules` | `cd new_ui/frontend && rm -rf node_modules && npm install` |
883-
| `ERR_CONNECTION_REFUSED` | Wrong port / backend not running | Docker: `http://localhost:8000`. Local: `http://localhost:5173` |
931+
| `ERR_CONNECTION_REFUSED` | Wrong port / backend not running | Docker: `http://localhost:8000`. Local (`--local`): frontend `http://localhost:5173`, backend `http://localhost:8000` |
884932
| `npm install` → `Could not read package.json` | Wrong directory | Use `npm install --prefix new_ui/frontend` |
885933
| Windows: MCP servers not working | Need absolute paths | See [Windows MCP Configuration](#-step-2-configuration) above |
934+
| Windows: `UnicodeEncodeError: 'gbk' codec can't encode...` on launch | Default GBK console can't render emoji in startup banner | Set UTF-8 first: `set PYTHONIOENCODING=utf-8 && set PYTHONUTF8=1` (cmd) or `$env:PYTHONIOENCODING="utf-8"; $env:PYTHONUTF8="1"` (PowerShell) |
935+
| Windows: code-implementation stage hangs / produces a `-p` directory | LLM emitted `mkdir -p ...` and `cmd.exe` treated `-p` as a folder name | Already fixed in `tools/command_executor.py` — common Unix commands (`mkdir -p`, `touch`, `rm -rf`, `cp -r`, `mv`) are now executed natively via `pathlib`/`shutil`, no shell needed |
936+
| `name 'LoopDetector' is not defined` during code implementation | Missing import in workflow modules | Already fixed — `LoopDetector` and `ProgressTracker` are now imported from `utils.loop_detector` in both `workflows/code_implementation_workflow.py` and `workflows/code_implementation_workflow_index.py` |
886937

887938
</details>
888939

README_ZH.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ DeepCode利用**模型上下文协议 (MCP)** 标准与各种工具和服务无
430430

431431
| 🛠️ **MCP服务器** | 🔧 **主要功能** | 💡 **目的和能力** |
432432
|-------------------|-------------------------|-------------------------------|
433-
| **🔍 brave** | Web搜索引擎 | 通过Brave搜索API进行实时信息检索 |
434433
| **🌐 bocha-mcp** | 替代搜索 | 具有独立API访问的辅助搜索选项 |
435434
| **📂 filesystem** | 文件系统操作 | 本地文件和目录管理,读/写操作 |
436435
| **🌐 fetch** | Web内容检索 | 从URL和Web资源获取和提取内容 |
@@ -686,12 +685,7 @@ llm_provider: "google"
686685
在 `mcp_agent.config.yaml` 中配置 Web 搜索:
687686

688687
```yaml
689-
# Brave 搜索 (默认) — 在 brave.env 部分设置 (第 ~28 行)
690-
brave:
691-
env:
692-
BRAVE_API_KEY: "your_brave_api_key_here"
693-
694-
# Bocha-MCP (替代) — 在 bocha-mcp.env 部分设置 (第 ~74 行)
688+
# Bocha-MCP(可选)— 在 bocha-mcp.env 部分设置
695689
bocha-mcp:
696690
env:
697691
BOCHA_API_KEY: "your_bocha_api_key_here"
@@ -714,7 +708,6 @@ document_segmentation:
714708

715709
```bash
716710
# 1. 全局安装 MCP 服务器
717-
npm i -g @modelcontextprotocol/server-brave-search
718711
npm i -g @modelcontextprotocol/server-filesystem
719712
720713
# 2. 找到您的全局 node_modules 路径
@@ -726,9 +719,6 @@ npm -g root
726719
```yaml
727720
mcp:
728721
servers:
729-
brave:
730-
command: "node"
731-
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
732722
filesystem:
733723
command: "node"
734724
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
@@ -741,28 +731,20 @@ mcp:
741731
<details>
742732
<summary><strong>🔍 搜索服务器配置(可选)</strong></summary>
743733

744-
DeepCode 支持多个搜索服务器进行 Web 搜索功能。您可以在 `mcp_agent.config.yaml` 中配置首选选项:
734+
DeepCode 支持可选的 Bocha 搜索,以及内置的 `fetch` 用于网页内容抓取:
745735

746736
```yaml
747737
# 默认搜索服务器配置
748-
# 选项: "brave" 或 "bocha-mcp"
749-
default_search_server: "brave"
738+
# 选项: "bocha-mcp"
739+
default_search_server: "bocha-mcp"
750740
```
751741

752742
**可用选项:**
753-
- **🔍 Brave 搜索** (`"brave"`): 具有高质量搜索结果的默认选项。需要 `BRAVE_API_KEY`。推荐给大多数用户。
754743
- **🌐 Bocha-MCP** (`"bocha-mcp"`): 替代搜索服务器。需要 `BOCHA_API_KEY`。使用本地 Python 服务器实现。
755744

756745
**完整 MCP 服务器配置(mcp_agent.config.yaml):**
757746
```yaml
758-
# Brave 搜索 (默认) - 第 28 行左右
759-
brave:
760-
command: "npx"
761-
args: ["-y", "@modelcontextprotocol/server-brave-search"]
762-
env:
763-
BRAVE_API_KEY: "your_brave_api_key_here"
764-
765-
# Bocha-MCP (替代) - 第 74 行左右
747+
# Bocha-MCP(可选)
766748
bocha-mcp:
767749
command: "python"
768750
args: ["tools/bocha_search_server.py"]

0 commit comments

Comments
 (0)