feat/plugin-services-restructure #1
@@ -430,7 +430,33 @@ const args = [
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 14.9 OpenClaw 工具执行:MCP proxy 的"全局注册表"模式
|
### 14.9 Claude Code 有自己的身份系统提示,与 SOUL.md 冲突轻微
|
||||||
|
|
||||||
|
**情况**:Claude Code 的内置 system prompt 第一句是 `"You are Claude Code, Anthropic's official CLI for Claude."`。当 contractor bridge 通过 `-p` 传入 bootstrap(user turn),并让 Claude 读取 SOUL.md 时,存在身份层次冲突:
|
||||||
|
|
||||||
|
```
|
||||||
|
[SYSTEM] You are Claude Code... ← Claude Code 内置
|
||||||
|
[USER] You are a contractor agent... ← 我们的 bootstrap
|
||||||
|
Please embody SOUL.md...
|
||||||
|
```
|
||||||
|
|
||||||
|
**结论**:冲突轻微且可绕过。实测中 SOUL.md 指令能有效覆盖 Claude Code 的弱身份声明(agent 自称 "Rook ♜" 而非 "Claude Code")。原因是 Claude Code 的身份声明较通用,user-turn 的 bootstrap + SOUL.md Read 优先级足够。
|
||||||
|
|
||||||
|
**更干净的方案**(未实现):用 `--append-system-prompt` 把 contractor 身份推到 system 层:
|
||||||
|
```typescript
|
||||||
|
args.push("--append-system-prompt",
|
||||||
|
`You are operating as contractor agent (${agentId}) in OpenClaw. Embody SOUL.md.`
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
**规则**:
|
||||||
|
- 不要在 contractor workspace 创建 `CLAUDE.md`(Claude Code 会自动注入,与 SOUL.md 产生更强冲突)
|
||||||
|
- SOUL.md/IDENTITY.md 通过 bootstrap 的 Read 指令机制生效即可
|
||||||
|
- Claude Code auto-memory(`~/.claude/projects/.../memory/`)和 OpenClaw memory(`workspace/memory/`)路径不同,并行运行互不干扰
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 14.10 OpenClaw 工具执行:MCP proxy 的"全局注册表"模式
|
||||||
|
|
||||||
**问题**:bridge 运行在 OpenClaw gateway 进程内,但 OpenClaw plugin SDK 没有暴露 `callTool(name, args)` API。要从 bridge 的 `/mcp/execute` 端点调用其他插件注册的工具,没有官方途径。
|
**问题**:bridge 运行在 OpenClaw gateway 进程内,但 OpenClaw plugin SDK 没有暴露 `callTool(name, args)` API。要从 bridge 的 `/mcp/execute` 端点调用其他插件注册的工具,没有官方途径。
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user