mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-24 16:54:43 +00:00
fix(P2): align v2 pre-pass placeholder with P2 regex — include skill_view(name='X')
The P2 extraction regex expects skill_view(name='X') but the v2 pre-pass placeholder used 'reload with skill_view before relying on it'. This mismatch meant _pruned_skill_names was always empty, so the P2 defense (pre-LLM extraction + post-LLM re-injection) never fired. Align both Phase 1 and pre-pass v2 placeholders to use the callable skill_view(name='X') format so the regex matches and the agent can reload the pruned skill directly. Addresses review comment from @liuhao1024 on PR #44166.
This commit is contained in:
parent
c1b520d165
commit
3d8a31432d
1 changed files with 2 additions and 2 deletions
|
|
@ -554,7 +554,7 @@ def _summarize_tool_result(tool_name: str, tool_args: str, tool_content: str) ->
|
|||
if tool_name == "skill_view":
|
||||
name = args.get("name", "?")
|
||||
if content_len > 5000:
|
||||
return f"[skill_view] name={name} ({content_len:,} chars) [SKILL_PRUNED: content lost in compression; reload with skill_view before relying on it]"
|
||||
return f"[skill_view] name={name} ({content_len:,} chars) [SKILL_PRUNED: content lost in compression; reload with skill_view(name='{name}')]"
|
||||
return f"[skill_view] name={name} ({content_len:,} chars)"
|
||||
|
||||
if tool_name in {"skills_list", "skill_manage"}:
|
||||
|
|
@ -989,7 +989,7 @@ class ContextCompressor(ContextEngine):
|
|||
f"[skill_view] name={skill_name} "
|
||||
f"({len(original_content):,} chars) "
|
||||
f"[SKILL_PRUNED: content lost in compression; "
|
||||
f"reload with skill_view before relying on it]"
|
||||
f"reload with skill_view(name='{skill_name}')]"
|
||||
)
|
||||
result[idx] = {**result[idx], "content": placeholder}
|
||||
pruned += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue