Commit f247ec6
committed
fix(skills): prevent empty responses after load_skill
The skill system instruction's rule 2 told the model to follow loaded
skill instructions "before replying to the user". Some models (notably
Gemini) read this as license to treat the load_skill tool call as the
entire turn and stop with no visible output, producing empty responses.
This was most acute for tool-heavy skills, whose next correct action
after load_skill is to call more tools rather than reply.
Two changes to _build_skill_system_instruction:
- Reword rule 2 to drop the "before replying" framing.
- Add rule 7 stating that load_skill only retrieves instructions and
does NOT complete the turn; the model must continue in the same turn
(calling whatever tools the skill requires) and never end with an
empty response right after loading a skill.
Verified in a production environment: the empty-response rate for
Gemini after skill loading dropped substantially with this guidance.
Adds tests asserting the new prompt guarantees on both the default and
prefixed system instruction.1 parent 9e3b43f commit f247ec6
2 files changed
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1758 | 1758 | | |
1759 | 1759 | | |
1760 | 1760 | | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
1761 | 1791 | | |
1762 | 1792 | | |
1763 | 1793 | | |
| |||
0 commit comments