mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Salvage of #3389 by @binhnt92 with reasoning fallback and retry logic added on top. All 7 auxiliary LLM call sites now use extract_content_or_reasoning() which mirrors the main agent loop's behavior: extract content, strip think blocks, fall back to structured reasoning fields, retry on empty. Closes #3389.
This commit is contained in:
parent
ab09f6b568
commit
658692799d
7 changed files with 414 additions and 14 deletions
|
|
@ -948,9 +948,9 @@ def llm_audit_skill(skill_path: Path, static_result: ScanResult,
|
|||
|
||||
# Call the LLM via the centralized provider router
|
||||
try:
|
||||
from agent.auxiliary_client import call_llm
|
||||
from agent.auxiliary_client import call_llm, extract_content_or_reasoning
|
||||
|
||||
response = call_llm(
|
||||
call_kwargs = dict(
|
||||
provider="openrouter",
|
||||
model=model,
|
||||
messages=[{
|
||||
|
|
@ -960,7 +960,13 @@ def llm_audit_skill(skill_path: Path, static_result: ScanResult,
|
|||
temperature=0,
|
||||
max_tokens=1000,
|
||||
)
|
||||
llm_text = response.choices[0].message.content.strip()
|
||||
response = call_llm(**call_kwargs)
|
||||
llm_text = extract_content_or_reasoning(response)
|
||||
|
||||
# Retry once on empty content (reasoning-only response)
|
||||
if not llm_text:
|
||||
response = call_llm(**call_kwargs)
|
||||
llm_text = extract_content_or_reasoning(response)
|
||||
except Exception:
|
||||
# LLM audit is best-effort — don't block install if the call fails
|
||||
return static_result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue