Skip to content

fix(honcho): bypass API key validation for local servers#3560

Closed
devorun wants to merge 1 commit intoNousResearch:mainfrom
devorun:patch-16
Closed

fix(honcho): bypass API key validation for local servers#3560
devorun wants to merge 1 commit intoNousResearch:mainfrom
devorun:patch-16

Conversation

@devorun
Copy link
Copy Markdown
Contributor

@devorun devorun commented Mar 28, 2026

Bypasses the strict API key validation when running a local Honcho server (localhost or 127.0.0.1). If a local base_url is detected and no API key is provided, it assigns a dummy key so the initialization doesn't crash.

What does this PR do?

Fixes #3555

bug:

When running a local Honcho server (localhost or 127.0.0.1), the system throws an Honcho init failed: Invalid API key error. This happens because local instances do not require an API key, but the Honcho client validation expects a non-empty string to initialize.

Fix:

Added a __post_init__ check inside HonchoClientConfig. If a local base_url is detected and no API key is provided, it automatically assigns a "local_dummy_key".

This safely bypasses the strict validation for local development setups without affecting production environments or remote servers.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

Bypasses the strict API key validation when running a local Honcho server (`localhost` or `127.0.0.1`). If a local base_url is detected and no API key is provided, it assigns a dummy key so the initialization doesn't crash.
@teknium1
Copy link
Copy Markdown
Contributor

Merged via #3644 — combined with #3482 and #3570. Your post_init approach informed the fix design. Thanks @devorun!

@teknium1 teknium1 closed this Mar 29, 2026
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.

[Bug]: Invalid Honcho API key from local host???

2 participants