Skip to content

Agent calls checkWalletCapabilities AND explains instead of just executing #12215

@premiumjibles

Description

@premiumjibles

Problem

When a user asks to "automate a trade" (e.g. "set up a DCA for ETH over 7 days"), the agent calls both checkWalletCapabilities AND the trade tool (e.g. createTwap), then also explains what automation means — producing a confusing triple response.

tk ticket: sa-gwnv

Root Cause

The checkWalletCapabilities tool description is too broad — it says to call the tool "when the user asks about automated trading features (TWAP, DCA, stop-loss, scheduled trades)" which competes with the specific trade creation tools for the same intents. The system prompt says to pick a single tool, but the LLM sees both as relevant.

Fix (2 files)

  1. apps/agentic-server/src/tools/checkWalletCapabilities.ts — narrow the tool description to only trigger for capability inquiries, not trade execution requests
  2. apps/agentic-server/src/routes/chat.ts — strengthen <tool-routing> and <tool-ui> sections to disambiguate

Acceptance Criteria

  • "Set up a DCA for 100 USDC into ETH" calls only createTwap, not checkWalletCapabilities
  • "What can my wallet do?" still calls checkWalletCapabilities
  • After successful trade creation, agent responds with one brief sentence

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions