Avoid redundant skill_view calls during forced skill sends
This commit is contained in:
@@ -952,7 +952,7 @@ async function cmdUse(args){
|
||||
const detail = await api(`/api/skills/content?name=${encodeURIComponent(match.name)}`);
|
||||
const skillContent = detail&&typeof detail.content==='string' ? detail.content.trim() : '';
|
||||
if(!skillContent) throw new Error(`Skill \`${match.name}\` has no readable content.`);
|
||||
const directive = `[USER OVERRIDE] You MUST consult skill '${match.name}' via skill_view before responding to the next message.`;
|
||||
const directive = `[USER OVERRIDE] You MUST follow the skill '${match.name}' content provided below before responding to the next message.`;
|
||||
resolve({name:match.name,directive,content:skillContent});
|
||||
if(isCurrentSession()){
|
||||
S.messages.push({role:'assistant', content:`Next turn: skill \`${match.name}\` will be forced.`});
|
||||
|
||||
@@ -77,7 +77,8 @@ def test_directive_injection_before_empty_guard():
|
||||
def test_directive_text_uses_match_name():
|
||||
src = read("static/commands.js")
|
||||
assert "match.name" in src, "directive must use match.name (canonical casing), not raw user input"
|
||||
assert "[USER OVERRIDE] You MUST consult skill '" in src, "directive text must match the specified format"
|
||||
assert "[USER OVERRIDE] You MUST follow the skill '" in src, "directive text must match the specified format"
|
||||
assert "content provided below" in src, "directive must reference the injected skill content"
|
||||
|
||||
|
||||
def test_use_fetches_canonical_skill_content():
|
||||
|
||||
Reference in New Issue
Block a user