Skip to content

fix: prevent redundant skill reloading in conversation#11838

Merged
hannesrudolph merged 1 commit intomainfrom
fix/skill-dedup-constraint
Mar 2, 2026
Merged

fix: prevent redundant skill reloading in conversation#11838
hannesrudolph merged 1 commit intomainfrom
fix/skill-dedup-constraint

Conversation

@hannesrudolph
Copy link
Copy Markdown
Collaborator

@hannesrudolph hannesrudolph commented Mar 2, 2026

Problem

Models sometimes re-invoke the skill tool for a skill whose instructions are already present in the conversation history. This wastes tokens and adds unnecessary tool call round-trips.

Root Cause

The <mandatory_skill_check> instructions in the system prompt tell the model to check for applicable skills "before producing ANY user-facing response" but never say to skip if the skill is already loaded. The model sometimes complies literally and re-loads the same skill.

Fix

Added a single deduplication constraint to the CONSTRAINTS block in getSkillsSection():

- Do NOT reload a skill whose instructions already appear in this conversation.

One-line change. All existing tests pass.

Interactively review PR in Roo Code Cloud

Add deduplication constraint to skill matching instructions so models
don't re-invoke the skill tool for content already present in the
conversation history.
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Mar 2, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 2, 2026
@hannesrudolph hannesrudolph merged commit 459f270 into main Mar 2, 2026
18 checks passed
@hannesrudolph hannesrudolph deleted the fix/skill-dedup-constraint branch March 2, 2026 23:47
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Mar 2, 2026
@github-actions github-actions bot mentioned this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants