Problem
The amount regex misses commas ($1,200 captures "1" → resolves a $1,200 request as $1) and only scans the body, missing subject-stated amounts.
Where
lib/agent.ts (/\$\s?(\d+(?:\.\d{1,2})?)/ + parseFloat, body-only scan).
Acceptance
Add a failing test first asserting triage("x", "refund $1,200 please") yields refundAmount 1200 and subject-stated amounts are picked up. Then fix.
Problem
The amount regex misses commas (
$1,200captures"1"→ resolves a $1,200 request as $1) and only scans the body, missing subject-stated amounts.Where
lib/agent.ts(/\$\s?(\d+(?:\.\d{1,2})?)/+parseFloat, body-only scan).Acceptance
Add a failing test first asserting
triage("x", "refund $1,200 please")yieldsrefundAmount1200 and subject-stated amounts are picked up. Then fix.