Skip to content

propagate authentication errors from synchronous init - #1478

Open
HhH666-ux wants to merge 1 commit into
AgentOps-AI:mainfrom
HhH666-ux:fix/propagate-auth-errors
Open

HhH666-ux wants to merge 1 commit into
AgentOps-AI:mainfrom
HhH666-ux:fix/propagate-auth-errors

Conversation

@HhH666-ux

Copy link
Copy Markdown

Summary

Client.init() with an invalid API key returns successfully. The async auth refactor moved authentication into a daemon thread, so InvalidApiKeyException / ApiServerException were swallowed and the caller only found out later when exports failed with 401s.

This keeps the background task for async callers, but when init() runs without a running event loop (the synchronous API), it authenticates before returning and lets InvalidApiKeyException / ApiServerException propagate to the caller. Other unexpected errors are still swallowed as before, so the happy path does not change.

Tests

  • pytest tests/integration/test_auth_flow.py -q — 2 passed (test_auth_flow, test_auth_flow_invalid_key)

Fixes #1336

@HhH666-ux
HhH666-ux force-pushed the fix/propagate-auth-errors branch from 4f7cf54 to 4694fdd Compare November 6, 2026 04:50

This branch has not been deployed

No deployments
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: Client.init() silently succeeds with invalid API key — async auth swallows exceptions

1 participant