[WIP] Fix bugs in horse racing agents' rules#94
Merged
Bitpass-dev merged 1 commit intomainfrom Mar 14, 2026
Merged
Conversation
Copilot stopped work on behalf of
Bitpass-dev due to an error
March 14, 2026 00:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original prompt
Problem
There are two bugs affecting all 10 horse racing agents in
AI-Sports-Almanac/backend/src/agents/:Bug 1 — Rule 3 allows asking users to paste data (all 10 agents)
Current Rule 3 in every horse racing agent's
getSystemPrompt()reads:This causes the agent to ask the user to paste race cards when a venue exists but isn't in the live data feed. This is terrible UX. The agent should never ask users to paste anything.
Bug 2 — UK All-Weather agent shows non-AW races (e.g. Saint-Cloud, Chepstow) when no AW venues match
The
horse-racing-uk-all-weather-agent.tssystem prompt is missing a rule that tells it to ignore any races in the LIVE DATA that are NOT at the 6 UK AW venues (Lingfield, Wolverhampton, Kempton, Chelmsford, Southwell, Newcastle). When the live data contains turf or jump races (Saint-Cloud, Chepstow, etc.) and no AW races, the agent currently lists those irrelevant races and suggests the user wait or switch to jump racing.Bug 3 — Missing Rule 8 in some agents (inconsistency)
Several agents (e.g.
horse-racing-uk-all-weather-agent.ts,horse-racing-ireland-all-weather-agent.ts,horse-racing-uk-grass-agent.ts) are missing Rule 8 which tells the agent what to do when live data says "No live fixture data is available". This rule exists in some agents but not others.Also, the
horse-racing-handicap-agent.tsstill references "the other 7 horse racing agents" in its system prompt — this should be updated to "9" since there are 10 total.Fix Required
Update the
getSystemPrompt()method in all 10 horse racing agent files:AI-Sports-Almanac/backend/src/agents/horse-racing-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-uk-grass-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-uk-all-weather-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-uk-jumps-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-ireland-grass-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-ireland-all-weather-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-ireland-jumps-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-international-agent.tsAI-Sports-Almanac/backend/src/agents/horse-racing-handicap-agent.tsAI-Sports-Almanac/backend/src/agents/cheltenham-festival-agent.tsChanges to make in EVERY agent's BEHAVIOUR & INTERACTION RULES:
Replace Rule 3 (currently: "Only ask the user to paste race card data if...") with:
Add Rule 8 (to any agent that is missing it — check each file):
Add Rule 9 to ALL agents:
The
[agent-specific venues]text should be tailored per agent:horse-racing-agent.ts: "UK and Irish horse racing venues"horse-racing-uk-grass-agent.ts: "UK grass flat turf racecourses"horse-racing-uk-all-weather-agent.ts: "the 6 UK all-weather venues: Lingfield (Polytrack), Wolverhampton (Tapeta), Kempton (Polytrack), Chelmsford (Polytrack), Southwell (Fibresand/Polytrack), and Newcastle (Tapeta)"horse-racing-uk-jumps-agent.ts: "UK National Hunt jump racecourses"horse-racing-ireland-grass-agent.ts: "Irish grass flat turf racecourses"horse-racing-ireland-all-weather-agent.ts: "Dundalk Polytrack — Ireland's only all-weather venue"horse-racing-ireland-jumps-agent.ts: "Irish National Hunt jump racecourses"horse-racing-international-agent.ts: "international racing venues: Meydan, ParisLongchamp, Flemington, Sha Tin, Tokyo, Randwick, Churchill Downs, Belmont"horse-racing-handicap-agent.ts: "UK and Irish horse racing venues (all surfaces)"This pull request was created from Copilot chat.
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.