mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +08:00
- Set up VitePress with bilingual support (Chinese root + English /en/) - Create unified sidebar navigation with all doc sections - Add custom Anthropic brand theme (#D97757) - Create Quick Start pages (zh/en) from README content - Migrate 7 .en.md files to docs/en/ directory structure - Translate memory/agent/skills docs to English (9 files) - Generate English-only architecture diagrams (11 images via PicTactic) - Copy English-ready images for agent/skills sections (21 images) - Configure custom domain (claudecodehaha.relakkesyang.org) - Localize Chinese UI labels (sidebar, outline, footer) - Add documentation site badge to READMEs - Fix dead links and update cross-references for VitePress Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
1.5 KiB
Markdown
35 lines
1.5 KiB
Markdown
# 常见问题
|
||
|
||
|
||
## Q: `undefined is not an object (evaluating 'usage.input_tokens')`
|
||
|
||
**原因**:`ANTHROPIC_BASE_URL` 配置不正确,API 端点返回的不是 Anthropic 协议格式的 JSON,而是 HTML 页面或其他格式。
|
||
|
||
本项目使用 **Anthropic Messages API 协议**,`ANTHROPIC_BASE_URL` 必须指向一个兼容 Anthropic `/v1/messages` 接口的端点。Anthropic SDK 会自动在 base URL 后面拼接 `/v1/messages`,所以:
|
||
|
||
- MiniMax:`ANTHROPIC_BASE_URL=https://api.minimaxi.com/anthropic` ✅
|
||
- OpenRouter:`ANTHROPIC_BASE_URL=https://openrouter.ai/api` ✅
|
||
- OpenRouter 错误写法:`ANTHROPIC_BASE_URL=https://openrouter.ai/anthropic` ❌(返回 HTML)
|
||
|
||
如果你的模型供应商只支持 OpenAI 协议,需要通过 LiteLLM 等代理做协议转换,详见 [第三方模型使用指南](./third-party-models.md)。
|
||
|
||
## Q: `Cannot find package 'bundle'`
|
||
|
||
```
|
||
error: Cannot find package 'bundle' from '.../claude-code-haha/src/entrypoints/cli.tsx'
|
||
```
|
||
|
||
**原因**:Bun 版本过低,不支持项目所需的 `bun:bundle` 等内置模块。
|
||
|
||
**解决**:升级 Bun 到最新版本:
|
||
|
||
```bash
|
||
bun upgrade
|
||
```
|
||
|
||
## Q: 怎么接入 OpenAI / DeepSeek / Ollama 等非 Anthropic 模型?
|
||
|
||
本项目只支持 Anthropic 协议。如果模型供应商不直接支持 Anthropic 协议,需要用 [LiteLLM](https://github.com/BerriAI/litellm) 等代理做协议转换(OpenAI → Anthropic)。
|
||
|
||
详细配置步骤请参考:[第三方模型使用指南](./third-party-models.md)
|