hermes - 💡(How to fix) Fix test: Feishu test_hydrate_bot_identity fails when lark-oapi SDK is not installed

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

tests/gateway/test_feishu_bot_admission.py::test_hydrate_bot_identity_populates_self_ids_from_bot_v3_info fails with KeyError: 'uri' because _hydrate_bot_identity() uses BaseRequest.builder() which requires the lark-oapi SDK.

Root Cause

_hydrate_bot_identity() (line 3878 in gateway/platforms/feishu.py) builds a request via BaseRequest.builder() which requires lark_oapi.core imports (BaseRequest, HttpMethod, AccessTokenType). When the SDK is absent, these names are undefined and the fake _client.request callback is never invoked, so captured["uri"] is never set.

Fix Action

Fix

The test should mock the builder chain or use pytest.importorskip("lark_oapi").

Code Example

.venv/bin/python -m pytest tests/gateway/test_feishu_bot_admission.py::test_hydrate_bot_identity_populates_self_ids_from_bot_v3_info -v
RAW_BUFFERClick to expand / collapse

Summary

tests/gateway/test_feishu_bot_admission.py::test_hydrate_bot_identity_populates_self_ids_from_bot_v3_info fails with KeyError: 'uri' because _hydrate_bot_identity() uses BaseRequest.builder() which requires the lark-oapi SDK.

Root Cause

_hydrate_bot_identity() (line 3878 in gateway/platforms/feishu.py) builds a request via BaseRequest.builder() which requires lark_oapi.core imports (BaseRequest, HttpMethod, AccessTokenType). When the SDK is absent, these names are undefined and the fake _client.request callback is never invoked, so captured["uri"] is never set.

Fix

The test should mock the builder chain or use pytest.importorskip("lark_oapi").

Reproduction

.venv/bin/python -m pytest tests/gateway/test_feishu_bot_admission.py::test_hydrate_bot_identity_populates_self_ids_from_bot_v3_info -v

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING