Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

fix: correct Paytm and Tatkal adapter safety

Barack Sokullu9a149dc9cd66
diff --git a/src/chrome/src/agent/adapters.js b/src/chrome/src/agent/adapters.js
index adafd985a..85182997e 100644
--- a/src/chrome/src/agent/adapters.js
+++ b/src/chrome/src/agent/adapters.js
@@ -17649,13 +17649,13 @@ const ADAPTERS = [
notes: `
- IRCTC (irctc.co.in) is Indian Railways ticketing. Login ("LOGIN") needs username/password + CAPTCHA; booking also needs passenger details (name, age, berth preference) and an explicit user confirm before "Book Now".
- Search with station CODES (e.g. NDLS, BCT, HWH) in "From"/"To", journey date, and quota ("General", "Tatkal", "Ladies"). Sort/filter by class (SL/3A/2A/1A/CC) and train type; availability colours (Available/RAC/WL + number) are per class β€” read the exact class row before quoting.
-- Tatkal trap: Tatkal opens ~24h before departure (AC ~10:00, non-AC ~11:00 IST) and sells out in minutes. Do NOT promise a Tatkal berth without checking live availability at booking time.
+- Tatkal trap: booking opens at 10:00 IST for AC classes and 11:00 IST for non-AC classes on the calendar day before the train's departure date at its originating station. Do not calculate from a later boarding-station date; check live availability before promising a berth.
- PNR/status trap: "PNR Status" is a separate flow from booking history ("Booked Ticket History"). Cancel via "Cancel Ticket" with confirmation; partial-cancel needs per-passenger selection.
- Never submit payment or final booking without the user confirming train number, class, date, quota, and passenger list. Success = PNR on the booking-confirmation page.`,
},
{
name: 'paytm',
- category: 'general',
+ category: 'finance',
matches: (url) => /^https?:\/\/(www\.)?paytm\.com\//.test(url),
notes: `
- Paytm is Indian recharge/bills/UPI/payments. Top flows: Mobile Recharge, DTH, Electricity, Gas, Broadband, Credit-card bill. Pick the operator/circle (e.g. "Airtel Prepaid", state electricity board) BEFORE entering the number β€” plans and bill-fetch depend on it.
diff --git a/src/firefox/src/agent/adapters.js b/src/firefox/src/agent/adapters.js
index 2fba047e7..360818bcc 100644
--- a/src/firefox/src/agent/adapters.js
+++ b/src/firefox/src/agent/adapters.js
@@ -17647,13 +17647,13 @@ const ADAPTERS = [
notes: `
- IRCTC (irctc.co.in) is Indian Railways ticketing. Login ("LOGIN") needs username/password + CAPTCHA; booking also needs passenger details (name, age, berth preference) and an explicit user confirm before "Book Now".
- Search with station CODES (e.g. NDLS, BCT, HWH) in "From"/"To", journey date, and quota ("General", "Tatkal", "Ladies"). Sort/filter by class (SL/3A/2A/1A/CC) and train type; availability colours (Available/RAC/WL + number) are per class β€” read the exact class row before quoting.
-- Tatkal trap: Tatkal opens ~24h before departure (AC ~10:00, non-AC ~11:00 IST) and sells out in minutes. Do NOT promise a Tatkal berth without checking live availability at booking time.
+- Tatkal trap: booking opens at 10:00 IST for AC classes and 11:00 IST for non-AC classes on the calendar day before the train's departure date at its originating station. Do not calculate from a later boarding-station date; check live availability before promising a berth.
- PNR/status trap: "PNR Status" is a separate flow from booking history ("Booked Ticket History"). Cancel via "Cancel Ticket" with confirmation; partial-cancel needs per-passenger selection.
- Never submit payment or final booking without the user confirming train number, class, date, quota, and passenger list. Success = PNR on the booking-confirmation page.`,
},
{
name: 'paytm',
- category: 'general',
+ category: 'finance',
matches: (url) => /^https?:\/\/(www\.)?paytm\.com\//.test(url),
notes: `
- Paytm is Indian recharge/bills/UPI/payments. Top flows: Mobile Recharge, DTH, Electricity, Gas, Broadband, Credit-card bill. Pick the operator/circle (e.g. "Airtel Prepaid", state electricity board) BEFORE entering the number β€” plans and bill-fetch depend on it.
diff --git a/test/run.js b/test/run.js
index 6d1d8d977..aa7662b65 100644
--- a/test/run.js
+++ b/test/run.js
@@ -10226,6 +10226,21 @@ test('report-driven adapter notes remain bounded and do not overfit low-evidence
assert.equal(getActiveAdapter('https://naukrigulf.com.evil.example/job/1'), null);
});
+test('India payment and Tatkal guidance keeps finance and opening-time safety signals', () => {
+ for (const getAdapter of [getActiveAdapter, getActiveAdapterFx]) {
+ const paytm = getAdapter('https://paytm.com/recharge');
+ assert.equal(paytm?.name, 'paytm');
+ assert.equal(paytm?.category, 'finance');
+
+ const irctc = getAdapter('https://www.irctc.co.in/nget/train-search');
+ assert.equal(irctc?.name, 'irctc');
+ assert.match(irctc?.notes || '', /10:00 IST for AC classes/);
+ assert.match(irctc?.notes || '', /11:00 IST for non-AC classes/);
+ assert.match(irctc?.notes || '', /departure date at its originating station/);
+ assert.doesNotMatch(irctc?.notes || '', /~24h before departure/);
+ }
+});
+
test('adapter-match trace metadata is content-free, queued before tracing, and de-duplicated per run', () => {
for (const [label, AgentClass] of [['chrome', AgentCh], ['firefox', AgentFx]]) {
const agent = new AgentClass({});