Graceful handling of vague/incomplete trade requests

Open Beginner friendly
#226 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
ai, backend

Research direction

Start in apps/agentic-server/src/routes/chat.ts and read buildSystemPrompt() alongside the existing clarification rules. Add the requested clarification-rules section without changing tool code, then verify the listed vague, incomplete, batched, clear-request, and existing-rule acceptance cases.

Written by the indexing model from the issue text.

Description

Feature

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
Dominant language
TypeScript
Stars
3
Forks
2
Avg merge
13m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from shapeshift/agentic-chat

All issues in shapeshift/agentic-chat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.