agent: add adapter for Ctrip - #2643
Conversation
|
@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
esokullu
left a comment
There was a problem hiding this comment.
Four actionable Ctrip adapter findings:
| - For flights, verify airports, local departure and arrival dates, operating carrier, stops, transfer airports, cabin, baggage "行李" allowance, change/refund rules, and whether separate tickets are involved. Do not compare only the headline fare or assume an overnight arrival is the departure date. | ||
| - For trains, distinguish Ctrip's booking layer from the official 12306 order. Verify train, stations, date, seat class, passenger, service/insurance add-ons, and final total; if the flow hands off to 12306, re-read that page under the 12306 adapter instead of assuming Ctrip completed the ticket. | ||
| - Stop for the user when QR "扫码", password, SMS "短信", payment verification, or real-name passenger verification appears. Do not retry around authentication, enter identity details not explicitly provided for this booking, or expose document numbers in summaries. | ||
| - Remove optional insurance, packages, coupons, memberships, or paid add-ons unless the user requested them, and re-read the cancellation/change terms and total after any selection. A lower price can carry materially stricter restrictions. |
There was a problem hiding this comment.
[P1] Do not strip automatically applied coupons
When Ctrip pre-applies a discount coupon at checkout, this instruction tells the model to remove it solely because the user did not request it, increasing the payable total; unlike insurance or memberships, an applicable coupon is not a paid add-on. Preserve beneficial coupons while checking restrictions and limit automatic removal to chargeable extras, consistent with the spend-money safety rule in AGENT.md.
| { | ||
| name: 'ctrip', | ||
| category: 'general', | ||
| matches: (url) => /^https?:\/\/(?:(?:www|hotels|flights|trains|vacations|tickets|passport|my|secure)\.)?ctrip\.com\//.test(url), |
There was a problem hiding this comment.
[P2] Match the live Ctrip attraction-ticket hosts
When the user chooses the homepage's 景点门票 product, Ctrip navigates to huodong.ctrip.com/things-to-do/list (and piao.ctrip.com redirects there), but this matcher returns null for both while accepting the non-resolving tickets.ctrip.com. Match the live hosts and test one of those URLs.
| - Treat cards marked "广告" as sponsored placements. Compare the exact product, supplier, dates, included services, and final payable total instead of ranking by homepage position, crossed-out price, member price, or a displayed "起" price. | ||
| - For hotels, set the city/property, "入住" and "离店" dates, rooms, and guests before reading availability. Select the exact "房型", bed, breakfast, occupancy, payment timing, and "退订" / cancellation rule; different rows for the same hotel are not interchangeable. | ||
| - For flights, verify airports, local departure and arrival dates, operating carrier, stops, transfer airports, cabin, baggage "行李" allowance, change/refund rules, and whether separate tickets are involved. Do not compare only the headline fare or assume an overnight arrival is the departure date. | ||
| - For trains, distinguish Ctrip's booking layer from the official 12306 order. Verify train, stations, date, seat class, passenger, service/insurance add-ons, and final total; if the flow hands off to 12306, re-read that page under the 12306 adapter instead of assuming Ctrip completed the ticket. |
There was a problem hiding this comment.
[P2] Remove the reference to a nonexistent 12306 adapter
When the train flow hands off to www.12306.cn, ADAPTERS contains no 12306 matcher and getActiveAdapter() returns null, so the promised 12306 adapter can never supply this guidance. Add that adapter or require a fresh page read without claiming an adapter exists.
| - Treat the review page and "提交订单" as a consequential booking action. Re-read travelers/guests, contact details, itinerary, room/fare, cancellation terms, add-ons, currency, and total, and do not submit without the user's explicit confirmation. | ||
| - Report success only when the product-specific result shows "订单号" plus "预订成功" or, for flights/trains, the applicable "出票成功" status. A form submission, pending confirmation, payment redirect, or itinerary held for payment is not a completed booking. | ||
| - If flights.ctrip.com becomes blank or returns HTTP 432, treat it as an anti-automation response rather than "no flights". Do not retry rapidly; return through www.ctrip.com's "机票" entry after a pause, and ask the user to handle any verification that appears.`, |
There was a problem hiding this comment.
[P2] Reduce the notes to the documented eight-bullet limit
This block adds 10 bullets and 384 words, so every first Ctrip turn pays a sizable prompt cost and violates the repository guidance to keep adapter notes short and the documented eight-bullet maximum. Consolidate at least two bullets so compact and local-model conversations do not lose avoidable context budget.
Summary
Adds a mirrored Ctrip adapter for Chrome and Firefox.
Without this adapter, the agent can compare sponsored or incomplete travel prices, confuse a Ctrip train request with an issued 12306 ticket, or report a submitted/held itinerary as a completed booking.
提交订单and verify product-specific success states.flights.ctrip.comwithout rapid retry loops.Validation
ctrip; the flight host returned HTTP 432 but still selectedctrip, which is now documented as an anti-automation response.node test/run.js: 1398/1399 passed; the single failure predates this branch and is the repository's changelog/package version mismatch.git diff --check: passed.Compatibility and risks
The change is prompt-only and mirrored across both browser builds. No authenticated booking, passenger-data, order, or payment mutation was performed.