Foreword¶
DeepSeek Harness (DSH) adopts a plug-in architecture. Integrating Zhipu BigModel capabilities (search, reading, vision) typically requires fragmented configuration. dsh-zhipu consolidates these capabilities into a single plugin and provides a unified entry point through one ZAI_API_KEY, serving DSH’s web and headless profiles.
Core Features¶
The plugin provides the following capabilities:
- Web Search: Integrates
web_search_primeMCP and supports thezhipu-primeengine. - Web Page Reading: Integrates
webReaderMCP with server-side rendering (SSR) support, without directly accessing target URLs. - Visual Understanding: Provides the
vision_analyzetool based on the GLM-4.6V model. - Image Attachment Recognition: Uses the
agent/pre-stephook to automatically convert image attachments in conversations into text descriptions.
Installation and Enablement¶
Use the following command to install the plugin:
dsh plugin --profile web add github:<you>/dsh-zhipu
After installation, add the package name to the profile’s bundle list (for example ~/.dsh/profiles/web/package.json):
"dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-zhipu"] } }
The plugin automatically configures the search, reading, and vision tools via cordis.patch.yml. Restart the dsh web process to apply the changes.
Prior Configuration¶
- API Key: Ensure that
ZAI_API_KEYis configured in~/.dsh/.env(the key for Zhipu GLM Coding Plan). - Image Input Declaration: In
~/.dsh/settings.yaml, declare image input support for the chat model; otherwise, the attachment hook cannot intervene:
llm-pi-ai:
providers:
zai-coding-cn:
models:
- id: glm-5.3
input: [text, image] # 关键配置
Feature Description¶
- Search and Reading:
- Outbound requests point only to
open.bigmodel.cn. - Search results come from the same source as the official search and cannot be directly cited as facts.
- The
web_fetchtool retrieves target page content, and URLs are recorded on the Zhipu side.
- Outbound requests point only to
- Visual Analysis:
- The vision feature must use the Coding Plan endpoint (default
codingBaseURL); pay-as-you-go endpoints return 429 errors. content[0].textin MCP responses has a double JSON encoding issue; the plugin includes fault-tolerant handling.
- The vision feature must use the Coding Plan endpoint (default
- Image Attachment Recognition:
- The hook converts images into text descriptions and replaces the original image block.
- Descriptions prefixed with
attachmentIdare the single source of truth in the session log. - If the description fails, the original image block is retained (honest failure).
Configuration Override¶
You can override cordis.patch.yml to adjust behavior:
# ~/.dsh/profiles/<name>/cordis.patch.yml
- id: zhipu
config:
apiKeyEnv: ZAI_API_KEY
enableTool: false # 关闭 vision_analyze
enablePreStep: false # 关闭贴图钩子
passthroughModels: [] # 原生吃图的模型列表
Data and Known Behaviors¶
- Outbound Data: Search terms, target URLs, and image bytes (base64) are sent to
open.bigmodel.cn; image bytes are not written to disk and do not appear in session logs. - Search Limitation: The
search_proengine ignores thecountparameter and always returns 10 results, truncated bymaxResultsand marked withtruncated: true. - Session Recovery: Old sessions containing images may report errors under text-only models; use
vision_analyzewithattachmentIdto re-analyze them.
Development and Testing¶
A test script is provided to verify functionality (approximately 3 credits consumed):
node "$env:USERPROFILE\.dsh\plugins\dsh-zhipu\test\smoke.mjs" web
After modifying the code, delete the old node_modules and reinstall to trigger an update.