Complete the MCP tool call chain: - contractor-agent bridge exposes /mcp/execute endpoint for tool callbacks - openclaw-mcp-server.mjs proxies OpenClaw tool defs to Claude as MCP tools - sdk-adapter passes --mcp-config on first turn with all OpenClaw tools - tool-test plugin registers contractor_echo in globalThis tool handler map - agent-config-writer auto-sets tools.profile=full so OpenClaw sends tool defs - Fix --mcp-config arg ordering: prompt must come before <configs...> flag Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
ContractorAgent Plan
Project Goal
Build an OpenClaw plugin that turns Claude Code into an OpenClaw-managed contractor agent.
Phase 1: Claude only. Gemini deferred.
Product Direction
OpenClaw manages agent identity, routing, workspace, and session ownership. Claude Code manages the live conversational and task context for its own session. The plugin bridges the two without duplicating context management.
See ARCHITECTURE.md for component design. See IMPLEMENTATION.md for file structure and build order. See BRIDGE_MODEL_FINDINGS.md for probe test results that confirm the design.
Phase 1 Scope
In scope
- Claude contractor agent provisioning via plugin-owned CLI
contractor-claude-bridgemodel: OpenAI-compatible sidecar that proxies OpenClaw turns into Claude Code sessions- Session map: persistent mapping of OpenClaw session keys to Claude session UUIDs
- Input filter: strip OpenClaw system prompt, extract latest user message, inject one-time bootstrap
- SSE streaming: bridge sidecar must stream Claude output back as SSE
- Install script: writes provider config to
openclaw.json, registers plugin
Out of scope for now
- Gemini implementation
- Full OpenClaw tool bridging to Claude
- Advanced recovery and replay semantics
- UI polish and operational tooling
Open Questions
What is the implementation seam for the bridge model?Resolved —openclaw.jsonprovider entry pointing to a local OpenAI-compatible sidecar. No plugin SDK model registration API. See BRIDGE_MODEL_FINDINGS.md.- How should contractor metadata be persisted — agent runtime stanza, plugin config, or both?
What is the canonical identifier for Claude session continuation?Resolved — UUID returned asmessage.session_idfrom the Claude Agent SDK. Resume viaoptions.resume. See BRIDGE_MODEL_FINDINGS.md.- Which minimal OpenClaw tools should be exposed first to Claude? (deferred to later)
- How should
/resetand/newmap to Claude-side session recreation?
Next Steps
Verify bridge model registration mechanismDoneVerify Claude session continuation identifierDone- Build bridge sidecar with SSE streaming and Claude SDK dispatch
- Implement input filter and session map store
- Add bootstrap injection and recovery
- Implement CLI (
openclaw contractor-agents add) - Write install script