From 18ba6cc6d2f495524e09d398c98d57a640f7c6df Mon Sep 17 00:00:00 2001 From: sulimanbenhalim Date: Thu, 5 Nov 2026 01:33:34 +0200 Subject: [PATCH] fix: let Tom search repository history when asked who worked on a feature --- .../ToolDecisionProviders/OpenAIToolDecisionProvider.php | 2 +- .../OpenAIToolDecisionProviderTest.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Services/ToolDecisionProviders/OpenAIToolDecisionProvider.php b/app/Services/ToolDecisionProviders/OpenAIToolDecisionProvider.php index cab3f35c9..4b825eea9 100644 --- a/app/Services/ToolDecisionProviders/OpenAIToolDecisionProvider.php +++ b/app/Services/ToolDecisionProviders/OpenAIToolDecisionProvider.php @@ -43,7 +43,7 @@ SearchCommits::class => 'Does answering the latest message need public social posts or discussions on /dev/null, including community reactions, feedback, announcements or what people said about a feature or incident? Select alongside the knowledge base or repository history when those provide other parts of the answer; the user need not explicitly say search. Do not use posts as a substitute for documented platform facts, Git history or exhaustive counts. Exclude community counts by location, profile bio or GitHub organization, member lists or rankings, general advice and questions solely about feature usage.', SearchKnowledgeBase::class => 'Does the latest message need documented facts about /dev/null features, terminology, usage, rules, origins, stack, lore or notable events, including milestones, public incidents, downtime, security patches and recovery? This includes public information about Tom himself, how he works and which AI models or providers power him. Resolve follow-ups using the platform context, and check possible site features including misspellings or corrections. Search for a requested public platform topic even if an earlier reply claimed not to know it. Select alongside social posts or repository history when an answer also needs reactions or development context. Exclude explicitly general-knowledge questions and requests solely for GitHub metrics, member counts or feature authorship.', RepositoryInsights::class => 'Does the latest message specifically request /dev/null GitHub metadata: stars, forks, open issue or PR counts, code languages, top commit contributors explicitly to the GitHub repository, recent production merges or contribution opportunities? Exclude platform usage and member leaderboards (including who has the most commits or followers here), the platform stack or AI models/providers powering Tom, other repositories, deployment status and who implemented a feature.', - SearchRepositoryHistory::class => 'Does answering the latest message need the development history of a /dev/null feature: who added or changed it, when it was introduced, how it evolved or what changed? Search merged PRs and Git commit messages even when the user does not explicitly mention GitHub. Select alongside the knowledge base for current behavior and social posts for community reactions when needed. Exclude repository contributor rankings or commit-count totals, community counts, profile bios, member or follower rankings, source code, diffs and questions solely about current feature usage or social discussions. Repository history does not establish operational incident or deployment timelines.', + SearchRepositoryHistory::class => 'Does answering the latest message need the development history of a /dev/null feature: who added, built, worked on or changed it, when it was introduced, how it evolved or what changed? This includes asking who worked on "this" or "it" when the message or thread makes clear which feature or change it means, even alongside congratulations. Search merged PRs and Git commit messages even when the user does not explicitly mention GitHub. Select alongside the knowledge base for current behavior and social posts for community reactions when needed. Exclude repository contributor rankings (naming who worked on one feature is not a ranking) or commit-count totals, community counts, profile bios, member or follower rankings, source code, diffs and questions solely about current feature usage or social discussions. Repository history does not establish operational incident or deployment timelines.', CommunityStats::class => <<<'TEXT' Does the user request a supported aggregate count, rather than a directory or leaderboard of individual members? Supported: current total members; signups; distinct public authors; total public commits including replies; members matching one profile location; a breakdown by profile location (including top countries); members mentioning one bio programming language (including Gophers, Pythonistas, Rustaceans); members publicly belonging to one GitHub organization, including a login or github.com URL. diff --git a/tests/Unit/Services/ToolDecisionProviders/OpenAIToolDecisionProviderTest.php b/tests/Unit/Services/ToolDecisionProviders/OpenAIToolDecisionProviderTest.php index bd6299c17..414511eb7 100644 --- a/tests/Unit/Services/ToolDecisionProviders/OpenAIToolDecisionProviderTest.php +++ b/tests/Unit/Services/ToolDecisionProviders/OpenAIToolDecisionProviderTest.php @@ -39,6 +39,12 @@ 'Do not use post search or repository tools to work around this', ); + expect(json_encode($questions->firstWhere('name', 'SearchRepositoryHistory')))->toContain( + 'built, worked on or changed it', + 'makes clear which feature or change it means, even alongside congratulations', + 'naming who worked on one feature is not a ranking', + ); + return $request->url() === 'https://api.openai.com/v1/decisions' && $request['model'] === 'gpt-6-luna' && $questions->pluck('name')->all() === ['SearchCommits', 'SearchKnowledgeBase', 'RepositoryInsights', 'SearchRepositoryHistory', 'CommunityStats']