Skip to content

Graceful handling of vague/incomplete trade requests #12225

@premiumjibles

Description

@premiumjibles

Problem

Vague requests like "sell on every week" cause the agent to either fail with tool errors or hallucinate parameter values. The system prompt has a few narrow clarification rules but no general framework for handling broadly incomplete requests.

tk ticket: sa-xeyj

Root Cause

The system prompt focuses on routing clear intents to tools, not detecting/resolving incomplete intents. No instruction like "if you cannot determine [sell asset, buy asset, amount], ask before calling any tool."

Fix (prompt-only, no tool code changes)

Add a <clarification-rules> section to the system prompt that:

  1. Defines minimum required params per intent (swaps: sell/buy/amount; TWAP: sell/buy/amount/duration; etc.)
  2. Instructs agent to batch all missing params into one clarifying question
  3. Handles common vague patterns with intelligent defaults/suggestions
  4. Never fabricates parameter values

Key Files

  • apps/agentic-server/src/routes/chat.tsbuildSystemPrompt()

Acceptance Criteria

  • Agent asks clarifying questions for "sell on every week"
  • Agent asks for missing amount on "buy some ETH"
  • Agent batches all missing params into one question
  • Clear requests like "swap 1 ETH to USDC" still execute immediately
  • Existing specific clarification rules still work

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions