Skip to content

Conversation

@lorenss-m
Copy link
Contributor

@lorenss-m lorenss-m commented Jan 2, 2026

Note

Improves authentication and eval lifecycle, plus docs and version updates.

  • Auth is now injected per-request via httpx/aiohttp hooks, preferring the API key set in hud.eval(api_key=...) and falling back to settings; overrides empty/invalid headers
  • Removes static Authorization header from connect_hub MCP config; only sets Environment-Name (auth comes from hooks)
  • Tweaks EvalContext.__aenter__ to register trace/enter before environment connect and centralizes cleanup by delegating failures to __aexit__
  • Adds docs note for local agent execution dependencies in docs/reference/cli/eval.mdx
  • Bumps version and tests from 0.5.0 to 0.5.1 (docs, __version__, pyproject)

Written by Cursor Bugbot for commit afb3ffa. This will update automatically on new commits. Configure here.

@lorenss-m lorenss-m marked this pull request as ready for review January 2, 2026 22:28
@lorenss-m lorenss-m merged commit dfd4f70 into main Jan 2, 2026
9 checks passed
"headers": {
"Authorization": f"Bearer {settings.api_key}",
"Environment-Name": slug,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hub auth fails when Environment imported directly

The Authorization header was removed from connect_hub() and now relies on httpx/aiohttp hooks in hud.eval.instrument to inject auth at request time. However, this module is only auto-imported when using import hud. Users who follow the documented pattern in hud/environment/__init__.py (from hud.environment import Environment) won't trigger the instrumentation, causing hub connections to fail with authentication errors. The old code included the header directly in mcp_config, ensuring auth worked regardless of import path.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants