fix(assistant): the tour package keeps to two prompt lines

The registry refuses a package with more than two prompt lines at load, which
failed every suite that boots the assistant. The planning line now holds the
tools, the profiles and the hike rules.
This commit is contained in:
Maurice
2026-10-23 20:47:32 +02:00
parent f5ad78d988
commit 0c3cd63e34
2 changed files with 4 additions and 5 deletions
@@ -134,9 +134,7 @@ export const TOUR_CARDS: DomainCards = {
},
},
prompt: [
"Every tour type can be planned and saved. Pick the tool by what the user does: a hike (also a trek over several days) propose_hike then create_hike; a bike tour or a run propose_tour (activity bike or run) then create_tour; a city walk propose_city_walk then create_city_walk; a paddle tour plan_paddle_route then create_paddle_tour (it needs water_context river or lake); a ski or winter tour (alpine, snowboard, cross-country, ski touring, snowshoe, winter hike) plan_ski_route then create_ski_tour with the same points, discipline and options. Pass the plan's points in order as waypoints: the from of the first leg and the to of every leg.",
"Profiles: a bike tour is touring for a city or trekking bike on paved ways and cycle paths (the default), road for a road bike on asphalt only, gravel for a gravel bike on gravel and farm tracks, mtb for a mountain bike on rough tracks and trails; a run is running on mostly paved ways (the default) or trail on forest tracks and natural paths. Choose from what the user rides or how they run; ask when it is not clear. A run needs the runner's pace (run_pace_seconds_per_km, 330 for 5:30 min/km) for its time and to be created: ask for it, never guess one.",
'Hikes: call propose_hike with a name, and day_id and start_time when known; to compare ways, call it up to three times in one step, each with a variant_label and along false, the way you recommend first (the card shows the first one chosen). Call create_hike only once the user chose a way. A hike over several days is one hike: stage_end on each stop a day ends at (no day_id), then each stage on its day with assign_place_to_day and tourStageKey.',
"Every tour type can be planned and saved. Pick the tool by what the user does: a hike (also a trek over several days) propose_hike then create_hike; a bike tour or a run propose_tour (activity bike or run) then create_tour; a city walk propose_city_walk then create_city_walk; a paddle tour plan_paddle_route then create_paddle_tour (it needs water_context river or lake); a ski or winter tour (alpine, snowboard, cross-country, ski touring, snowshoe, winter hike) plan_ski_route then create_ski_tour with the same points, discipline and options, passing the plan's points in order (the from of the first leg and the to of every leg). Profiles: a bike tour is touring (city or trekking bike, the default), road (asphalt only), gravel (gravel and farm tracks) or mtb (rough tracks and trails); a run is running (mostly paved, the default) or trail; ask when it is not clear. A run needs the runner's pace (run_pace_seconds_per_km, 330 for 5:30 min/km): ask for it, never guess one. A hike: propose_hike with a name, and day_id and start_time when known; to compare ways call it up to three times in one step, each with a variant_label and along false, the way you recommend first; create_hike only once the user chose a way. A hike over several days is one hike: stage_end on each stop a day ends at (no day_id), then each stage on its day with assign_place_to_day and tourStageKey.",
'The app draws a proposed, planned or saved tour (route, profile, stops, times, weather, warnings) and lists of tours as cards: do not repeat their figures or list them again, say in one sentence what matters. Once a tour is planned, offer what goes with it: places along it (search_tour_pois), what to pack (get_tour_packing, link_tour_packing), the GPX file (export_tour_gpx).',
],
};
@@ -271,8 +271,9 @@ describe('what the tours tell the model about every type', () => {
for (const tool of ['propose_tour', 'create_tour', 'create_paddle_tour', 'create_ski_tour', 'plan_ski_route']) {
expect(every).toContain(tool);
}
const profiles = CARD_PROMPT_LINES.find((line) => line.startsWith('Profiles:'));
for (const word of ['road', 'gravel', 'mtb', 'trail', 'run_pace_seconds_per_km']) expect(profiles).toContain(word);
// The profiles share the planning line: a package may add two prompt lines at most.
for (const word of ['Profiles:', 'road', 'gravel', 'mtb', 'trail', 'run_pace_seconds_per_km'])
expect(every).toContain(word);
for (const line of CARD_PROMPT_LINES) expect(systemPrompt('English')).toContain(line);
});
});