Skip to content

fix(honcho): graceful degradation for bad URL and add disable command#2757

Open
teyrebaz33 wants to merge 1 commit into
NousResearch:mainfrom
teyrebaz33:fix/honcho-nonprintable-url
Open

fix(honcho): graceful degradation for bad URL and add disable command#2757
teyrebaz33 wants to merge 1 commit into
NousResearch:mainfrom
teyrebaz33:fix/honcho-nonprintable-url

Conversation

@teyrebaz33

Copy link
Copy Markdown
Contributor

Fixes #2736 (item 5)

Problem

A terminal escape sequence accidentally pasted into honcho.base_url (e.g. \x1b from copy-paste) caused the Honcho SDK to raise Invalid non-printable ASCII character at startup. The exception was caught but the raw error string was printed to the terminal, corrupting terminal state and making all tools appear broken. Removing honcho: {} from config did not fix it if the bad value was also in an env var.

Changes

  • honcho_integration/client.py: Add _sanitize_url() helper that returns None with a warning when base_url contains non-printable ASCII characters. Applied in from_global_config(), from_env(), and get_honcho_client().
  • honcho_integration/cli.py + hermes_cli/main.py: Add hermes honcho disable command that sets enabled: false in config and warns the user about leftover HONCHO_API_KEY / HONCHO_BASE_URL environment variables.
  • tests/test_honcho_client_config.py: Add TestSanitizeUrl covering clean URL, config-file bad URL, and env-var bad URL.

Not implemented

The issue also mentions a full reinstall was required. This PR prevents the broken state from occurring; a recovery path beyond hermes honcho disable was not added as it would require broader changes.

A terminal escape sequence accidentally pasted into honcho base_url
(e.g. \x1b from copy-paste) caused the Honcho SDK to raise
'Invalid non-printable ASCII character' at startup. The exception was
caught but the raw error string was printed back to the terminal,
corrupting terminal state and making all tools appear broken.

Changes:
- Add _sanitize_url() in honcho_integration/client.py: returns None
  with a warning when base_url contains non-printable ASCII characters;
  applied in from_global_config(), from_env(), and get_honcho_client()
  escape sequences are never written raw to the terminal
- Add 'hermes honcho disable' command (cmd_disable) that sets
  enabled: false in config and warns about leftover env vars
- Add TestSanitizeUrl test class covering clean URL, config-file bad
  URL, and env-var bad URL scenarios
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins labels May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Obsidian Vault as Persistent Shared Memory Layer

2 participants