- normalizeAnswers() handles both object {"q":"a"} and array [{pattern,answer}]
formats — prevents silent failures when answers.json format varies
- getLabel() now strips "Required" suffix before dedup, uses smarter
prefix-repeat detection instead of simple half-split
- telegram_answers.mjs also normalizes on load
- Cleaned existing answers.json on AWS: removed duplicated text in patterns,
fixed bad AI answer for "Current company", generalized Geotab-specific patterns
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- New lib/telegram_answers.mjs: shared module that polls Telegram getUpdates,
matches replies to needs_answer jobs, saves to answers.json, flips job to new
- telegram_poller.mjs: lightweight cron script (every minute via OpenClaw)
- Applier also processes replies at start of each run as safety net
- sendTelegram now returns message_id, stored on job for reply matching
- User replies "ACCEPT" to use AI answer, or types their own
- Answers persist in answers.json and apply to ALL future jobs
- Also includes: selectOptionFuzzy, multiple dialog handling, browser
recovery, answers reload, per-job timeout bump to 10min
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>