Skip to content

feat: Add OpenClaw tool mappings and missing CC tools - #19

Merged
askalf merged 1 commit into
askalf:masterfrom
earlvanze:master
Apr 13, 2026
Merged

askalf merged 1 commit into
askalf:masterfrom
earlvanze:master

Conversation

@earlvanze

Copy link
Copy Markdown
Contributor

Summary

This PR adds missing Claude Code tool definitions and OpenClaw-specific tool mappings to enable full tool compatibility when routing requests through Dario.

Changes

New Tool Definitions (cc-template-data.json)

  • Browser - Browser control for web automation
  • TodoRead - Read todo list
  • NotebookRead - Read Jupyter notebooks
  • MCPListTools - List MCP server tools
  • MCPCallTool - Call MCP server tools
  • TaskCreate - Create tasks
  • TaskUpdate - Update tasks

New Tool Mappings (cc-template.ts)

Added mappings for OpenClaw tools:

  • browser → Browser
  • message → AskUserQuestion
  • todo_read/write → TodoRead/TodoWrite
  • mcp_list/call → MCPListTools/MCPCallTool
  • mcp_list_tools/mcp_call_tool → MCPListTools/MCPCallTool
  • task_create/update → TaskCreate/TaskUpdate
  • enter/exit_plan_mode → EnterPlanMode/ExitPlanMode
  • enter/exit_worktree → EnterWorktree/ExitWorktree

Motivation

When OpenClaw routes requests through Dario to Claude Code, tool calls like browser, message, process, etc. were being stripped or misrouted because the CC template only had 11 tool definitions while Claude Code supports 25+. This caused a mismatch between the system prompt (which mentions all tools) and the actual tool list sent to Claude.

Testing

Tested with OpenClaw smart-router → Dario → Claude Code flow. Tool calls now work correctly for all mapped tools.

Related

Fixes tool call parsing mismatch reported in OpenClaw deployments using Dario as the Claude provider.

- Added Browser, TodoRead, NotebookRead, MCPListTools, MCPCallTool, TaskCreate, TaskUpdate tool definitions
- Added OpenClaw tool mappings: browser, message, todo_read/write, mcp_list/call, task_create/update, plan_mode, worktree
- Enables full tool compatibility for OpenClaw → Dario → Claude Code routing
@earlvanze
earlvanze requested a review from askalf as a code owner April 13, 2026 02:23
@askalf
askalf merged commit f853744 into askalf:master Apr 13, 2026
5 checks passed
@askalf

askalf commented Apr 13, 2026 •

Copy link
Copy Markdown
Owner

Follow-up cleanup after merge

After merging this PR, a cleanup pass was done on master covering the changes below.

Tool template reverted to captured snapshot

The tool definitions added here (Browser, TodoRead, NotebookRead, MCPListTools, MCPCallTool, TaskCreate, TaskUpdate) were hand-written and not part of the real Claude Code v2.1.104 wire capture that cc-template-data.json is meant to preserve. Mixing synthetic tools into the captured snapshot breaks the byte-level fidelity guarantee that the template exists to provide, and leaves a mismatch between the system prompt's advertised tool set and what real CC actually sends.

  • Dropped all seven synthetic tool definitions from cc-template-data.json — tools[], tool_names[], system_prompt, and agent_identity are now byte-identical to the pre-PR19 snapshot
  • Redirected TOOL_MAP aliases to real CC tools already in the template: browser → WebFetch, message → AskUserQuestion, todo_read → TodoWrite, notebook_read → NotebookEdit
  • Dropped aliases with no sensible real-tool target (mcp_list, mcp_call, mcp_list_tools, mcp_call_tool, task_create, task_update) so they fall through to the unmapped-tool distributor

The useful half of this PR — the client-tool alias entries in TOOL_MAP for OpenClaw-style names (browser, message, todo_read/write, enter/exit_plan_mode, enter/exit_worktree) — is preserved and all aliases now resolve to tools that actually exist in the captured template.

CLI backend removed

Removed --cli mode and all supporting code. Routing requests through claude --print proved unreliable — no tool use support, streaming conversion artifacts, and context handling that diverged from real API behavior in multi-turn conversations. Direct API mode with template replay is the only path that works consistently.

Removed from proxy.ts: handleViaCli(), jsonToSse(), jsonToOpenaiSse(), sendCliResponse(), cliAvailable, useCli, cliBackend, and all CLI routing/fallback branches.

Internal codenames scrubbed

Removed internal implementation names from source comments that have no value for public contributors — specifically the seed constant name and the build-tag algorithm name from the billing tag code.

Orchestration tag list trimmed

Removed skill_content, skill_files, and available_skills from ORCHESTRATION_TAG_NAMES. These are internal tag names not produced by any public agent framework.

Tool mapping comment updated

// OpenClaw tool mappings changed to // Additional client tool mappings — the mappings added in this PR cover more than just OpenClaw clients.

README rewritten

Full rewrite for v3.4 accuracy: corrected line count, documented the billing tag algorithm and full beta set, added askalf segue with feature comparison table, removed stale content.

@askalf

askalf commented Apr 13, 2026

Copy link
Copy Markdown
Owner

Hey @earlvanze — small thing unrelated to the PR itself. I noticed your commit on master isn't linking to your GitHub profile in the contributors graph, which means you're not currently showing up on https://github.com/askalf/dario/graphs/contributors even though you authored one of the merged changes.

The cause: your commit's author email is earl@vanze.co, and that email isn't on the verified-emails list for your GitHub account. GitHub's commit-to-user linking works strictly by email match, so without that, the commit stays attributed to a plain-text name instead of linking to @earlvanze.

Fix is a one-time thing on your side:

  1. Go to https://github.com/settings/emails
  2. Add earl@vanze.co
  3. Click the verification link GitHub mails you

Once verified, GitHub retroactively re-links every historical commit with that email — usually within a few hours, sometimes up to a day. Your commit here will then get the attribution it should have had from the start.

No action needed from my side — just flagging so you don't miss the credit you're owed on this one.

@earlvanze

earlvanze commented Apr 13, 2026 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants