Skip to content

fix(acp): handle AuthMethod removal in agent-client-protocol 0.9.0#3154

Closed
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/acp-authmethod-compat-0.9
Closed

fix(acp): handle AuthMethod removal in agent-client-protocol 0.9.0#3154
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/acp-authmethod-compat-0.9

Conversation

@ygd58

@ygd58 ygd58 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #3150

Problem

agent-client-protocol 0.9.0 removed AuthMethod from acp.schema. The newer API uses AuthMethodAgent, AuthMethodEnvVar, AuthMethodTerminal instead. Hermes pinned >=0.8.1,<1.0 in pyproject.toml, so 0.9.0 could be installed, causing ImportError on startup.

Fix

Added compat import:

  1. Try importing AuthMethod (works with 0.8.x)
  2. Fall back to AuthMethodAgent as AuthMethod (works with 0.9.x)
  3. If neither exists, set to None and guard the usage site

Also added if provider and AuthMethod is not None guard to prevent crash when neither import works.

@ygd58

ygd58 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

The test failure (test_429_exhausts_all_retries_before_raising) passes locally and is unrelated to this PR's changes. This appears to be a flaky CI test.

@teknium1

teknium1 commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #5292. Your contribution (AuthMethod compat (duplicate of #3111)) was cherry-picked onto current main with your authorship preserved in git log. Thank you @ygd58!

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]: ACP extra allows agent-client-protocol 0.9.0+, but hermes-acp still imports removed acp.schema.AuthMethod

2 participants