用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arm2arm/AstroAgentAssistant --skill coding-agent-troubleshooting命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | coding-agent-troubleshooting |
| description | Use when Claude Code, Codex, or OpenCode fail to connect. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| platforms | ["linux","macos","windows"] |
Diagnose issues when connecting external coding agents to API endpoints. Covers format mismatches, vLLM quirks, smoke testing, and installation problems.
Claude Code requires Anthropic's API format (POST /v1/messages). OpenAI-compatible endpoints (OpenAI API, vLLM, LiteLLM) use POST /v1/chat/completions. They are NOT interchangeable.
Signs: claude commands fail with connection/auth errors even though the endpoint works for other clients.
Fix: Run a proxy like LiteLLM that translates between formats:
pip install litellm
litellm --model openai/<model_name> --host <vllm-endpoint> --port 4000
# Point claude at: ANTHROPIC_BASE_URL=http://127.0.0.1:4000
When vLLM serves a reasoning-capable model, output may go to the reasoning field instead of content:
{
"message": {
"content": null, // ← Claude Code reads this — EMPTY
"reasoning": "Here's a thinking process..." // ← Output goes here
}
}
Signs: Agent connects, responds, but returns empty/no output. The content field is null while reasoning contains text.
Diagnose:
curl -s http://ENDPOINT/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"MODEL","messages":[{"role":"user","content":"Reply with: TEST_OK"}],"max_tokens":20}' \
| python3 -c "import json,sys; d=json.load(sys.stdin); print(repr(d['choices'][0]['message'].get('content')))"
If output is None, the server misroutes output.
Fix on vLLM:
# Add to vLLM startup args
--disable-reasoning
Global npm install often fails in restricted environments.
Fallback:
npm install -g @anthropic-ai/claude-code --prefix ~/.local
# Binary at: ~/.local/bin/claude
OpenCode requires providers to be configured. opencode models lists available providers:
opencode auth list # check configured providers
opencode providers # manage providers
For custom OpenAI-compatible endpoints:
# Usually via OPENAI_API_BASE / OPENAI_API_KEY env vars
# Or add provider: opencode providers add <name> --url <endpoint> --key <key>
Before deploying any coding agent, run these checks:
# 1. Models endpoint responds
curl -s http://ENDPOINT/v1/models | python3 -c "import json,sys; d=json.load(sys.stdin); print('Models:', [m['id'] for m in d.get('data',[])])"
# 2. Chat completions works AND content field is populated
curl -s http://ENDPOINT/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"MODEL","messages":[{"role":"user","content":"Reply with: SMOKE_OK"}],"max_tokens":20}' \
| python3 -c "
import json,sys
d=json.load(sys.stdin)
content = d['choices'][0]['message'].get('content','')
if content == 'SMOKE_OK':
print('PASS: endpoint working correctly')
elif content == '' or content is None:
print('FAIL: content field empty — check vLLM reasoning config')
else:
print(f'GOT: {repr(content)}')
"
claude --version # Claude Code
opencode --version # OpenCode
codex --version # Codex (if installed)
| Agent | Best For | Format Needed | Sandbox |
|---|---|---|---|
| Claude Code | Complex refactoring, multi-turn, PR review | Anthropic (/v1/messages) | --dangerously-skip-permissions |
| Codex | One-shot fixes, clean git repos | OpenAI (/v1/chat/completions) | --sandbox workspace-write |
| OpenCode | Provider-agnostic, TUI sessions | OpenAI (/v1/chat/completions) | Manual |
content field.--prefix ~/.local fallback ready.opencode providers to add.