Add OpenRouter app attribution headers to skills_guard and trajectory_compressor
These two files were creating bare OpenAI clients pointing at OpenRouter without the HTTP-Referer / X-OpenRouter-Title / X-OpenRouter-Categories headers that the rest of the codebase sends for app attribution. - skills_guard.py: LLM audit client (always OpenRouter) - trajectory_compressor.py: sync + async summarization clients (guarded with 'openrouter' in base_url check since the endpoint is user-configurable)
This commit is contained in:
parent
cd77c7100c
commit
4d53b7ccaa
2 changed files with 18 additions and 2 deletions
|
|
@ -946,6 +946,11 @@ def llm_audit_skill(skill_path: Path, static_result: ScanResult,
|
|||
client = OpenAI(
|
||||
base_url=OPENROUTER_BASE_URL,
|
||||
api_key=api_key,
|
||||
default_headers={
|
||||
"HTTP-Referer": "https://github.com/NousResearch/hermes-agent",
|
||||
"X-OpenRouter-Title": "Hermes Agent",
|
||||
"X-OpenRouter-Categories": "productivity,cli-agent",
|
||||
},
|
||||
)
|
||||
response = client.chat.completions.create(
|
||||
model=model,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue